简体   繁体   中英

Want to use urdu keyboard in my android app

My question is that how can i use Urdu keyboard in my android app? basically i am a beginner and using eclipse. i am making a book app in Urdu language. in which i'd like to add a search view through which user can search the contents in list view easily. but the problem is that i have made the app in Urdu language so i have to use Urdu keyboard for searching. so is there any easy way through which whenever user clicks on the search-bar Urdu keyboard appears to search ? i have tried to make custom keyboard but it is very difficult to make. and as per my research changing input language by force using java code is not recommended.

You have to make your own custom keyboard. It is not too difficult. You can follow the complete tutorial present at http://www.fampennings.nl/maarten/android/09keyboard/index.htm .

Summary:

You need to make customized layout of keyboard in URDU (You can use unicodes characters for urdu in your layout file http://tabish.freeshell.org/u-font/chart.html ) Layout will contain key tags for each key. Each key tag will have label in urdu and unique keycode of your choice. Then you need to implement OnKeyboardActionListener interface and override onKey method. In this method you need to search for the view in focus (if it is not an EditText then abort). Then you need to executes an action based on the actual key code (which in this case is appending the corresponding urdu character in EditText). Hope this will help you

I have found the following two websites that highlight your problem and have given a well explained tutorial, these are:

http://www.fampennings.nl/maarten/android/09keyboard/index.htm

http://code.tutsplus.com/tutorials/create-a-custom-keyboard-on-android--cms-22615

this will help you to create a customized virtual keyboard after this all you have to do is replace the keycodes for your desires keycodes; the unicode are written in this website

http://unicode-table.com/en/#arabic

Remember you have to use the Dec Code 1605 not the hex U+005. I still dont know how to implement the labels part, so if you find that out, please mention in the comments

PS, dont forget to mark this as an Answer

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM