Best Practices for Android Multi-language Applications

May 09, 2013

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.

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)."

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.

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.

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.

Further GPI Resources on Localization and
Internationalization

Globalization Partners International (GPI) has developed a suite
of globalization tools to help clients effectively
internationalization and localize their mobile applications. You
can explore them under the Tools sections of our Translation Services. GPI
offers internationalization and globalization consulting services
and can evaluate your application. By partnering with GPI before
you localize or translate your application you may avoid many
mistakes and save considerable time and money on your next
localization projects.

For more information about mobile application translation and
localization please check our services and blogs:

For more information or help with you next mobile localization
or website translation project, please do not hesitate to contact
us via e-mail at info@globalizationpartners.com,
or by phone at (866) 272-5874, or by requesting a free translation
quote on your next website translation project.