Actions

NativeTarget SDK4.2.1

From TyrooLabs

Contents

Overview

Screenshot 2017-03-14-12-47-30-320 com.lenovo.anyshare.gps.png
  • Flexibility to choose various Ad Types- Shopping Section,Interstitial, Product/App Grid Wall
  • Ability to change SDK Ad formats without a new integration- Shopping Section,Interstitial, Product/App Grid Wall
  • Preloading and caching for faster Ad serving. Ads to be prefetched and stored, before user can access it for better user experience
  • Open the layout in Fragment or Activity Mode

Newlogo.png

  • 'Shopping Layout
  • Interstitial
  • Product/App Grid Wall


Monetize

How monetization works ?

Integrate-SDK.png
Step 1

Register your app with TyrooCentral and manage Ad rules and Placements from the interface.

Decide-on-ad-platform.png
Step 2

Decide the Ad format- Shopping Layout, interstitial,Grid Wall while creating the placement and the Ad type- App install or Product Listing Ads while creating the rules through interface.

User-views-the-ad.png
Step 3

Ads based on optimization algorithm and your preferences is served to the user. User views the Ad ,clicks on it and perform actions like Purchase or install.

You-earn-revenue.png
Step 4

Track your earnings from TyrooCentral interface real time or integrate postbacks if you want to track it in your own platform.

Demo Application

Please download the demo apk from here

Steps to Integrate the new version 4.2.1

STEP 1:Register App on TyrooCentral

1.Go to TyrooCentral site or click here.
2.Login with your TyrooCentral username and password
3.Click on the Mobile tab
4.Click on the “Register New App” tab.
4.png
5.Fill app details and save.Fill the color that you want to use for the headers, Font size for Section Titles and Ads.Also fill the Shopping Section Title and upload the search, back and loading images ( for Shopping Section Layout ). If no image is uploaded default images will be served.
Font.JPG

STEP 2: Hashcode Generation

Hashcode is required for making any API call. Without proper hashcode , no response will be given by the API.The hashcode can be generated by clicking on the button "Generate Hashcode" as shown below. The generated hashcode has to be used while making a request from your side shown in section-


HASH1.jpg


HASH2.jpg


STEP 3: Integrate NativeTarget SDK AAR File

STEP 4 : Method Calls

  • Methods required to be called at the time of Instantiation of application:

How to get callbacks

In case a publisher wants to log the events- Ad request, Ad loading started, Ad loading ended and fail event ,then he can do so as shown below


ICallback<Boolean> getCallBack() {

       return new ICallback<Boolean>() {
           @Override
           public void onRequest(Boolean result) {
               Log.e("Tyroo-callback", "request");
           }
           @Override
           public void onRenderStart(Boolean result) {
               Log.e("Tyroo-callback", "onRenderStart");
           }
           @Override
           public void onPageDisplayed(Boolean result) {
               Log.e("Tyroo-callback", "onPageDisplayed");
           }
           @Override
           public void onFail(Boolean result) {
               Log.e("Tyroo-callback", "onFail");
           }
       };
   }


Pre load the Ads

Note: Above methods needs to be called in the onCreate() method of the Launcher Activity or wherever suitable- like when user has reached the home screen or certain event has occurred like the view of Shop icon is created etc. Ads should be preloaded beforehand for better user experience and to avoid delay in ad render.

public void preLoadAds(Context context) {

       InitiateTyrooSdk sdk = InitiateTyrooSdk.getInstance(context);  //Always pass Application context here
       sdk.setPlacementId(PLACEMENTID);
       sdk.setHashcode(HASHCODE);
       sdk.setPackageName(PACKAGE_NAME);
       sdk.setDynamicPlacement("true");
       sdk.preloadAds();
   }


Display the Ads

public static void displayAds(Context context, ICallback<Boolean> iCallback, LinearLayout rootView)

   {
       try {
           InitiateTyrooSdk sdk = InitiateTyrooSdk.getInstance(context);  //Always pass Application context here
           sdk.setPlacementId(PLACEMENTID);
           sdk.setHashcode(HASHCODE);
           sdk.setPackageName(PACKAGE_NAME);
           sdk.setDynamicPlacement("true");
           sdk.setICallBack(iCallback);
           if(rootView != null)
               sdk.displayAds(rootView);
           else
               sdk.displayAds();
       } catch (Throwable throwable) {
           throwable.printStackTrace();
       }
   }

Note: Pass Application context to the method setContext() instead of Activity Context.

  • displayAds can be called in two ways
   * For Ads in Full Screen Activity:
             sdk.displayAds();
   * For Ads in required layout:
             sdk.displayAds(LAYOUT);


  • Please also add the below snippet in the Activity code:

@Override

public void onBackPressed() {

   rootView.removeAllViews();
   onDestroy();
   super.onBackPressed();

}

    • Here, rootView is the layout that is passed in displayAds and preloadAds.
Layout Kindly pass the reference variable of LinearLayout


Method Arguments Definations
context context of the Application.
Placement Id Kindly obtain your Placement Id from Tyroo Account Manager or create on your own-[Manage Placements]
Hashcode Generate hashcode using steps in current documentation.
Package Name Package name of the Application.
Dynamic Placement This needs to be set true(in string like "true") for all cases.


Dependencies Required

Include the following libraries in the gradle (application),if app is using compileSdkVersion 25 and buildToolsVersion '25.0.2'

Library Name Contribution towards Increase in App Size
compile "com.android.support:cardview-v7:25.3.1" 16Kb
compile (name: 'tyroo-release_4.2.1', ext:'aar') 123 Kb
compile "com.android.support:recyclerview-v7:25.3.1" 400 Kb

If the developer is already using the above libraries, he should not include it once again and this will lead to decrease in app size accordingly. For example, if an app developer is already using library- "com.android.support:recyclerview-v7:25.3.1" or "com.android.support:cardview-v7:25.3.1", then he should not include it once again.


Include the following libraries in the gradle (application),if app is using compileSdkVersion 23 and buildToolsVersion '23.0.2'

Library Name Contribution towards Increase in App Size
compile "com.android.support:cardview-v7:23.0.2" 20Kb
compile (name: 'tyroo-release_4.2.1', ext:'aar') 123 Kb
compile "com.android.support:recyclerview-v7:23.0.2" 430 Kb

If the developer is already using the above libraries, he should not include it once again and this will lead to decrease in app size accordingly. For example, if an app developer is already using library- "com.android.support:recyclerview-v7:23.0.2" or "com.android.support:cardview-v7:23.0.2", then he should not include it once again.

Manage Placements

Placements are a way to render the Ads. There are two kind of placements- parent placement and sub placement. Parent placement contains sub placement . One parent placement can contain multiple sub placements with a defined priority for the sub placements. Priority decides the order in which sub placements will be arranged in a layout.

Also each sub placement has an associated rule which dictates whether PLA ,APP install or Brand Ads will be served and what is the no of ads that needs to be served. To know more about it refer- [Rules and Apps]


Shop Look

Add Placement: Create a new placement for Shopping Section Layout

  1. Select the App
  2. Give the Parent Placement a name
  3. Chose Placement source as SDK
  4. Select Ad format type as- Shopping ( for Activity mode ) or Shopping Layout ( For Fragment Mode)
  5. Select further sub placements for shopping tab. In total 9 sub placements needs to be selected.For shopping section further 9 sub- placements will be attached to the main placement with below priority list
Sub Placement Name Priority Ad format Type
471 by 181 Banner 1 Image Banner
Top Deal/Trendign Now 2 Grid carousel
Handpicked 3 Grid carousel
300 by 250 banner 4 Image Banner
Fashion 5 Grid Wall Activity
Mobile 6 Grid Wall Activity
Home 7 Grid Wall Activity
Electronics 8 Grid Wall Activity
Search 9 Grid Wall Activity


Adplacement.JPG

Interstitial

  1. Select the App
  2. Give the Parent Placement a name
  3. Chose Placement source as SDK
  4. Select Ad format type as- Image Interstitial
  5. Select further sub placements for Image Interstitial. One Sub placement will be chosen from the Select placement list


Sub Placement Name Priority Ad format Type
Full Page Interstitial 1 Image Interstitial

Interstisial.JPG


Grid Wall Activity

  1. Select the App
  2. Give the Parent Placement a name
  3. Chose Placement source as SDK
  4. Select Ad format type as- Image Interstitial
  5. Select further sub placements for Grid Wall Activity. One Sub placement will be chosen from the Select placement list


Sub Placement Name Priority Ad format Type
Best Deals 1 Grid Wall Activity

GridWallActivity.JPG

How to create sub placement

  1. Select the App
  2. Give the Placement a name
  3. Choose Placement source as SDK
  4. Select Ad format type as- Grid Wall Activity, Grid carousal, Image Interstitial or Image Banner
  5. In Rule option select- Rules
  6. In Select Rules- choose the rule name


Subplacement.JPG

Rules and Apps

A rule helps in deciding what kind of Ads PLA ,App install or Brand Ads will be served on a placement.Following sections will list down , how one can create and manage rules


Manage Ad Rules

How to create a new Rule

A new rule can be created by clicking on the "Add Rule" button.

Addrule7.PNG


On the displayed pop up, preferences can be chosen like whether you want to served Install Ads, Product Listing Ads or both.


When Install Ad is selected , you can choose the following

  • Campaigns for which you want to serve the Ads
  • Campaign category
  • Language in which you want to serve the Ads

Installads.PNG


When Product Ad is selected, you can choose the following

  • Campaigns for which you want to serve the Ads

PLA.PNG

Activate/Deactivate the Rule

A rule can be activated or deactivated , by selecting the rule and clicking on the "Activate Rule" or "Deactivate Rule " button.

Activate Rule Activaterule.PNG


Deactivate Rule


Deactivaterule.PNG

View the Rules filters

View filters.PNG


View the Apps on which the the rule is applied

Viewapps.PNG

Filters

These filter will help you filter rules by their status

Filter.png