Update to Remastered Android SDK v2
Follow1.Start
This guide provides the necessary information for updating from version 1.x.x.x to version 2.x.x.x of Definery (AdBrix).
2. Android Native
2.1. build.gradle (Project: ProjectName) Settings
Add the following items to the build.gradle content at the project level.
If you already have all the items, you can skip this step.
allprojects {
repositories {
google()
mavenCentral()
}
}
2.2. build.gradle (Module:app) Settings
Add the following dependencies to the build.gradle content at the module level.
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
implementation 'com.android.installreferrer:installreferrer:2.2'
//Please always keep the SDK updated to the latest version.
implementation 'io.dfinery:android-sdk:2.5.1.4'
}
//If jetifier cannot be used
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
implementation 'com.android.installreferrer:installreferrer:2.2'
//Please always keep the Dfinery SDK updated to the latest version.
implementation('io.dfinery:android-sdk:2.5.1.4'){
exclude group: 'com.android.support'
}
}
2.3. Sync gradle
Run Sync in Android Studio to install the v2 SDK.
2.4. Installation Verification
After the installation is complete, you can check the v2 SDK in the External Libraries list of the project view as shown below.
2.5. Change Reference Class
In v2 SDK, the reference class has been changed. Therefore, the class name for imports in the project is changed as follows.
import com.igaworks.v2.core.AdBrixRm;
2.6. Change API Usage Code
You can use the existing API as it is through the above task with the v2 SDK.
3. React Native
When using React Native, update the SDK as follows.
3.1 SDK Update
You can update the AdBrixRM SDK for React Native to the latest version through npm. (Current latest version: 2.3.0)
npm update react-native-adbrix-remaster --save
3.2 Modify Android Project
1. Add mavenCentral() to the allprojects section in [ build.gradle (Project: ProjectName) ] as shown below.
allprojects {
repositories {
google()
mavenCentral()
}
}
2. Add the following dependencies to [app:build.gradle] .
dependencies {
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
implementation 'com.android.installreferrer:installreferrer:2.2'
implementation 'io.dfinery:android-sdk:2.5.1.4'
}
3. [ AndroidManifest.xml > manifest ] is set as follows.
<manifest>
...
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- OPTIONAL -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
...
</manifest>
4. Add the following code to app / proguard-rule.pro to ensure smooth operation and analysis of the SDK.
# Add any project specific keep options here:
-keep class com.google.android.gms.common.ConnectionResult {
int SUCCESS;
}
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient {
com.google.android.gms.ads.identifier.AdvertisingIdClient$Info getAdvertisingIdInfo(android.content.Context);
}
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info {
java.lang.String getId();
boolean isLimitAdTrackingEnabled();
}
-keep public class com.android.installreferrer.** { *; }
5. Add SDK initialize code to the Android Application class.
public class MyApplicationClass extends Application {
@Override
public void onCreate() {
super.onCreate();
AbxActivityHelper.initializeSdk(MyApplicationClass.this, "your_adbrix_remastered_app_key", "your_adbrix_remastered_secret_key");
}
}
4. Flutter
If you are using Flutter, proceed with the update as follows.
4.1. SDK Update
Add the following to the pubspec.yaml file in your Flutter project and download the SDK using the pub get command.
(Current latest version: 1.4.0)
dependencies: adbrixrm_flutter: ^1.4.0
5. Inquiries
If you encounter any issues during the update, please send your inquiry to the email below, and our support team will contact you as soon as possible.
Email: se.team@adbrixsupport.zendesk.com