# POKKT SDK Integration Guide v8.2.0 Android

#### Overview <a href="#kwkkzt76l1yt" id="kwkkzt76l1yt"></a>

Thank you for choosing Pokkt SDK for Android. This document contains all the information required to setup the SDK with your project.

Before implementing plugins it is mandatory to go through project configuration and implementation steps, as these sections contain mandatory steps for basic SDK integration.

You can download our SDK from [pokkt.com](https://wiki.pokkt.com/Native_Android).

Downloaded SDK package will contain:

1. PokktSDK\_v8.2.0.aar : Pokkt SDK in aar format.
2. Sample App using PokktSDK

#### Project Configuration <a href="#xx1nmmwi76gz" id="xx1nmmwi76gz"></a>

Add PokktSDK\_v8.2.0.aar to your project app/libs folder and add  the following line in your app level build.gradle file. **minSdkVersion** supported is **16.**

dependencies {&#x20;

implementation fileTree(include: \[‘PokktSDK\_v8.2.0.aar'], dir: ‘libs');

implementation ‘com.google.android.gms:play-services-ads:21.3.0’ //Optional

}

We expect Google play services integrated in project, although it is optional but we recommend you to integrate it, as it is required to fetch AdvertisingID for device, which is useful to deliver targeted advertising to Android users.

#### Adding Your Application to Your Pokkt Publisher's Account

This one parameter is accepted by almost all API’s of Pokkt SDK. This controls the placement of ads and can be created on Pokkt Dashboard.

<div align="center"><figure><img src="/files/5v37fEcbseZsqUW9AEqR" alt=""><figcaption></figcaption></figure></div>

Developer needs to create screens in Pokkt Developer account.

<figure><img src="/files/GeV3oYQEpy34dK1BW7Sk" alt=""><figcaption></figcaption></figure>

#### Implementation Steps <a href="#mnyc2oriqye2" id="mnyc2oriqye2"></a>

Set Application Id and Security key in Pokkt SDK. You can get it from Pokkt dashboard from your account. These are unique per app registered. **This must be called before calling any other methods of Pokkt SDK**.

`PokktAds.setPokktConfig("<PokktAppID>","<PokktSecurityKey>","<Activity>");`

#### FullScreen Ads

To cache FullScreen ad, call below method

`PokktAds.cacheAd("<ScreenId>",<PokktAdDelegate>);`

To show FullScreen ad, call below method

`PokktAds.showAd(“<ScreenId>”,<PokktAdDelegate>, null);`

To check if FullScreen ad is cached or not, call below method

`PokktAds.isAdCached("<ScreenId>">);`

#### Banner Ads

Add Banner Ad View to layout

```xml
<com.pokkt.sdk.banners.PokktBannerView
android:id=“@+id/pokkt_banner_view"
android:layout_width="320dp"
android:layout_height="50dp"
android:layout_centerHorizontal=“true"/>
```

To show Banner ad, call below method

`PokktAds.showAd("<screenId>", <PokktAdDelegate>, <pokktBannerView>);`

To destroy Banner ad, call below method

`PokktAds.destroyBanner(<pokktBannerView>);`

To define PokktAdDelegate, refer below code

```
PokktAds.PokktAdDelegate adDelegate = new PokktAds.PokktAdDelegate() {
@Override
public void adCachingResult(screenId,isSuccess,reward,errorMessage) { }
@Override
public void adDisplayedResult(screenId,isSuccess,errorMessage) { }
@Override
public void adClosed(screenId,isComplete) { }
@Override
public void adGratified(screenId,reward) { }
@Override 
public void adClicked(screenId) { }}
```

#### Test Ads <a href="#peb90h6wvob8" id="peb90h6wvob8"></a>

* Application Id : f303768353fb89d188f24b36c4d80b2e
* Security Key : f3b2bec2234694467398589e1606234b
* Sample Screen Id for Video : 684ab1e66abeb060faa500136c4c6a74
* Sample Screen Id for Interstitial : 5e59028c8332c9583e742c183abbaafb
* Sample Screen Id for Banner : 129cc53b4666f5ae1ebad6a9bc942764

#### Debugging

When your application is under development and if you want to see Pokkt logs and other informatory messages, you can enable it by setting shouldDebug to true . Make sure to disable debugging before release.

Other than enabling debugging for Pokkt SDK, it can also be used to

export your log to your desired location.

`PokktAds.Debugging.shouldDebug(“<Context Context>”,<true>);`

`PokktAds.Debugging.exportLog(getActivity());`

#### Proguard <a href="#rpv7f81v8k82" id="rpv7f81v8k82"></a>

If you are using proguard in your app, add following rules to your proguard file.

```
# Pokkt SDK
-keep class com.pokkt.** { public *; }
-dontwarn com.pokkt.**
# moat
-keep class com.moat.** { *; }
-dontwarn com.moat.**
# 360 if Pokktsdk360ext.jar or Pokktsdk360ext.aar is added
-keep class com.pokkt.sdkmd360ext.** { *; }
-keep class com.c.c.**{*;}
# OM
-keep class com.iab.omid.library.pokkt.**{*;}
-dontwarn com.iab.omid.**
# For communication with Pokkt WebView
-keepclassmembers class * {
@android.webkit.JavascriptInterface <methods>;
}
```

#### FAQ

* If you are using server to server integration with Pokkt, you can also set Third Party UserId in PokktAds.

`PokktAds.setThirdPartyUserId("<Third party user Id>");`

* If you want to set GDPR consent in Pokkt SDK. This must be called before calling any ad related API. Developers/Publishers must get the consent from user. This API can again be used by publishers to revoke the consent. If this API is not called or invalid data provided then SDK will access the users personal data for ad targeting.

```
PokktAds.ConsentInfo consentInfo = new PokktAds.ConsentInfo();
consentInfo.setGDPRApplicable(true);
//true if GDPR is applicable.
consentInfo.setGDPRConsentAvailable(false);
//false if user has given consent to use personal details for ad targeting.
PokktAds.setDataAccessConsent(consentInfo);
```

* If Developer want to set some values in POKKT SDK that they need to be sent to their server via POKKT Server callbacks.

`Map<String, String> params = new HashMap<>();`\
`params.put("testdata","{\"adnetwork\": \"pokkt\"}");`\
`PokktAds.setCallbackExtraParams(params);`

* FullScreen Ads are of two types : Video and Interstitial. It can be rewarded or non rewarded. Its properties can be configured from the Pokkt dashboard. You can either cache the ad in advance or directly call show for it. We suggest you cache the ad in advance so as to give seamless play behaviour, In other case it will stream the video which may lead to unnecessary buffering delays depending on the network connection.
* For better targeting of ads you can also provide user details to our SDK using below code.

```
PokktUserDetails pokktUserDetails = new PokktUserDetails();
pokktUserDetails.setName(" ");
pokktUserDetails.setAge(" ");
pokktUserDetails.setSex(" ");
pokktUserDetails.setMobileNumber(" ");
pokktUserDetails.setEmailAddress(" ");
pokktUserDetails.setLocation(" ");
pokktUserDetails.setBirthday(" ");
pokktUserDetails.setMaritalStatus(" ");
pokktUserDetails.setFacebookId(" ");
pokktUserDetails.setTwitterHandle(" ");
pokktUserDetails.setEducation(" ");
pokktUserDetails.setNationality(" ");
pokktUserDetails.setEmployment(" ");
pokktUserDetails.setMaturityRating(" ");
PokktAds.setUserDetails(pokktUserDetails);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.pokkt.com/pokkt-sdk/pokkt-sdk-integration-guide-v8.2.0-android.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
