Add the SDK to your app
To integrate the SDK, add the dependency for A4SSDK to your app-level build.gradle file:
Integrate the SDK into your code
Modify your activities
To work properly Accengage SDK needs information about activities states, intents starting activities and bundles of these intents. For this reason, all of your activities should be slightly modified. There are two ways to do it:
by adding a few lines of code into Activity methods defining the lifecycle of the activity
by inheriting A4SActivity
In case you want to use another Android standard activity, the Accengage SDK provides modified activities :
Modify you application class
If you are using the Application class, we recommend you to extend A4SApplication instead of the standard Application.
In case you can not extend A4SApplication, see Sub Classing any Application Type.
Add credentials to your app
A4SSDK must be authenticated and authorized by Accengage servers. That's why you need to add application credentials (Partner ID and Private key) into strings.xml resource file:
The last two parameters presented in the code snippet are used to activate logs and disable geolocation. If you want to use geolocated In-Apps and Pushs, please check out our Geolocation section.
If you need to use different credentials, for example one pair of Partner ID / Private key per country which you would like to target, you should use localized strings: How to localize strings?
To be able to dynamically provide Partner ID and Private key with code, please check out Custom Credentials Integration section.
Obfuscating with Proguard
Our SDK is already obfuscated and Proguard configuration is packaged in the .aar file.
Using Google Play Services
Our SDK plugins use Google Play Services to take advantage of certain Google-powered features like Geofencing, Geolocation, Google Advertiser ID, etc. Explore Accengage Play Services plugins if you would like to add these functionalities.
We advise you to integrate the Google Advertiser ID part of the plugin to be able to identify your users through various products.
If your app is using a Splash screen, make sure to visit our section about how to handle it: Troubleshooting Splash Screen. Otherwise, the Accengage SDK may work incorrectly. For other difficulties with our SDK, please read the Troubleshooting section for more information.
Test your integration
To test your integration, activate logs and start your application. You will see the following lines in the logcat, meaning the SDK is correctly launched:
You can then follow our tutorial to get to know more about how to use the application.