Skip to content

Getting Started

This chapter walks through the three steps to integrate the Loxily Localize Android SDK into your app: first register the application on the Loxily Localize dashboard to obtain an App Key, then add the SDK dependency to your Gradle project, and finally call LoxilyLocalize.init in your Application class. Once these three steps are done, you can use features like fetching translations and switching languages.

Register Your Application

Before integrating the SDK, you need to create a project on the Loxily Localize Open Platform and obtain:

  • App Key — unique app identifier, required for SDK initialization
  • App Secret — used by server-side API signing (client SDKs don't use this directly, but both share the same application)

Sign in to the Loxily Localize console → select or create a project → navigate to Integration / Open Platform → copy the App Key for later use. If you don't have console access yet, please contact your Loxily point of contact.

SDK Integration

Add the dependency in your project's build.gradle file:

groovy
dependencies {
  implementation 'com.loxily:android-localize-sdk:1.4.1'
}

Note:

The Loxily Localize SDK uses the following libraries: recyclerView, material, okhttp, gson, glide.

If any of these conflict with libraries in your project, exclude the conflicting dependencies in your build configuration.

Once integrated, you can proceed to initialize Loxily Localize.

Initialization

Call the initialization method in your project's Application class:

java
public class App extends Application {
    @Override
    public void onCreate() {
        super.onCreate();

        // SDK initialization
        LoxilyLocalize.init(
            this,                           // Context
            "YOUR_APP_KEY",                 // AppKey (obtained from dashboard)
            "zh-cn",                        // Target language code
            true,                           // International version (true=overseas, false=mainland China)
            true                            // Environment (true=testing, false=production)
        );

        // Set initialization callback (optional)
        LoxilyLocalize.setOnTranslationPreparedCallback(
            new OnTranslationPreparedListener() {
                @Override
                public void onDataRetrieved(boolean isSuccess, String errorMsg) {
                    if (isSuccess) {
                        // SDK initialized successfully
                        Log.d("LoxilyLocalize", "Initialization successful");
                    } else {
                        // SDK initialization failed
                        Log.e("LoxilyLocalize", "Initialization failed: " + errorMsg);
                    }
                }
            }
        );
    }
}

Parameters

ParameterTypeRequiredDescriptionExample
contextContextYesApplication contextthis
appKeyStringYesUnique app identifier from Loxily Localize dashboard"7a0c1ee2622bc85a4030297uo3b"
languageStringYesTarget language code"zh-cn", "en", "ja"
isInternationalizingbooleanYesInternational version (true=overseas, false=mainland China)true / false
isBuildDebugbooleanYesEnvironment (true=testing, false=production)true / false

Important:

The initialization callback is asynchronous. Make sure the callback returns success before using other SDK features.


Once initialized, continue to Core Features to learn how to fetch translations and switch languages.