Android app localization with sqlite db - android

Well, i have an android app created in delphi xe7. And i use sqlite data base to store all text there (use it for windows application and android version).
During the first start the program asks user to choose language and then it downloads language data base and some resources from program site. Also user can change language in run time.
But when I've added different language description on google play, it noted me, that my apk file is not localized.
How could I solve this problem?

The problem because Google expects you to create different folders inside your res/ folder for each languge that your app supports.
For example if you have french there should be a file called res/values-fr/strings.xml and if you support spanish there should be a file called res/values-es/strings.xml
This link http://developer.android.com/training/basics/supporting-devices/languages.html explains more.
All is not lost. You can easily write a few lines of code to read your sqlite database and convert those strings into strings.xml files that will keep google happy.

If this this only a hint which is shown in your Google Play Developer Console, but not to your users, then there is no need to worry about it. Your store descriptions can be localized while your app does not use the platfom way to provide the string resource translations.

Related

Android application localization without /res/values/

I have developed an Android application and all strings are displayed in English, as English is the default language on my device.
I wish to display strings in different Indian languages without making any changes to the apk (or at minimal, most changes to the apk file).
Can it be done without having to include specific strings.xml file in the /res/values-locale folder?

Localized Raw Resources from Android Expansion Files

we are currently developing an app that features different localized speech samples located in the different raw-subdirs in the res folder. (raw, raw-de, raw-es, raw-it.. and so on).
Due to this speech samples, the app size exceeds the 50 MB limit on the Google Play Store.
Now I'm about to integrate the Expansion File Handling. I'd like to keep the English base-speech samples in the base package and put all the other samples in the Main Expansion file.
Now my question:
I read all the documentation, but couldn't find a proper answer: If the expansion file is downloaded properly - will Android use the localized speech samples from within the expansion file automatically? Or will I have to load them manually dependent on the current locale?
I mean, all the Resource ID's would be existing, based on the English base samples. Maybe there is some possibility to add localized resources after the app launch to the resource system?

distribute Java classes and res folder separately

I have developed an android application, which uses image files and strings from the res folder. Is it possible for me to distribute the app in a manner that enables the users to modify the strings and images stored in the res folder, without accessing the code from the java classes.
Can I distribute these separately, so that a user can modify the value of the strings and replace the images (not add new or delete existing) and rebuild the apk, without being able to read the Java code?
Thanks.
Ani
I think your best bet would be to build a web interface where users can upload the images and strings they want into a form, you can generate the resources on the server, package it up and sign it, then give them back a download link.
The whole process could be automated as long as you have Java and headless aapt installed on the server.
http://developer.android.com/guide/developing/building/index.html#detailed-build

Choosing the right data storage alternative

I'm coding an android app for parsing sms messages. I need different rules for different countries and idea is to define rules for my country and later open source project so other users can contribute with rules for their countries. XML format is the most convenient in my opinion for defining these rules.
So I have an app which reeds rules from XML file stored in res/raw and users will later be able to update that set of rules or download rules for some other country when those become available.
As I said I have put existing XML files in res/raw, but the problem is when users download new or changed set of rules application can not change or store files in resources (correct me if I'm wrong).
So I have two options now, and I don't like either one. I would like to hear your opinions on the matter.
a) I can keep XML files as local files, but then I must read in default rules from res/raw and copy them into file system on application installation, or keep track of two separate bunch of files. Is it possible to preinclude files on file system when installing an app?
b) I can keep XML code in database, but also copy it from files at install time. Or even worse code XML as String in class to insert it on install?
I apologize if question is too long or unclear, English is not my native language and this is my first question.
I'm not sure if i understood you right, but you could store the XML-file in the internal data storage of the application. --> http://developer.android.com/guide/topics/data/data-storage.html
If you want to attach a first Version of the XML-file on install, store it in the ressources first and copy it to the internal data storage after install. On updates of the XML file you can just overwrite this file in the internal data storage.
Hope i could help you, this is my first answer on stackoverflow. I'm sorry if i just told you things you already knew.

Download and replace Android resource files

My application will have some customisation for each company that uses it. Up until now, I have been loading images and strings from resource files. The idea is that the default resources will be distributed with the application and company specific resources will be loaded from our server after they click on a link from an email to launch the initialisation intent. Does anyone know how to replace resource files? I would really like to keep using resource files to avoid rewriting a lot of code/XML.
I would distribute the application from our own server, rather than through the app store, so that we could have one version per company, but unfortunately this will give quite nasty security warnings that would concern our customers.
Does anyone know how to replace
resource files?
It is not possible, except by deploying an updated APK. APKs are digitally signed and cannot be modified at runtime.
No it is not possible, but here is what you can do instead... Copy your images etc in the Assets folder.. From the assets folder , copy them at runtime in the Application dir.. ie data/data/yourapppackage/yourresourcefolder
Use the images etc from the runtime folder.. Ie In code say,.. imageView.setBackgroundDrawable(data/data/apppackagename/download/themename/resourcename)...
Now when you download your resources from a runtime path , keep an XML file with key names and path for the image as key value pairs.. Have approprite Enums for that in code and store the image paths in HashMap at runtime..

Categories

Resources