Prev Tutorial App Coding a Video Player
This Tutorial App Adding Local Languages To Your App
Next Tutorial App Coding a Simple ListView
Language Localization For Your App
If you are just arriving at this page; and you are not familiar with with creating Android Apps, we suggest you begin with our tutorials:
Coding Android App Pages
and How To Create a Simple App in Android
From there follow along with each tutorial lesson.
AIDE and ANDROID STUDIO
We are using AIDE(a mobile coding environment using language java/xml), to create these tutorial apps on our
tablet(7" screen) that has android version 5.0.
Once we build and RUN our app; we then install the app on this same tablet; and the app is also installed on a smart phone that has android version 6.
We are using the AIDE coding editor to code our pages; and then to Create - RUN our apps. AIDE is a SDK coding environment for android devices like a tablet or smartphone.
AIDE has a free and paid version.
Once you create your apps code pages, you need to RUN the app to build your apk package; then you INSTALL it on your tablet or smartphone.
For info on using AIDE, gohere
can also create; RUN your apps using the code in these tutorials, with Android Studio. Android Studio is for desktop computers. Choose Java XML as the programming language.
Android Studio is free to install and use for your android app development. Although not as convenient as testing your app on an actual android device; you can test
your newly created app in Android Studio using its' android emulator.
Complete Example Codes are available for each of our tutorials. With these example codes you can make a functioning android app in
either AIDE or Android Studio.
First, create a java/xml android template app using AIDE, (or Android Studio). Then you can get the code for this app from the EXAMPLE CODE section on this page.
Replace the code on the pages you need to(with our tutorial code); in order to create this app.
Sometimes, new pages have to be created.
All the other coded pages in your app
can remain as they are; they don't need to be changed.
This is the App - Languages Local
It has language support for English(default app language), and French, Spanish, Japanese.
You can localize your app for languages
around the world.
This App Photo:English Language as Default App Language
App will display English text from res/values/strings.xml file
I also added the translated versions of each language on this page, which is good if you wanted to use this as a screenshot for promoting your app's included languages.
French Language as Default App Language
App will display translated French text from res/values-fr/strings.xml file
Spanish Language as Default App Language
App will display translated Spanish text from res/values-es/strings.xml file
Where - How - Why To Use Language Localization
App localization is a good thing to implement to make your app more marketable around the world.
If you only use English as the App Language; you could be
missing out on potential downloads and sales.
Although many countries use English as their first or second language; there are countries that do not, and these are the countries
where you can localize your app(s).
Downloads vs Monetize
If your objective is to get as many downloads as you can for your app, then localization is probably a great idea for a new app. If making money from your
new app is moreso important; then you should research your markets first; before taking the time or spending money for a translation service for a particular country language.
The reason being, that all markets are not created equal; meaning some markets tend to have great download numbers; however, their purchasing numbers(buying your app, buying in-app purchases) may not be as good.
Having said that; if you make your App a Free App with in-app purchases, include some advertising like
AdMob, or InMobi, and do your own Language translating, then it's a win-win for you as far as
distributing your App to the different language markets around the world.
Create Your Values Folders and Strings Files
For this app we have added support for 4 languages including English.
You need to add a strings.xml file for each additional language you want to support, and put the strings
file into a values folder with the language/country 2 letter code - like this; values-fr, meaning for french language.
You will need to create the values folder
for each language and the strings file for each language.
user from a language supported uses your app on their android device; the android system knows to display that language to the user because you've added your translated text to
the res/values-(2letterLanguageCountrycode)/strings.xml for any additional languages.
For our app tutorial, we also added the 4 languages to our app's first page, also translated. To do this, we added all the language strings.xml to our English default app strings file located at values/strings.xml
You don't have to add this translated text to the intro page of your app; but for marketing purposes, especially on markets like Google and Amazon Appstore, you can do a screenshot of this and add it as
one of your promo pages for potential users to see; letting them know your app supports languages other than English.
Additional Reading at Android Developer website:
Localization Guide for Android Apps
Android Localization Tips
Google Translation Service
Creating - Naming Your App Using AIDE
When creating your app,(from left menu) choose:
Create New Project;
New Android App(gradle, android Java/xml)
Hello World App Java/xml
if your using the original version of AIDE
You can name your app whatever you like; if your using the name as shown in our example code use;
for the App Name and,
for the package name(next line) use:
The Coded Pages
Code for the app - Languages Local
For this app you will use these coded pages:
1 layout file, main.xml; located at res/layout/main.xml, already created, just replace the code on this page with the code from our Example Code section and save the page.
1 java class page; MainActivity.java; located at app/src/java/MainActivity.java, already created; we don't need to add or edit code on this page so leave it as it is.
4 strings files are required for this App:
strings.xml. The strings.xml at res/values/strings.xml is the app's default strings; and has already been created for you when you created your template java/xml android app.
This string contains all text in English in the App or whatever language you have selected as the default language for your android device(tablet).
For this tutorial app; we will assume the default selected language is English.
Because we are adding language support for 3 additional countries other than English; we will need to add a strings.xml file for each language we want to add; like
res/values-es/strings.xml - for Spanish language,
res/values-fr/strings.xml - for French language,
res/values-ja/strings.xml - for Japanese language,
For each language you want to support; you need to create a New 'values' folder for it with the languages country code added to the values folder(values-es,values-fr,values-ja); and then paste the default strings.xml code into each new
values folder strings.xml file and save the file. The code for each strings.xml page will be exactly the same; only the text will be different.
Next, we have to do the translation for each of the languages. Replace the English text with the translated text for each country's language. For our app tutorial,
you can simply copy paste the code for each strings.xml file from our Example Code section, then save each page.
1 manifest file, AndroidManifest.xml (already created). Just replace the code on the page with the code from the Example Code section, and save the file.
Translating text for different languages in your app -
You can do this using a free translation service like Bings or Googles. If your app has a lot of text to translate then you may want to have it translated
by a native speaker of the language your translating.
In the Google Play Console (where you can distribute your Newly Made Android App for a $25 fee, they have a built-in paid translation
service). There are many online free and paid translation services you can also use.
For translating the text in this tutorial app, I used the Bing free translator for the French and Spanish text; and for the Japanese translations, I used the English to Japanese Free translation service, at this
Adding a ScrollView
When creating your layout, you can add a ScrollView element to the layout. What this does is allow your text to scroll beyond the physical parameter of the display.
ScrollView added to the Layout code
Although you may install your newly created app on a tablet, and no scrolling is required to view the text or entire page; on a smaller screen size device this may not be
So, by adding a ScrollView, you know that users of your app on tablet size and smaller sized screen will be able to view all the views information.
To add the scrollview element, just add it as the first element in your layout; and then close the scrollview element tag at the end of your layout.
EXAMPLE CODE - Code For This Tutorial
JUST USE YOUR MOUSE to copy the code for this tutorial
App Name is 'Languages Local - located at AppProjects/LanguagesLocal in AIDE, open the AIDE app, then open App Projects, THEN select the 'Languages Local',
app from your files hierachy(left menu); then click on any file from the app, like strings.xml Make sure at top of page, the app name 'Languages Local' is there next to
AppProjects like so: AppProjects/LanguagesLocal, then you know you have the proper App.
Once a file is in the editor, you can edit, save it, then RUN your APP, Install,
and Open your app.
Make sure you SAVED EACH PAGE,(or choose automatic saving in AIDE settings) before you RUN your code. SAVE, RUN, INSTALL, OPEN, your App. Once it has been
installed on your tablet, you can open it Simply by Clicking on the Android little green App Icon,with the wording 'Languages Local' on your tablet. It will
be with your other installed apps.
If you make further changes to this App, you need to SAVE, RUN, UPDATE, INSTALL, OPEN the app.
This free script provided by