Getting Started with Android

Register and Create App

Here are the steps you need to follow in order to get started with the App42 platform

bullet Register with the App42 platform.

bullet Create an App once you are on Quick-start page (after registration)

bullet If you are already registered, login to the AppHQ console and create an App from the App Manager -> Create App link

bullet Once the App is created, you will get an ApiKey/SecretKey that you will use in your app for initialization of the SDK.

Download and Set up SDK

bullet Download Android SDK

bullet Unzip the downloaded Zip file, the unzipped folder contains App42_ANDROID-x.x.jar

bullet Put this jar file into your libs folder of Android project in Eclipse as shown below -

SetUpAndroidJar

Initialize SDK

You have to pass your ApiKey/SecretKey to initialize the SDK.

   App42API.initialize("ANDROID_APPLICATION_CONTEXT","YOUR_API_KEY","YOUR_SECRET_KEY");

Using App42 Services

Once you have initialized your SDK with the API Key/SecretKey you have to build the target service that you want to use in your App. User Service can be built with following snippet. You can build the other services in a similar manner. Want to know about all the services of App42 Platform? Click Here

//Build User Service
UserService userService = App42API.buildUserService();
// Using userService reference, you should be able to call all its methods like create user/update user/authenticate etc.
//Build Storage Service
StorageService storageService = App42API.buildStorageService();
// Using storageService reference, you should be able to call all its methods like insert/save/update/delete etc for JSON objects.
//Similarly you can build other services like App42API.buildXXXXService()

Next

bullet Go To Creating App User for learning App User Management.

OR

bullet Go To Saving App Data to learn about App Data Storage.

Set up Campaign SDK

bullet After App42 Android SDK set up and Initialization, you could use the Campaign SDK for Marketing Automation.

bullet Your previous Unzipped folder and CampaignAPI folder both contain App42_ANDROID-CAMPAIGN_x.x.jar

bullet Put this jar file into your libs folder of the Android project in Eclipse as shown below