Quickstart
Integration Documentation for Netzyn Ad SDK
Introduction
This document provides instructions for integrating and using the Netzyn Ad SDK in Android applications. The intended audience is development partners looking to offer trials of mobile applications.
Netzyn Ad SDK is a software development kit designed to enable Android applications to access virtualized applications running in the cloud for pre-defined periods of time, with the intent to encourage users to install the application should they wish to use it in the future.
Getting Started
System Requirements
- Android API level 33 or higher
- Android Studio 3.0 or higher
- Gradle 4.1 or higher
Installation
To use the adPlayer aar, it must be copied into the libs directory of the Android application file structure, alongside the nzplayerlib aar file. The aar files must then be included as dependencies in the app build.gradle
file:
Setup and Configuration
To initialize the AdPlayer, call the init function with partner information:
val userId = "123abc"
val partnerId = "Partner Name"
## val token = "asdf_ased" (not currently being validated)
val language = “en” // “es”, “pt”
val country = "US"
AdPlayer.init(userId, partnerId, token, language, country)
Features and Usage
The Netzyn Ad SDK provides the following main features:
- Accessing virtualized applications from the cloud
- Listening for a response from the application
Launching an application
From the partner's referring activity, you may launch a selected cloud app by getting an instance of the AdPlayer and calling the functionlaunchCloudApp
AdPlayer.getInstance().launchCloudApp(androidContext, appName, appId, timePlay1, timePlay2, playstoreUrl, appIconUrl, showWelcome, orientation, cloudAppStatusListener)
androidContext |
Android context for the referring activity |
appName |
String, name of the cloud application |
appId |
String, unique identifier for the cloud application |
timePlay1 |
Long, timer 1 duration |
timePlay2 |
Long, timer 2 duration |
playstoreUrl |
String, URL resource for the playstore |
appIconUrl |
String, URL resource for the cloud app graphic |
showWelcome |
Boolean, indicates use of the cloud application title screen (welcome screen) |
orientation |
enum which may take 2 values: LANDSCAPE , PORTRAIT |
Listening for a response from the SDK
CloudAppStatusListener
is an interface containing the onComplete(trialSummary: TrialSummary)
function for the AdPlayer, and is called as the AdPlayer exits back to the referring activity. It is recommended that CloudAppStatusListener
be implemented in the ViewModel of the activity.
TrialSummary
is an AdPlayer data class containing the following:
outcome |
String, may have the values of exited trial , clicked install , declined install , MORE |
cloudAppId |
String, unique identifier of the cloud application that was run |
playStoreUrl |
String, the Google Playstore URL that was provided to the user for possible installation |
duration |
Long, number of seconds the user has spent with the cloud application |
Files
Netzyn supplies two files, the version corresponds to the release date.
- adplayerexampler_
.tgz - AdPlayer example - adplayeraar_
.tgz - two aar files to put in application and to put in above AdPlayer example.
AdPlayer Example App
AdPlayer is an example app that uses the Ad SDK. AdPlayer uses a CMS to get both a list of available ads and to get the needed ad metadata. With the metadata AdPlayer calls the Ad SDK with launchCloudApp() API. The Ad SDK, displays the initial screen (optional), starts running the cloud app and when the time expires, displays an ending screen. The user can then go to the Play Store to install the app.
Changelog
Record of changes to Netzyn Ad SDK for each version, including new features, updates, bug fixes, and deprecations.
- 6/23/2023 - New version now supports Android API levels of 33, as opposed to only 28.
- 10/18/2023 - New version works when app is minified. Pause is properly supported. Improved performance on older devices. Multi-language support.