The Android SDK Example App is a sample implementation of the Monetate Android SDK. The app compiles a list of events that are then sent to the Engine API to update the UI based on the actions the Engine API returns. You can use this source code either as a reference for your own app or as an inclusion in your own source to aid development.
App Setup and Execution
Submit a support ticket using the Kibo Technical Support portal to obtain the app. To set it up, open the project in Android Studio.
To run the app, click Run. A simulation of the app appears.
Using the App
The example app simulates a storefront. You can trigger various events within the app by performing actions within the app. Events and their responses are recorded in the log within Android Studio.
The following events are automatically triggered upon app startup:
|Indicates the user-agent header from the client originating the request.|
|Indicates the IP address of the visitor.|
|Indicates the visitor's screen size (height and width) in pixels.|
In addition to the above events, the following events are triggered upon taking various actions within the app:
|Indicates a page view event.|
|Indicates an event for a decisioning request.|
|Indicates a view event for product details.|
|Indicates a cart view event and the contents of a card.|
|Indicates a purchase event and the order details.|
Reusing Example App Code in Your App
Once you import the SDK into your app, you can include the following code to set up a new instance:
Account account = new Account("localhost.org", "a-701b337c", "p","localhost"); User user = new User(); user.setCustomerId(null); user.setDeviceId(null); user.setKiboId("auto"); ContextMap contextMap = new ContextMap(); KiboPersonalization kiboPersonalization = new KiboPersonalization(user,account,contextMap); IpAddress address = new IpAddress(); address.setIpAddress("127.0.0.0"); kiboPersonalization.report(CommonConstants.ContextIpaddress, address);
contextMap attributes to customize this instance to your app.
For a complete list of methods and objects you can use, refer to the SDK API Reference.