1. Help Center
  2. Phrase Over the Air (OTA)

Android SDK Installation Instructions

Learn how to install the Over the Air SDK for Android.


Phrase Over the Air for Android lets you update translations in your Android app without having to release it every single time.

By including our SDK, your app will check for updated translations in Phrase regularly and download them in the background.


The SDK requires at least appcompat version 1.2.0. If you use an older version of appcompat, please consider using SDK version 2.1.3 (see here).

Include the SDK

As a first step a new repository needs to be added to the root build.gradle:

allprojects {
    repositories {
        maven { url 'https://jitpack.io' }

Now the library should be added as a dependency:

dependencies {
  implementation 'com.github.phrase:android-sdk:3.0.5'


Initialize the SDK in your application class and add the distribution ID and environment secret from Phrase. Classes inheriting from Application should overwrite attachBaseContext to enable translations outside of the activity context:

public class MainApplication extends Application {
public void onCreate() {
    Phrase.setup(this, "DISTRIBUTION_ID", "ENVIRONMENT_TOKEN");

protected void attachBaseContext(Context newBase) {

Additionally, you need to inject the SDK in each activity, e.g. by creating a base activity which all other activities inherit from:

public class BaseActivity extends AppCompatActivity {
public AppCompatDelegate getDelegate() {
return Phrase.getDelegate(this, super.getDelegate());

Translations can be used as usual in layouts:

<TextView android:text="@string/translation_key" />

And inside code:

TextView text = (TextView) findViewById(R.id.text_id);

Change language

In case you don't want to use the system language, you can set a different language in the setLocaleCode method. The language code (locale) needs to be present in a release from Phrase.


Custom app version

The SDK will use the app version by default to return a release which matches the release constraints for the min and max version. The app version has to use semantic versioning otherwise no translation update will be returned. In case your app does not use semantic versioning it is possible to manually override the app version we use. For example:


The version has to be set before calling updateTranslations( )

Set timeout

The default timeout for translation downloads is set to 10s. The default can be changed with:

Phrase.setTimeout(10000); // Timeout in milliseconds

Update Callback

In case you want to handle successful translation updates you can attach a callback handler:

Phrase.updateTranslations(new TranslationsSyncCallback() {
    public void onSuccess(boolean translationsChanged) {

    public void onFailure() {

Additionally it is possible to manually trigger translation updates:

Phrase.updateTranslations(new TranslationsSyncCallback() {
    public void onSuccess(boolean translationsChanged) {

    public void onFailure() {

Making updates visible

Usually, the updated translations will be automatically visible to the user the next time the app launches. If you want to enforce the new translations to be visible immediately, you need to handle this yourself, e.g. by recreating the activity on a successful callback.



This library depends on AndroidX to support backward compatible UI elements like the Toolbar.


Phrase Over the Air lets you specify version ranges for releases to ensure the appropriate content is made available for the right version. For this feature to work you need to set the versionName for the app in semver format as <major>.<minor>.<point>.


In case it is not possible to reach Phrase due a missing network connection of the client or in case of a service interruption, the SDK will use the bundled translations from the resource file. Therefore we recommend to regularly update the bundled translations in your app. The SDK also caches translations locally on the device. If such a cache exists, it will be used until the next translation update. 


The SDK will communicate with the Phrase Over the Air service in order to check for updates and includes the following details with each request:

  • Unique identifier (e.g. "123e4567-e89b-12d3-a456-426655440000". Unique for this app and therefore does not allow tracking a specific device.)
  • App version (e.g. "1.2.0")
  • Last update of the translation file (e.g. "1542187679")
  • SDK version (e.g. "1.0.0")
  • Language (e.g. "de-DE")
  • File format (e.g. "simple_json")
  • Client (e.g. "android")
  • Distribution ID (ID of your distribution in Phrase)
  • Environment secret (to distinguish between development from production)

SDK Version Releases

Please make sure to regularly check the latest releases of our Android SDK, especially if you think about upgrading.


The SDK is closed source and can thus not be viewed or modified. We do provide the possibility for audits in case this is a requirements of your organisation. Please contact us for more details on code audits.


Which release will be used by the app?

The SDK will use the most recent release for the translations. In case the versionName for the app is set, the most recent release that satisfies the version restrictions will be used. 

How can I add a new language to the app?

Adding a new language to the app is as simple as creating a new language in Phrase and creating a new release. The SDK will then fetch the language when this is the device language of a user. We still recommend to regularly add new strings.xml for new languages files when releasing a new app version. Otherwise the user will see the fallback translations determined by Android at the first start of the app.

Do you have a demo app?

Sure. Check it out on GitHub so see how to integrate Phrase Over the Air into your Android app.


Translations are not updated

  • Make sure the distribution ID and environment secret are correct.
  • Check whether you created a release on Phrase for your current app version.
  • Updated translations are visible automatically after the next app launch. Try recreating an activity to make changes appear immediately.

The wrong version of translations are used

  • Please make sure that you have the versionName for the app set and are using the format <major>.<minor>.<point>.
  • In Phrase, check whether you do have a release with the latest translations and the current app version.