androidandroid-input-filter

How can I take inputs in multiple languages in android


I am working on an android application that will be used possibly by two sets of users. One will operate the app in English language and will enter all the information in English. However, a set of users would like to make the entries in Hindi.

Now my app can be displayed in both languages by having different sets of string.xml file and based on the language being used on phone or some setting in App. But my app will have a lot of forms in which user needs to input values that can be in hindi or english. I am not sure how to handle this. The exact questions will be:

  1. How do I save the data entered in hindi in my database?
  2. If somehow I do just word by word translation, there is a great chance of the meaning being lost. Is there any way to solve this?
  3. I have to create reports based on these entries, if they are in different language, how hard will it be to insert them in database?

I would appreciate some solid pointers if you don't have time or energy to explain everything. Of course some fundamental explanations are most welcome.


Solution

  • By default TEXT fields in Android's sqlite3 are stored as UTF-8. I understand Hindi is encoded with UTF-8 and so is English so saving the text in one or other language shouldn´t be a problem.

    Regarding the translation, see this question in SO where there is a discussion about different alternatives: https://stackoverflow.com/questions/17056168/google-translate-or-similar-api-for-android