I am developing an app for Android using Marmalade 8.2 and I want to have a translation of my app's name in different languages.
I know that I can change the app's name in the deployment options of the MKB file:
name = "My Name"
caption = "My Name"
So one way to do it would be to create different deployments (one for each language), but then I would end up with several different APKs.
Another way would be to use the: android-extra-strings deployment option as something like this:
android-extra-strings='(app_name,My App Name)'
But once again I would have to create different deployments for different languages.
Is there a way to specify different strings.xml files in Marmalade or to have localized strings in the same deployment?
UPDATE
I've done some more reasearch and I discovered that I can add extra strings.xml files to my apk package. Each of these files can have a localized app name.
To do this I've added the following step to my configuration: android-external-res = "android_res", unfortunately the folders with the strings.xml are not being copied into the apk. I am doing something wrong?
I've done some more testing and the android-external-res = "android_res" variable in the MKB file works fine as long as you have the correct folder structure with the values-xx folders (xx would be the language code such as en or pt) and the strings.xml files inside them.
Note: even though he package is built with these files and they work, you will not seem them in the "intermediate-files" folder of your build, so you can end up thinking that they are being disregarded.
Related
I have placed the resources to support different languages in appropriate packages as suggested in Android Localization documentation. Is there a way to add additional languages, i.e, resources after the app is installed without having to download and re-install the app. I mean updating the app - adding new resources and even updating some existing ones.
For example if my app initially supported English and French. Now suppose I want to add new language say Hindi and update few of the resources in English. So what is the approach..?
I had this issue, my approach is to create separate folder on the device \data\packageName\languages\
there will be one file called supportedfiles.lang the format of the file will be
English en
Russian ru
...
also in same location you will have the following files
en.lang
ru.lang
the format of each language file ie(en.lang / ru.lang) will be like regular strings.xml
Some text
when you load the application in settings screen you will read the supportedfiles.lang and show to user the supported languages when he choose different language you just need to load the appropriate language file
Maybe it is over kill, but you will have the flexibility to support other languages while the application installed without updating the application just copy the files into /data/package/languages/
I have to maintain an application which has strings, images, videos in different language it makes a heavy apk and I would like to know if I could tell the exporter to only package only resource applying to one specific locale ?
imagine I have the files
res/values/strings.xml
res/values-en/strings.xml
res/values-it/strings.xml
res/values-fr/strings.xml
And I want to generate and apk with only italian only
res/values/strings.xml
res/values-it/strings.xml
(and maybe force generated app to use italian as locale)
Actually I have 2 projects for 2 locales us / it, everthing is dupplicated, so everytime I have to edit a java or xml file I have to edit it twice.
Now I am required to create a 3rd apps for french and I don't want to copy paste to a new app and to maintain 3 times the same files ! (and more in the future)
I wanted to merge everything into a single apk and then export for one locale because the client require 1 apk per country
I don't know how I could refactor the apps to simplify my works my idea is to export for one locale
thanks for help
I think you could do this with Android Studio and Gradle but it would take some possibly complicated (for a Gradle beginner) setting up of the Source Sets folders.
http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Product-flavors
I am developing an Android application named "English SMS Collection" in Google Play store, and now I want to upload this app in Hindi language also. So what changes are required to previous APK?
How to add another language to an Android application? And also what image size icons are required for uploading the app to market?
Any help would be appreciated.
Generally, splitting the same app into two functionally equivalent versions with different languages is a bad idea.
If you absolutely must do that, the only thing you need to change is the package name (package="com.example.project") in your AndroidManifest.xml (no need to rename actual packages, just that one string in manifest).
Also, if your Activities are declared relatively to app's package (e.g. .MyActivity as opposed to com.mypackage.activities.MyActivity) - and they most likely are - changing app's package name will obviously cause FCs because you effectively rename the activities. So to be able to switch the package name back and forth you'll have to detach Activity names from app's package by declaring them absolutely (e.g. com.mypackage.activities.MyActivity)
Here's a comprehensive guide on icons from Google, next time please do more research before asking such simple questions: Iconography
Also, judging by the question, you'll probably want to also read into this: Publishing Checklist for Google Play
Please DO NOT split your app up into two apks just because of the language. This is very bad style.
According to the android devleoper's guide, it's best practice to create ressource-folders with so called "configuration qualifiers". Your strings (e.g. text) should all be stored in the file /res/values/strings.xml . This is the default setup (without a configuration qualifier), when adding localized translations you have to create a new folder and strings.xml file /res/values-cc/strings.xml where cc has to be the standardized country/language code (e.g. "en" for english, "de" for german, "cs" for czech...).
For more (essential) informations on this, visit developer.android.com/guide/topics/resources/localization.html .
You need to change the package name because it should be unique while uploading in market. It can be signed with the same keystore file you have done for other two apps. Obviously, you have to change the Application name and its icon.
For more Information on Publishing Checklist for Android Apps, check this documentation.
In a Package Explorer, click on the package name (e.g: com.example.android), right-click and go to Refactor. Choose the Rename... option there.
I'm trying to find the best way to build/package an Android app for 6+ different customers. I could use different branches in SVN for all of the customers, but the only difference between the apps are some values in the resource folder (drawables, strings, etc).
I wrote an ant script that imports the standard Android build.xml. This script does the following:
Reads the customer names from a properties file.
For each customer the following is done:
The package name in AndroidManifest.xml is changed (by hooking into the -pre-build target).
The custom resources are copied into the res directory in the build (by hooking into the -pre-compile target).
The package name is changed back to the default value (by hooking into the -post-compile target).
The APK is copied to a specific location an named something like customer-versionno.apk.
This seemed to work well until I just now wrote the part that changes the package name. Because of the package name change the location of the R class is also changed, meaning that the build fails as the Java classes import the R class from the standard package.
I don't want to have a build script that changes code. I want to be able to do this with minimum changes to any files.
Soo..the questions are really:
Are there any good/simple solutions for my problem?
Am I approaching this problem in the wrong way? Are there better ways to easily package the same app to 6+ different customers?
Do you really need to change the package name? Changing the package name is a pain to do automatically. That being said, here is my solution to the problem:
My scenario is that I have one app that gets deployed to 30-200 different signed APK files where the only difference between the files are some resources (drawables, strings, values etc), and the package name.
I do this by working on a generic version of the app that serves as the template project. Once this works and I am ready to deploy I invoke a bash script that loops through the following steps for each target:
Clean the project completely
Swap out res dir and package name using sed.
Builds and signs the APK
This balances the horrific deply time with fast developemnt time. I really don't see another more elegant/robust solution than this.
And finally a small tip: In android manifest use relative package names like ".Application" instead of "com.mycompany.myproject.Application". This way you only need to change the package name in ONE location.
Is it possible to solve this with making 6+ different projects that includes your main projekt. This way you are able to override resources and make different apk's
I have some resources in my app that are going to be loaded optionally for different brands. I don't want to set up entirely different projects each time we re-brand the app so I want to know if the resources that are not used will be always packaged in and if there is a way to avoid this. Here's an example:
MyProject
/res
/layout
main.xml (used in all apps)
productlist1.xml (used in app ABC.apk)
productlist2.xml (used in app XYZ.apk)
main.xml should be packaged in both ABC and XYZ apps
productlist1.xml should be packaged with app ABC but not with app XYZ
productlist2.xml should be packaged with app XYZ but not with app ABC
I want to know if the resources that
are not used will be always packaged
in
Yes.
and if there is a way to avoid this
Use library projects. Or, create custom Ant tasks that filter the resources that get packaged in any given version of the app.