Skip to main content

Legacy Android SDK Installation

Deprecated — do not use for new games

This page documents the legacy OEG Android SDK (oeg-android-sdk/), which is in maintenance-only mode and will be removed in a future release.

New games must integrate SDK v2 only. Use this page only as a reference for existing Android games already shipping with the legacy SDK. No new features will be added here.

This page documents the oeg-android-sdk/ integration that existing Android games use today.

What you need from OEG​

  • The legacy Android SDK artifact (.aar) or the Maven coordinate your team uses internally
  • oeg_config.json
  • google-services.json if you use Firebase push or Google login
  • Facebook App ID / Client Token if you use Facebook login
  • Adjust / Sentry keys only if those services are enabled for your game

Requirements​

  • Android minSdk 24+
  • JDK 17
  • Android Studio Hedgehog or newer

Add the SDK​

The sample apps consume the SDK as a local module, but client games usually integrate either:

  1. A provided .aar dropped into app/libs/
  2. A private Maven/JitPack coordinate provided by OEG

Example using a local .aar:

app/build.gradle.kts
dependencies {
implementation(files("libs/oeg-sdk-1.1.2.aar"))
}

If your team publishes the SDK to Maven/JitPack, replace the dependency line with the coordinate OEG gives you.

Repositories​

The SDK depends on common Android libraries from Google and Maven Central:

settings.gradle.kts
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}

Add oeg_config.json​

Place the file at app/src/main/assets/oeg_config.json.

Legacy Android reads this file with Gson into the SDK config model, so the JSON keys are camelCase.

app/src/main/assets/oeg_config.json
{
"coreConfig": {
"gameId": 36,
"apiBaseUrl": "https://dev-api-sdk-game.oeg.vn/",
"debugEnv": true,
"userInfoFullNameRequired": true,
"userInfoBirthdayRequired": true,
"userInfoEmailRequired": true,
"userInfoPhoneRequired": true,
"defaultNotificationChannelId": "default",
"defaultNotificationTitle": "Notification",
"userInfoAutoPopup": false
},
"snsConfig": {
"facebookAppId": "YOUR_FACEBOOK_APP_ID",
"facebookClientToken": "YOUR_FACEBOOK_CLIENT_TOKEN",
"fbLoginProtocolScheme": "fbYOUR_FACEBOOK_APP_ID",
"googleWebClientId": "YOUR_GOOGLE_WEB_CLIENT_ID"
},
"loggingConfig": {
"sentryDsn": ""
},
"trackingConfig": {
"adjustAppToken": "YOUR_ADJUST_APP_TOKEN",
"adjustEnvironment": "sandbox",
"eventNameTokenMapping": {
"login": "EVENT_TOKEN_LOGIN",
"registration": "EVENT_TOKEN_REGISTER",
"purchase": "EVENT_TOKEN_PURCHASE"
}
}
}

Add required app files​

google-services.json​

Add google-services.json to the app/ module if your game uses:

  • Google login
  • Firebase messaging / push

Manifest​

The sample app keeps the host app manifest minimal:

AndroidManifest.xml
<application
android:name=".App"
...>
<activity
android:name=".AppActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

The SDK itself ships its own activities and resources.

Initialize the SDK​

Initialize once from your Application class:

App.kt
class App : Application() {
override fun onCreate() {
super.onCreate()
OegSdk.init(this)
}
}

Java:

App.java
public class App extends Application {
@Override
public void onCreate() {
super.onCreate();
OegSdk.INSTANCE.init(this);
}
}

And register the Application in AndroidManifest.xml:

<application
android:name=".App"
... />

Optional services​

Facebook login​

Provide facebookAppId, facebookClientToken, and fbLoginProtocolScheme in oeg_config.json.

Google login / Firebase push​

Add google-services.json and the Firebase setup required by your app.

Sentry​

Set loggingConfig.sentryDsn. If empty, Sentry is skipped.

Adjust​

Set trackingConfig.adjustAppToken and trackingConfig.adjustEnvironment.

Quick smoke test​

After initialization, launch the SDK login UI:

OegSdk.showLogin(callback, orientation = OegSdk.ScreenOrientation.PORTRAIT)

If the SDK is wired correctly, the login activity opens and the callback returns a WorkResult<AuthenticationInfo>.