Follow the steps listed below for SDK integration with Android application
- Create a web page which will be used to integrate the Applixir SDK.
- Create a WebView component in your Android activity to display the webpage. This component is used to get and post messages between the game code and the Applixir SDK. Perform the following tests on the WebView component.
- WebView loads itself without cutting off any content on the webpage.
- Test for all the application supported screen resolutions.
- Test your game content and video content for all the supported screen resolutions.
- Integrate Applixir SDK using the web page. The steps are the same as described HTML integration guide. The steps are listed here briefly again for reference.
Step 1: Load the Applixir library inside the head tag of the webpage.
<script type='text/javascript’ src="https://cdn.applixir.com/applixir.sdk3.0m.js"></script>
Step 2. Add the video frame. Refer the article on video frame customization to check all kinds of customization that can be done to the video frame being created.
<div id="applixir_vanishing_div" hidden>
<iframe id="applixir_parent" allow="autoplay"></iframe>
</div>
Step 3. Define the status callback function. Refer Applixir events article for the list of all the status events generated by the Applixir SDK.
function adStatusCallback(status){
switch(status) {
case "ad-started":{ // Code (if needed) to execute for “ad-started”
}
break;
case "network-error":{ // Code (if needed) for “network-error”
}
break;
…… //Code for various events generated as status
}
}
Step 4. Define option values. Refer Video Options for a list of all the options.
var options = {
devId: your dev id, // Account ID
gameId: your game id,
zoneId: your zone id,
cTitle: your page title or primary subject,
keywords: set of comma separated keywords describing your content,
adStatusCb: adStatusCallback, // status callback method
};
5. Invoke the video player as per the implementation.
invokeApplixirVideoUnit(options);