Note : The file apm-3.1.8.aar weighs approximately 1 MB, once installed on an android phone, the weight of an android application containing the SDK will be increased approximately by 2.5 MB
Add dependency appcompat-v7 and recyclerview-v7
This SDK needs the dependency appcompat-v7 and recyclerview-v7 from google to work.
Add theses dependencies in build.gradle
For more information about theses dependencies, click here
Add dependency play-services-base (TLS 1.2 for Android 4.1 – 4.4)
For security reasons, our server only supports HTTPS connection with a minimum TLS 1.2 protocol.
Android 4.1 – 4.4 phones support TLS 1.2 with the help of Google Play Services
Our SDK needs a Google Play Service to update security, Google has several dependencies that hinder the play-services-base code.
Example with Google Analytics dependency :
Use the method APMUIServicesUser.userClientConnect() for connect automatically your user to app’s miles.If no account exist with this informations, the server create automatically this account.
This method needs : « email », « userID » and « optIn »
– « email » is the email of user– « userID » is a unique identifier in your database
– « optIn » is the RGPD OptIn
If you don’t want pass the email, you can build a encrypted email with the userID, for example : 123456789@appsmiles.fr
– 123456789 is the userID
Implements this for :– app’s miles account and client account not connected, so, redirect user to your process login/register account– app’s miles account not connected and client account connected, so, connect app’s miles account with method userClientConnect– app’s miles account and client account connected, so, nothing
publicclassAbstractActivityextendsFragmentActivityimplementsAPMOnboardingUtilsListener{//...//Declare a object of APMOnboardingUtils in your classprivateAPMOnboardingUtils mOnboardingUtils; @OverrideprotectedvoidonCreate(@NullablefinalBundle savedInstanceState) { super.onCreate(savedInstanceState);//...//AbstractActivity become the listener on events of onboarding mOnboardingUtils =newAPMOnboardingUtils(this); } @OverrideprotectedvoidonResume() { super.onResume();//...//Listen events of onboardingmOnboardingUtils.register(this); } @OverrideprotectedvoidonPause() { super.onPause();//...//Unlisten events of onboardingmOnboardingUtils.unregister(this); } @OverridepublicvoidapmOnboardingButtonOkClicked() {//Get the event OnboardingButtonOkClickedboolean clientAccountConnected =true;if(clientAccountConnected) //TODO check if account client is connected {//Account client is connectedAPMServices services =APMServicesPublic.sharedInstance(MyApplication.this);if(services.getUser() !=null&&services.getUser().isConnected()) {//Client account connected and app's miles account connectedLog.i("TAG","Client account connected and app's miles account connected"); }else {//Client account connected --> need to connect app's miles accountLog.w("TAG","Client account connected --> need to connect app's miles account");apmConnection(MyApplication.this); } }else {//TODO show screen login/create account } } @OverridepublicvoidapmOnboardingButtonLaterClicked() { } @OverridepublicvoidapmOnboardingButtonNeverClicked() { }}