Thursday, June 2, 2011

الآن يمكنك الكتابة بالعربية على الأندرويد باستخدام لوحة مفاتيح آبل اللاسلكية

لقد كتبت تدوينة الأسبوع الماضي تتحدث عن كيفية إضافة اللغة العربية كلغة ثانية على لوحة مفاتيح آبل اللاسلكية لاستخدامها على هاتف الأندرويد. ولكني قد كتبتها باللغة الإنجليزية. وبعد مرور أسبوع تقريبا جاءت مبادرة المجلس الأعلى للاتصالات وتكنولوجيا المعلومات بدولة قطر لدعم المحتوى العربي على شبكة المعلومات. بالطبع لم تكن هذه هي المبادرة الأولى فقد نظم المجلس الأعلى مؤتمر كتكوم الذي كانت إحدى محاوره الرئيسية دعم المحتوى العربي على شبكة المعلومات.
وبعد تشجيعهم لي على موقع تويتر فلم أجد بدا من أن هذه التدوينة هي أولى تدوينة لكتابتها باللغة العربية لأنها تخدم لغتي الحبيبة العربية شكلا ومضمونا، وإليكم التدوينة.

إذا كنت محظوظا بما فيه الكفاية بتملك لوحة مفاتيح لاسلكية - بلوتوث وخاصة لوحة مفاتيح آبل اللاسلكية، إذًا فإنه من الممتع استخدامها للكتابة على هاتف الأندرويد خاصتك لكونها مريحة جدا في الكتابة. ولحسن الحظ أيضا، فهناك عدة تطبيقات على سوق تطبيقات أندرويد تتيح لك ذلك، أذكر منها بالأخص اثنين: BlueInput و BlueKeyboard JP.
هناك أيضا العديد من مقاطع الفيديو التي تشرح كيفية استخدام هذه البرامج منها على سبيل المثال هذا المقطع:



ربما لاحظت أن اللغات المدعومة في التطبيق السالف ذكره لا تشمل سوى الإنجليزية والألمانية واليابانية، أي أن العربية غير مدعومة. أما في التطبيق الثاني فالإنجليزية فقط هي المدعومة وحدها. وبما أني أكتب كثيرا على الهاتف بالعربية فكم تمنيت أن أكتب باستخدام لوحة المفاتيح لما وجدته من سهولة استخدامها وبالأخص في المؤتمرات والمحاضرات حين أريد كتابة ملاحظات أو إرسال تغريدات آنية. المهم فقد راسلت مطوري هذه التطبيقات وطلبت منهم إضافة العربية، ولكن أحدهم لم يرد مطلقا والآخر أخبرني أنهم بصدد طرح إصدار جديد من شأنه إضافة لغات جديدة حسب اختيار المستخدم. لم يسعني الانتظار وخصوصا أنهم لم يحددوا موعدا ثابتا.

بعد البحث في شكبة المعلومات والدراسة السريعة لتصميم وبناء نظام الأندرويد، فقد قررت أن أضف دعم العربية بنفسي. وبالفعل تم بحمد الله مرادي وأنشأت تحديث للأندرويد وهو ما يطلق عليه ROM Update
من شأنه إضافة اللغة العربية كلغة ثانية بحيث تعمل على أي تطبيق للوحة المفاتيح على كل تطبيقات الهاتف. وبما أن هذا التحديث يعدل في نظام التشغيل فيجب أن يكون جهازك مفتوح وهو ما يسمي بالروتنج أو Rooting.
هذا دليل جيد جدا للروتنج أنصح بالرجوع إليه إذا لم تكن قد فعلت بعد.

في الوقت الحالي هذا التحديث مصمم فقط لجهاز جوجل نكسس إس المحمل بنظام تشغيل معدل موداكو أو سيانوجنمود. ولكن لا يعني هذا أن بقية الأجهزة غير مدعومة وذلك لأني ليس عندي الوقت الكافي لحزم التحديث لجميع الأجهزة المتوفرة. إذا كنت مهتما، فقط اترك تعليق أدناه مع ذكر نوع جهازك ونظام تشغيله المعدل وسيسعدني عمل التحديث لجهازك.

للتحميل وكيفية التنصيب والاستخدام، راجع التدوينة السابقة.
هذا كل ما أردت كتابته، في انتظار تعليقاتكم ويسعدني مساعدتكم.
والسلام عليكم
حسام


Read more...

Thursday, May 26, 2011

[Android] Adding Arabic Layout for Bluetooth HID Keyboards

If you are lucky enough to have a bluetooth HID keyboard, like Apple Wireless Keyboard, then it would be ultimate fun to use it on your Android phone for convenient editing. Luckily as well, there are couple of Market apps that let you do this. The first is BlueInput and the other is BlueKeyboard JP. There are many tutorials explaining how you use these apps, here is one of them:


As you can see, only English, Dutch and Japanese layouts are supported. For the other app, only English is supported. As an Arabic speaker, I wished that I could use my keyboard to write in Arabic. I tried to contact the developer of BlueKeyboard JP but he never answered. He even didn't have much time to publish my comment on his website. I contacted Teksoft, the developers of BlueInput, but all what they have said is that they are gonna add more layouts soon.

After some readings in the Android OS architecture, I have developed a ROM update that will add the Arabic layout to ANY HID app you are using! Obviously, your device should be rooted.
A good guide for rooting Nexus S can be found here.

As of the moment, the update is available only for Nexus S running either Cyanogenmod7 or MoDaCo. Although, cooking an update for any device is darn easy, but I don't have much time to do this for all and every device on the market. If you are interested, please leave a comment below mentioning your device model and firmware, and I will cook the update for you.

Download (144 KB):
How to install:

Because you have a rooted device, you should be already having Clockworkmod recovery installed as your recovery manager (or a similar). Flash my update the same as you flash any update.
  1. Download the appropriate file from above and save it on your device sdcard.
  2. Reboot the device in the recovery mode (for Nexus S, hold the Power & Vol-up while switching on, and then select Recovery)
  3. Choose 'install zip for sdcard'
  4. Choose 'choose zip for sdcard'
  5. Select the update file you have saved in step 1
  6. Confirm install by selecting 'Yes - install blah blah...'
  7. Wait a couple of seconds and make sure no errors are displayed
  8. Now choose 'Go Back' and reboot your device normally
How to use:

  1. Assuming you have successfully connected your keyboard and can type in English, wherever you want to write in Arabic, just press the Alt key two times, that simple!
  2. To type again in English, just press the Alt key two times, again!
  3. When writing in Arabic, you can use the shift key to write alef hamza, Arabic comma, semicolon, diacritics (tashkeel) and everything you are used to write on your computer.
  4. You will also notice that digits are written in Hindi, so yes it is real Arabic keyboard :)
Note: in BlueKeyboard JP, there is a bug that will not let you switch to Arabic when the bottom ads are shown, to workaround this, just press 'Esc' on your keyboard for the ads to go away and then you can switch back and forth to/from Arabic.

Important: Don't use this update for devices having physical keyboards. Obviously this will modify their layout.

That's it for now, waiting to hear from you.

Read more...

Sunday, September 26, 2010

Securing apache Basic authentication

The easiest way to secure your apache webserver is using Basic authentication. Users wanting to access your webserver will be prompted to enter a username/password pair to do that. However, Basic authentication is not secure as it does not encrypt these credentials, nor the content itself. The solution comes in Digest authentication. This is how to migrate your server configuration from Basic to Digest authentication.

In Basic authentication, you create a passwords file (using htpasswd command) then configure apache as in the link above. To migrate to Digest authentication all you have to do is to:
  1. Use the command htdigest instead of htpasswd to create users
    htdigest -c /path/to/your/passwords/file "Authentication Realm" username
  2. Configure apache by adding the following:
    AuthType Digest
    AuthName "Authentication Realm"
    AuthUserFile /path/to/your/passwords/file
    Require valid-user

  3. If you have SELinux running, enable httpd to access the passwords file:
    setsebool -P httpd_enable_homedirs 1
  4. Restart apache:
    service httpd restart
Note: the apache user (usually apache) needs to have read access to the passwords file, apparently!

It is worth nothing that Digest authentication only encrypts your password, but not the content. Moreover, anyone sniffing on the packets, having the encrypted password, can use it directly to access your content. To overcome these issues, you have to put your content under SSL, but this is another story.



Read more...

Thursday, August 19, 2010

Nokia Ovi Store distribution market and the axis-of-evil countries

Today I was reading some technical news and came across an article from the Forum Nokia Blog. The article highlights the achievements and new features of the Ovi Store. What drew my attention in this page is the distribution market map of the store. It basically tells which countries have paid apps, which have free only apps, which are totally blocked!




As you can see from the map, these are the axis-of-evil countries that are blocked from the Ovi Store:
  1. Iran
  2. Syria
  3. Sudan
  4. Cuba
  5. North Korea
  6. Cote d'Ivoire
  7. Congo
  8. Zimbabwe
  9. Did my eyes miss something?
This reminds me of the ban of some of these countries from the SourceForge website post Clinton's Internet Freedom Speech. At least Nokia should make this block list under the control of the app publishers, exactly like what SourceForge did.

I don't like the political influence on the technical world. It does not align with the human rights of the people of these countries.

You too Nokia?


Read more...

Monday, June 7, 2010

Who is the true God, Jesus or Allah?

Everything that is made should have a maker. The computer you are using right now did not come from nothing randomly. There should be a maker of it. The earth, sky, mountains, rivers, your body and everything should have a maker. This maker should be one and only one because if there is more than one, there would be much discrepancy throughout the creatures. This creator is the only God who is so powerful, so great and so merciful. This God is called for since Adam, Noah, Moses, Jesus and Mohammad, Peace be upon them all. They all call for the same creator, the same God, Allah. This is what Muslims believe.

As for Jesus, Peace be upon him, he was given birth without a father. Allah sent his angel Gabriel to Jesus mother, Mary with the blessing of a baby. She asked Gabriel, oh how can I have a baby without a father? He replied, for Allah, the most powerful, do you think it is difficult for him? Allah created Eve without a mother, and Adam without a mother, nor a father.

Jews at that time condemned Mary of making illegal love, they did not believe Jesus is a blessed prophet sent from almighty Allah. They even tried killing him over the Cross when he was an adult. However, Allah, the most merciful, sent someone that resembles him to be prosecuted instead of him. Since then, Christians believe it was Jesus was really prosecuted for the humanity sake. They even believe that he is God himself, or the son of God. But how could a God stay in his mother's womb for 9 months? How could he eat and drink and then urinate and defecate? And how was the world managed while he was in his mother's womb?

If you need more information about Allah and Islam, you can check these websites:
http://www.islam-qa.com/en/cat/12
http://www.islamicity.com/education/understandingislamandmuslims/

Peace be upon you.

Read more...

Thursday, June 3, 2010

The undocumented changes in Google Groups posting policies

I have been noticing that my email posts on one of the Google Groups I am subscribed to do not get replies from other members anymore. I was starting to get upset and thought my popularity has dropped and people are totally skipping my emails! I asked Mahmoud what was the last email he got from me and he told me it was several days ago! I logged in to the group website and found that my recent posts do NOT get delivered at all, without a single notice from Google!

After several tests I came to the following:
When your subscription in Google Groups is on email A, you have to really send from this email account A. If you use an email account B with an alternate account A (that appears in the From field), this will not work (as of May 29th and at least for me!)
You will not even get a delivery error from Google in this case because they think you are forging this email.

However, if you send from a totally different account C (and don't try to modify the sender), you will get a delivery error.

Moreover, if you send from account A USING ANY ALTERNATIVE ACCOUNT B, C, D, ... The message will be delivered!

Bottom line, now they only look for the real sender, and if an alternative account is used, they don't reply back with any error.

Read more...

Saturday, September 5, 2009

Getting your location using iPhone with no GPS

One of the main big features in iPhone 3G that was not shipped with its ancestor iPhone 2G is GPS support. You can determine your location using GPS satellites.
It is known that although very accurate, GPS has some drawbacks. It needs a lot of time to connect to the satellites, in the order of tens of seconds. It won't work indoors as well. Moreover, it is banned in Egypt, Syria and North Korea!
Update: It is not banned anymore in Egypt.

So can one determine his location without the aid of GPS technology? The answer is Yes. This can be done by identifying nearby GSM cell towers and query a database that stores their location. So lets divide the rest of this post into 2 parts:


Identifying nearby GSM cell towers

Doing this on the iPhone was a bit tricky. Actually it was a challenge for us at eSpace to get such information. I will list here the challenges we met and how we managed to solve them:
  1. There is no official SDK for iPhone OS 1.x. This was the easiest challenge to solve. Everybody uses iphone-dev for building the iPhone toolchain. Most of the header files in the toolchain are generated by class-dump! This is a tool that takes a binary framework (library) as an input and emits some Objective-C code in a header file that represents symbols in the library. Its idea is as simple as using nm to query symbol names and some extra code to wrap this info in Objective-C syntax.
  2. Even in the non-official toolchain, there is not a word on how to deal with telephony features like calls and text messaging. Thanks to CellStumbler, we used it to get cell information. It is a tool that exploits CoreTelephony framework functionality. CoreTelephony.h is also generated with class-dump.
  3. CellStumbler is very fragile, if you do simple edits in it, it may crash! The guys say it is toolchain bugs! Just keep this in mind if you need to modify it. Be aware that server connection callback never get called, so keep on retrieving cell information until you get something useful.
  4. Because CellStumbler is that fragile, we left the code untouched in its major parts, we just changed the part that outputs results. We then called the binary from a shell and parsed its output to get useful nearby cell information.

Querying a database for cell location

Google used to have a secret API for this. It is called My Location. This is the API it uses in Maps. Unfortunately, at the time of our development, the API was secret, we had to sniff upon packets to/from Google Maps to know what happens under the hood and replays it. Now this API is open to developers, thanks Google.


Read more...