This guide assumes that you have already prepared your Android app for localization as SDK is designed to work with Android resources.

Lokalise Android SDK is available as an .aar library (can be downloaded here) or as a Maven dependency (please check out Step 3 in the Getting Started section) and can be easily included in your projects. Once the translations are finalized in Lokalise editor, you generate a bundle using Lokalise Download page. As end user opens your app on his device, the SDK requests latest version of the bundle from our servers and if found downloads and stores it locally.

Reporting issues

Please use this issue tracker or contact Lokalise support to report any issues you may encounter.


Some views are not supported when inflating from XML (Action bar, Menu items, Android preferences, may be others), but you can still get the latest translations via getString(), getText(), getQuantityString() and other system methods, and set the content of these views programmatically.

For example, the following code can be used for your menu items:

public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(, menu);

    // ... any other menu items

    return true;

Getting started

Step 1: Set up your project in Lokalise

If you have not done so yet, add new project in Lokalise, upload source language files you may have (or just add keys straight in Lokalise's editor if it's a new app you are building). Take a note of project ID, that can be found in project settings, usually it looks like this:


Step 2: Generate the bundle

Go to Downloads page in Lokalise, select "Lokalise Android SDK" as the format and click Build only button to generate the bundle. You will be automatically taken to the bundle versions management page at projects settings. Leave the switches as is for now, see details in Managing bundles section.

Make sure to always include the latest strings in your project when releasing the app.

Step 3: Include Lokalise SDK in your project

First you need to add to your repository list and include your library as well as google GSON library in your .gradle file:

repositories {
    maven {
        url ""
dependencies {
    implementation ''
    implementation ''

If you are using ProGuard, add the following rules:

-keep class com.lokalise.** { *; }
-dontwarn com.lokalise.*

Also, if you are using DexGuard, you will need to specify these additional rules:

-keepresources string/**
-keepresources string-array/**
-keepresources plurals/**

Step 4: Initialise the SDK

For this step you will need your SDK token (generate a token in project settings > General tab) and the Project ID of the desired project (obtained in the project settings). In you main Application class include the following code:

public class MyApplication extends Application {
    public void onCreate() {
        // Initialise Lokalise SDK with projects SDK token and project id
        // It is important to call this right after the "super.onCreate()"
        // If you are using AppCompatDelegate.setCompatVectorFromResourcesEnabled(true)
        // make sure it is called before LokaliseSDK.init()
        LokaliseSDK.init("<sdk token>", "<project id>", this);
        // Add this only if you want to use pre-release bundles
        // Fetch the latest translations from Lokalise (can be called anywhere)

We will need to inject Lokalise SDK into the Activity context as well. To do so, we recommend you create a base Activity class and extend all your activities from it. Add the following code into your activity:

public class MainActivity extends AppCompatActivity {
    protected void attachBaseContext(Context newBase) {
        // Inject the Lokalise SDK into the activity context

If you are using Calligraphy library for Android, attaching to context should look like this:


That's it! You are ready to go!


Updating translations

No updates are needed to your code, refer to the keys as usual:

    ... />

Or from code:

TextView test = (TextView) findViewById(;

If you want your Action bar to have the latest translations, set it's title programmatically:

protected void onResume() {

Changing application locale

To change the locale of your application, use the LokaliseSDK.setLocale(<Language ISO e.g. "en">, <Region ISO e.g. "GB">) method. 

There is no need for custom locale changing code or context wrappers, simply call this method and restart the Activity.

Dynamically adding keys

Sometimes you need to add new strings without recompiling the application. 

After adding a new key via the Lokalise interface and creating a new Android SDK bundle, you can refer to the new key by name using the following code:

LokaliseResources resources = new LokaliseResources(context);
String newKey = resources.getString("new_key_name");
if(newKey != null) {
    // do something with the new value

Please note that there is no guarantee that the key will exist when you request it, since you can pass any key name to the method, so make sure to check whether the returned value is null.

Callbacks (available in version 1.3.0)

If you need to know when Lokalise is done downloading a new translation bundle, there are several options.

Lokalise callback

The simplest way is to use the LokaliseCallback interface:

LokaliseCallback myCallback = new LokaliseCallback() {
    public void onTranslationsUpdated(long oldBundleVersion, long newBundleVersion) {
        // Do something

If you need to remove a callback, simply use LokaliseSDK.removeCallback(myCallback);

Broadcast receiver

You can also receive notifications about bundle updates via Broadcast receiver:

IntentFilter myIntentFilter = new IntentFilter(LokaliseDefines.INTENT_TRANSLATIONS_UPDATED);
BroadcastReceiver myReceiver = new BroadcastReceiver() {
    public void onReceive(Context context, Intent intent) {
        long previous_version = intent.getLongExtra(LokaliseDefines.EXTRA_BUNDLE_VERSION_OLD, 0);
        long current_version = intent.getLongExtra(LokaliseDefines.EXTRA_BUNDLE_VERSION_NEW, 0);
        // Do something
protected void onResume() {
    registerReceiver(myReceiver, myIntentFilter);
protected void onPause() {

Managing bundles

Publishing changes

Lokalise supports production and prerelease versions of the bundle and lets you keep different versions of each bundle. 

As the bundle is generated, it would take you to project settings / Lokalise Android SDK section. Flip the according switch in front of the bundle to publish it to production or prerelease.

Hit Save changes to apply.

Bundle freeze

Lokalise offers you to freeze a particular bundle on a particular app version. As you can see on the print-screen below the "Test_01" bundle is assigned to the apps with build from 0 to 6 and the newest bundle is assigned to the apps with build from 7 to 12. This feature is supported with the Lokalise Android SDK 1.3 and up.

Adding languages

Although if you add a new language to the bundle, it will be available in the application, we advise to release a fresh build with natively included resources for the new language since it may cause inconsistent translation of the interface (for example Action bar or application name will not be translated). 

Since version 1.3.2 you can get a list of locales that are currently present in the downloaded OTA bundle on the device by calling the LokaliseSDK.getAvailableLocales() method.

Mobile SDK insights

We provide comprehensive usage stats at project's Statistics page. The reports include:

  • Daily unique users (range)
  • Daily requests (range)
  • App languages (all time)
  • Device languages (all time)
  • Device - App language pairs (all time)
  • App languages (weekly comparison)
  • Monthly active users

Did this answer your question?