Skip to content

Best Practices for Android Multi-language Applications

Based on research completed by Canalys, Android the Google (NASDAQ:GOOG) mobile platform accounted for just over one-third (34%) of all phone shipments during the fourth quarter of 2012 (Q4 2012). Although the 438.1 million units in worldwide shipments remains flat year-on-year, the smartphone shipments grew 37%. Android accounted for 34% of all mobile phone shipments and 69% of smartphone shipments in the quarter.

android-localization

comScore Inc. (NASDAQ: SCOR), a leader in measuring the digital world has stated, “123.3 million people in the U.S. owned smartphones (53% mobile market penetration) during the three months ending in November, up 6% since August. Google Android ranked as the top smartphone platform with 53.7% market share (up 1.1% points).”

Top Smartphone Platforms
3 Month Avg. Ending Nov. 2012 vs. 3 Month Avg. Ending Aug. 2012
Total U.S. Smartphone Subscribers Ages 13+
Source: comScore MobiLens
Share (%) of Smartphone Subscribers
Aug-12 Nov-12 Point Change
Total Smartphone Subscribers 100.0% 100.0% N/A
Google 52.6% 53.7% 1.1
Apple 34.3% 35.0% 0.7
RIM 8.3% 7.3% -1.0
Microsoft 3.6% 3.0% -0.6
Symbian 0.7% 0.5% -0.2

Source: comScore Reports November 2012 U.S. Mobile Subscriber Market Share

Android powers hundreds of millions of mobile devices in more than 190 countries around the world. Every day new users power up their Android devices for the first time and start looking for apps, games, and other digital content.

With the largest installed base of any mobile platform, marketers must ensure they are leveraging this channel or they might miss out on opportunities.

This blog highlights the support available for different languages/locales over the lifetime of the Android platform. It shows that Android remains committed to its user base to ensure digital content can be targeted in multiple languages to better engage with your target audience.

Best Practices for Android Localization

In the previous blog Localization Services for Android Mobile Applications, we discussed setting up an Android application for localization and using resources files (strings, images, etc.). Now we shall continue the localization process by discussing some best practices which should be included in the development cycle for multi-language applications.

Support for switching languages

Users can change the phone’s current language setting at any time. In some cases, your Android multi-language application may be running when this takes place. The Android platform invokes the methods for your application:

  • onSaveInstanceState(…) – This method is called before an activity may be killed so that when it comes back some time in the future it can restore its state.
  • onDestroy(…) – Perform any final clean-up before an activity is destroyed.
  • onCreate(…) – Called when the activity is starting. This method takes a single parameter, which is non-null if the activity is being re-initialized after previously being shut down.

After re-loading the UI within the onCreate() method, developers should also call the onRestoreInstanceState() to restore the app state using the parameter from the onCreate method when the bundle parameter is non-null. This provides the user with a seamless restart experience.

Android-system

Data Persistence Strategies

Depending on the type of mobile application, it may communicate with a back-end server application which in turns saves data (user-details, calculations, etc.) to an external repository. Your mobile application communicates with the back-end server to share data required.

Multi-language applications must ensure special consideration is taken when choosing a data persistence strategy. The following lists two (2) common approaches:

  • File-based approach: Unicode can be implemented by different character encodings. It is important to note when reading files the proper encoding should always be specified. This ensures that developers are aware of the intent when reading/writing to files. In cases when an encoding scheme is not specified a system-provide default is used. When there is a mismatch with encodings non-meaningful data is read / written.

Using the Microsoft .NET Framework as an example, if a text file stored using the UTF-16 encoding scheme is read without specifying the encoding, .NET framework will interpret the UTF-16 characters as UTF-8 (default) resulting in ‘garage results’ being produced.

  • Database-based approach: The data-type of your columns, character-sets within the database should support the storage of Unicode characters.

For example, SQL Server provides nchar, nvarchar and ntext data types which are the Unicode equivalents to chat, varchar, text respectively. While in MySql the UTF-8 character-set should be chosen to support as there are no Unicode column data-types.

Versions of the Android Platform
Version Codename API Distribution Total
1.6 Donut

4

0.20%

0.20%

2.1 Eclair

7

2.20%

2.20%

2.2 Froyo

8

8.10%

8.10%

2.3 – 2.3.2 Gingerbread

9

0.20%

45.60%

2.3.3 – 2.3.7

10

45.40%

3.1 Honeycomb

12

0.30%

1.30%

3.2

13

1.00%

4.0.3 – 4.0.4 Ice Cream Sandwich

15

29.00%

29.00%

4.1 Jelly Bean

16

12.20%

13.60%

4.2

17

1.40%

Language / Locale Support by Android Platform
Language / Locale Supported since version
English, US (en_US) 1.1
German, Germany (de_DE) 1.1
Chinese, PRC (zh_CN) 1.5
Chinese, Taiwan (zh_TW) 1.5
Czech, Czech Republic (cs_CZ) 1.5
Dutch, Belgium (nl_BE) 1.5
Dutch, Netherlands (nl_NL) 1.5
English, Australia (en_AU) 1.5
English, Britain (en_GB) 1.5
English, Canada (en_CA) 1.5
English, New Zealand (en_NZ) 1.5
English, Singapore(en_SG) 1.5
French, Belgium (fr_BE) 1.5
French, Canada (fr_CA) 1.5
French, France (fr_FR) 1.5
French, Switzerland (fr_CH) 1.5
German, Austria (de_AT) 1.5
German, Liechtenstein (de_LI) 1.5
German, Switzerland (de_CH) 1.5
Italian, Italy (it_IT) 1.5
Italian, Switzerland (it_CH) 1.5
Japanese (ja_JP) 1.5
Korean (ko_KR) 1.5
Polish (pl_PL) 1.5
Russian (ru_RU) 1.5
Spanish (es_ES) 1.5
Arabic, Egypt (ar_EG) 2.3
Arabic, Israel (ar_IL) 2.3
Bulgarian, Bulgaria (bg_BG) 2.3
Catalan, Spain (ca_ES) 2.3
Croatian, Croatia (hr_HR) 2.3
Danish, Denmark(da_DK) 2.3
English, India (en_IN) 2.3
English, Ireland (en_IE) 2.3
English, Zimbabwe (en_ZA) 2.3
Finnish, Finland (fi_FI) 2.3
Greek, Greece (el_GR) 2.3
Hebrew, Israel (he_IL) 2.3
Hindi, India (hi_IN) 2.3
Hungarian, Hungary (hu_HU) 2.3
Indonesian, Indonesia (in_ID) 2.3
Latvian, Latvia (lv_LV) 2.3
Lithuanian, Lithuania (lt_LT) 2.3
Norwegian-Bokmol, Norway(nb_NO) 2.3
Portuguese, Brazil (pt_BR) 2.3
Portuguese, Portugal (pt_PT) 2.3
Romanian, Romania (ro_RO) 2.3
Serbian (sr_RS) 2.3
Slovak, Slovakia (sk_SK) 2.3
Slovenian, Slovenia (sl_SI) 2.3
Spanish, US (es_US) 2.3
Swedish, Sweden (sv_SE) 2.3
Tagalog, Philippines (tl_PH) 2.3
Thai, Thailand (th_TH) 2.3
Turkish, Turkey (tr_TR) 2.3
Ukrainian, Ukraine (uk_UA) 2.3
Vietnamese, Vietnam (vi_VN) 2.3
Developing Multilingual Applications

Whether you are trying to release a multilingual application in order to increase your digital media presence in global markets and achieve an acceptable ROI by acquiring new customers, or you are trying to improve your internal efficiencies by providing your global employees tools to work more efficiently, developing multilingual applications is a fundamental aspect of accomplishing either.