How can I take inputs in multiple languages in android - 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:
How do I save the data entered in hindi in my database?
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?
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.

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

Related

Maximum number of words you can add to android keyboard dictionary

I want to add words to android keyboard dictionary programmatically.
Am I correct to assume that speech to text will for a certain word will improve if it is in dictionary
How many words can I add in dictionary 1000, 10,000 or 100,000, is there any offical limit around size of dictionary (in MB)
You are right. If the system knows how the word is written correctly it will then match the spoken word more exactly. Otherwise it will search between the existing words and probably takes something wrong. But the algorithm is allready really strong and precise.
There is no exact number or limit (nothing published officially). It depends on the device storage. But I did a research and will provide it to you:
Way to store a large dictionary
How to achieve a little dictionary
Hope that answers your questions a bit. Cheers! :)

i am trying to make android app which will contain story[Textual]

I am thinking to make book like app which should have more then 100 topic to read. And user can even change language like Hindi or English . Basically it will behave as book. My question is that where should I store that textual data in XML file or in database . If answer is database then how can I change language of textual data in app
I don't understand what you mean by android book.
Anyway if you are asking about how to change the language of your app maybe this link is what do you need:
How can I change language of my application

Localization of external data and scalability

When a user finishes a workout in my app the workout is stored on their device with the name of the exercise together with an ID and some other fields.
Now that Im localizing the app Ive run into the problem that Ill have to "manually" translate the exercise names to the localized language. This brings up the question of scalability. When my app is available in many more languages Id like a system which is lightweight and so that minimal amount of work has to be done to translate exercises.
My most robust idea this far is:
Using the ID of each exercise to set its data when loading it. Name, instructions and all other fields will then be loaded in the localized language upon launch. The database will update itself when it detects that a new language is available. This system could be used throughout the app to translate schedules and all other data containing exercises as well. This system is also good when downloading images for the exercises from my future server.
Now on paper this seems very good. But I dont want to implement it without asking here since I didnt find any good resources on how to implement such a thing.
Thanks in advance.
Reading your question again, my understanding is that you store the actual String of the exercise name. Why not just store the int pointing to a string.xml value, like for instance R.string.situps. This way it is independent of language and, when reloaded, the correct language will be chosen.
Perhaps this is what you mean with ID?
In that case I believe that to be a good idea :)

Best approach for android autocomplete search box

I would like any suggestions on how to implement a fast autocomplete search box on android.
Useful info:
1) Data will be stored locally on phone memory. No database or network should be needed.
2) There is no restriction on the type of file that will be used. Could be simple text file, XML file, or whatever suits best.
3) The file will contain a large amount of records that are distinguished by a unique ID/CODE.
There will be also a human readable name for the record and a text with more info on the record like
CODE: HUMAN_REPRESENTATION: EXTRA_INFO:
AF32 Orange The orange (specifically, the sweet orange) is the fruit of the citrus species Citrus...
AF33 Apple The apple is the pomaceous fruit of the apple tree...
4) The user will type on the text area the HUMAN_REPRESENTATION string he wants, and he will be shown a list of matching records to select of.
5) While typing he should be given auto-complete suggestions so he would not have to type the exact phrase.
6) The amount of records will be about 15,000.
So which is the best way to store and retrieve data as fast as possible?
What file type would you suggest? Should the data be split into many files? Can I use a specific API?
I would really be thankful for any directions here, as I am new in android development, but experienced in desktop applications.
EDIT :
Since I had no answers in many days, I would like to know if my question is not clear enough or if it has already been answered. Please comment.

Android: dealing with spanish e accent

I am working on an Android app that I would like to code in such a way so that the Spanish characters coming from the database are read as equivalent to the English ones. For instance, cafe and café would be identical.
Is there a way to do this?
Do you mean that you want queries to find both "cafe" and "café" when you search for "cafe"? You should be able to use a regular expressions to do this.
If this needs to be done on the fly, you could write a function that parses the request for 'e' and generate the correct regular expression before creating the DB query.

Categories

Resources