Λ V
0/0
CONTENT
AdNolesh Network

USER MANUAL
v 1.0

OVERVIEW
Unlike other ad networks, AdNolesh offers you a cross-promotion of Android applications for free. Attract users for your apps by trading impressions, taps, and downloads with other developers on our unique exchange system. The main benefits of our SDK are:
  • A free cross-promotion system
  • Effective control over your app with remote settings
  • All modern range of ad units
  • Fully customizable banners & interstitials
  • The only permissions needed are internet permission & access network state
  • The SDK is lightweight (< 300 Kb)
  • Integration is easy and takes less than 15 minutes
  • Supports Android version 4.0 and up
HOW IT WORKS
Our unique exchange system allows you to earn credits (internal abstract currency) by showing ads in your apps. The credits are needed to promote applications or websites in third-party(exchange) apps. There is an opportunity to share credits between all campaigns using credit pool.

If you decided not to integrate our SDK into your app, but still want your app to be shown in AdNolesh Network, you can buy some credits for your apps. To do this you should go to Paid Services tab.

It does make sense what sort of ad units you show! Each type has different price and solvency (see price section). For example, a banner or a notification earns the fewer credits than video interstitial. In most cases, the consumption of credits for impressions is calculated the same way as their production. The clicks and downloads are counted equally for all ad types.

Also, you should pay attention to the fact that each ad unit has its own (positive or negative) influence on the audience and the integration ability. Some developers may not want to integrate specific ad units into their app for some reason. So, the recommendation is to complete all the ad units on the server side in order to achieve the maximum result.

PRIVILEGED USER
The privileged users have additional bonuses such as access to stickers for banners, an opportunity to use video-interstitials, etc. To become the privileged user you have to buy Premium or Platinum account. Each type of account has their own range of features. You can see all of them on Paid Services tab. If you are not sure about getting a privileged account, you can try a 14-day free trial.
Although, these features have a positive influence on the audience they are optional.

REMOTE SETTINGS
The AdNolesh SDK will regularly check for updates to "remote settings". These are values you can set in the dashboard for your app. With these settings, you can control your app remotely without having to launch a new update. For instance, you can turn off banners in your application by switching a particular toggle in the app settings.
Every time the “initialization” method is called, the SDK fetches the settings.

GETTING STARTED
To use AdNolesh Network you need to create an account to get access to the dashboard. Then, you have to create a campaign by registering your app or website in our system. There are 2 options:
  • If you are going to promote application and it already exists on Google Play, you should choose "FIND APP" option and find it by typing its package.
  • In case your app is not published yet, or you want to advertise a website, you need to select "CREATE CAMPAIGN" and enter necessary information about it manually.
Once you have done, you need to complete ad units by clicking on the corresponding icons.
You should complete as many ad units as possible to have the maximum benefit from our system

ADVERTISING MANAGEMENT
After the process of registering the app or website, some ad units (notification & offerwall) are ready to use. Others require additional actions from you. You can easily control your ad campaign using icons and tabs in the main menu.
Icon Meanings

Settings of the notification ad unit. If you are a privileged user, it allows you to set the color of the notification and its sound, which will emphasize your notification among others. For users with a standard account, this icon only enables/disables the ad unit.


This icon enables or disables the offerwall ad unit.



Configures the banner ad unit. The user can specify the color of background, title, description, etc. Privileged users can also add specific decorations for their banners, such as stickers and background image.


Parameters of the interstitial ad unit. Allows to customize colors, shadows, and also specify visual content such as screenshots or banner. For the privileged users, there is also a possibility to specify a custom skin for the interstitial. Skin manager allows users to upload up to 20 images.


Controls the video-interstitial ad unit. It is available only for privileged users and works in conjunction with interstitial. In this section, the user can upload own video file, delete it or enable/disable the ad unit.
There are some restrictions for a video file. The duration of the file must not exceed 30 seconds. File size must be less than 5 Mb. Due to video playback in landscape orientation, the width and height of the video should be 480 and 270 pixels, respectively (optional requirement).


Calls the application settings. Here you can change the application's icon, enable/disable the display of a specific ad unit in your app on an Android device, and also add extra translations and specify the targeting.

To add additional translation for your app you need to press "translations" button. Then you should click on the "+" button, select a language code, and fill in all fields in the row. The default language is English.

To specify the targeting, you should press the "targeting" button and select the countries. Your app will be shown in the chosen countries. If you want that your application to be promoted in all countries, deselect all of them.


Shows the statistics of the chosen application. For more information, see analytics section.

After being created, the app (campaign) status is disabled. It is due to the fact the application does not have the credits necessary for promotion. So, you need to add credits to your app using Credit Management tab.
Credit Management
This tab is designed for transferring credits from credit pool to apps or vice versa and distribute them between apps. You can treat the credit pool as an independent wallet for your credits. For instance, when you buy credits, they are transferred to the credit pool. To use credits in the credit pool, you have to distribute them between your apps.
On the Credit Management tab, add a sufficient number of credits to your app by choosing donor app or credit pool on the left side and the app that requires credits on the right side. Then specify the number of credits below the list and press transfer button. Confirm your action.

If the credits are not enough, there are 2 options. One of them is to integrate the SDK into your application and wait for it earns credits. Another one is to purchase credits using Paid Services tab.
Paid Services
Since AdNolesh Network is free, this section is optional.
But for those who would like to use extra features should review offers on the Paid Service tab.
There are 2 categories: accounts and credits. You can choose a suitable plan by selecting the type of account and its validity period. Then you should confirm your choice and make a payment. If you doubt the need to have a paid plan, you can try a 14-day free trial.
Similar actions are required when you are going to purchase credits.

We accept the following payment systems: Advanced Cash (AdvCash), Paxum, Nix Money and Payeer. AdvCash aggregates additional payment systems such as Bitcoin, EPESE, Perfect Money. Thus, you can use AdvCash as an aggregator in case you do not have an account in the above payment systems.

If you would like to see the prices, please go to the price section.
Private Cross Promotion
This service is available only to users with Platinum account. Private cross promotion allows you to promote your own apps within each other. However, third-party applications can still advertise them. This feature does not require any credits unless third-party applications advertise your apps. If you do not want that your private app to be advertised outside your apps, just set the credits of this app to 0.
Keep in mind that you must have at least 2 apps and they have to be enabled and configured. Otherwise, this feature is useless.
Analytics
This section is designed to collect various app data and display it in a human-readable format. Analytics may display statistics of the particular app as well as aggregates the statistics of all apps.
Before analyze single or multiple apps you should select a date range and specify a mode of the campaign. Depending on the selected date range, the values are summed up by day, week, or month.

The "Advertiser" mode represents the number of your app's appearances in exchange (third-party) apps.

The "Publisher" reflects the number of ads shown by your app.

Then choose the app(s) from the list which you are interested in, and press apply button.

The first four values represent AGGREGATE STATISTICS. It unites CTR (Click-Through Rate), the number of impressions, clicks, and downloads of all selected applications.

Definitions:

Impression is a metric used to quantify the display of an advertisement on a user's screen. It is not action-based and is merely defined by a user potentially seeing the advertisement.

Click - an Internet advertising term for the number of times viewers of an ad unit click on it to view the full offer. Clicks can help you understand how well your ad is appealing to people who see it. Relevant, highly-targeted ads are more likely to receive clicks.

Download - is a metric used to quantify application installations. There are two application installation detection modes. If the SDK is integrated into your app, the AdNolesh Network uses the Google Play Campaign Measurement. Otherwise, it will use an alternative method that does not require SDK integration. Our system automatically determines which mode will be used to detect application downloads.

Click-Through Rate (CTR) - a ratio showing how often people who see your ad end up clicking it. CTR is the number of clicks that your ad receives divided by the number of times your ad is shown: clicks ÷ impressions = CTR. It is commonly used to measure the effectiveness of an ad campaign for a particular app.

To help increase your clicks and CTR, start by creating a great ad text and impressive decoration to make ads that are highly relevant and very compelling to your customers.


TIMELINE reflects impressions, clicks, and downloads of a single application or multiple ones for a certain period.

PERFORMANCE MEASUREMENTS - depending on the chosen criteria, this chart visualizes the quantity of impressions, clicks, downloads or CTR of ad units for the selected date range. It is the best tool to determine the effectiveness of ad units.

TOP APPS is a ranking of your apps according to different criteria during a given period of time. You can select one of the four criteria described above. Applications are displayed in descending order from left to right. Thus, the most successful and the worst app for a chosen timeframe and criteria will be located on the left and right sides, respectively. This chart is not available in app statistics.

POPULARITY - this graph represents total CTR data, overall number of impressions, clicks, or application downloads for a selected period of time, reflected on the world map. Here you can estimate the activity of your advertising campaign in different countries. The effectiveness of campaign can be determined by the brightness of the country color and the digital scale at the bottom.

BALANCE OF CREDITS displays the changes in app credits for a selected period of time. There is a possibility to unite all curves to see the overall trend (not available in app statistics).

Please note that the displayed data represents a specific timeframe (selected date range) and depends on the selected applications and the campaign mode.

SDK INTEGRATION
Android Studio
The simplest way to integrate our SDK into your project is by using Gradle's Dependency Management. Add the following repositories and dependencies to your app-level build.gradle file:
repositories {
    jcenter()
}

dependencies {
    //other dependencies...
    compile 'com.nolesh.ads:adnolesh-sdk:1.0'
}
After synchronization, the Gradle's Dependency Management automatically includes permissions, activities, broadcast receivers, and services that are required for the SDK into merged the AndroidManifest.xml file. Therefore, it inserts an optional permission that is needed to restore notification ad units after the device is rebooted. To exclude this permission from the merged AndroidManifest.xml file, you should follow these steps:
  • Add xmlns:tools="http://schemas.android.com/tools" to the manifest element
  • Remove this element from the merged manifest using the tools:node="remove" node marker
<manifest
	xmlns:android="http://schemas.android.com/apk/res/android"
	package="your.p4ck4ge.name"
	xmlns:tools="http://schemas.android.com/tools">

<!-- YOUR PERMISSIONS -->
...

<!-- REMOVE THE OPTIONAL PERMISSION FROM THE MERGED MANIFEST FILE -->
<uses-permission
	android:name="android.permission.RECEIVE_BOOT_COMPLETED"
	tools:node="remove" />

...
For more information, please visit merge multiple manifest files.

Also, it is required to add API TOKEN to the AndroidManifest.xml file (see Android Manifest section).

You are still allowed to add AdNoleshSDK.jar library to your project manually:
  • Switch your folder structure from Android to Project
  • Add AdNoleshSDK.jar file to the app/libs directory of your project (if there is no libs folder you should create it)
  • Right click on the JAR file and click on the Add as library
  • Add the required code to the AndroidManifest.xml file (see Android Manifest section)
  • Add the required code in the ProGuard configuration file (see ProGuard section)
Eclipse (Manual Setup)
If you are not using Gradle, you should perform the following steps:
  • Download the SDK from our website. You can do this by clicking on the Download SDK menu item located at the top of the dashboard
  • Create the libs folder in your project
  • Add AdNoleshSDK.jar file to the libs directory of your project
  • Right click on the project and choose Properties
  • Select Java Build Path and click on the Libraries tab
  • Click on the Add JARs button and select AdNoleshSDK.jar from libs folder you've just created
Screenshot below illustrates the entire process.


It is also necessary to add required lines to the AndroidManifest.xml file (see Android Manifest section). If you are going to use Proguard in your project, you should look at ProGuard section.
Android Manifest
Add your API TOKEN (also known as API KEY) to your app's AndroidManifest.xml file by adding a <meta-data> tag with name com.nolesh.ads.API_TOKEN. For android:value insert your own API TOKEN in quotes, as shown below.
<manifest>
    <application>
        <meta-data
            android:name="com.nolesh.ads.API_TOKEN"
            android:value="YOUR_API_TOKEN" />
    </application>
</manifest>
There are two ways to get your API TOKEN:
  1. You can find your API KEY on the profile page.
  2. Copy the API KEY to the clipboard by clicking on the "API TOKEN" menu item located at the top of the dashboard.
The rest of this section is only relevant for projects that do not use Gradle, or for other reasons require manual setup.

The AdNolesh SDK needs permissions to access the Internet and network state. You probably already have these permissions in your app. Make sure the following lines are in your AndroidManifest.xml outside of the <application> tag:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
There is an additional permission to restore notification ad units after the device is rebooted. This permission is optional, but highly recommended for better performance.
<!-- OPTIONAL PERMISSION -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
There are also the services, receivers, and activity that are required for the SDK. Please add these lines to your AndroidManifest.xml inside the <application> tag:
<!-- AdNolesh SDK -->
<activity
    android:name="com.nolesh.ads.AdNoleshActivity"
    android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
/>

<receiver android:name="com.nolesh.ads.Notification">
    <intent-filter>
        <action android:name="android.intent.action.BOOT_COMPLETED">
    </intent-filter>
</receiver>

<receiver
    android:name="com.nolesh.ads.AppInstallTrackingReceiver"
    android:enabled="true"
    android:exported="true"
    android:permission="android.permission.INSTALL_PACKAGES">
    <intent-filter>
        <action android:name="com.android.vending.INSTALL_REFERRER">
    </intent-filter>
</receiver>

<service
    android:name="com.nolesh.ads.AppInstallTrackingService"
    android:enabled="true"/>

<service
    android:name="com.nolesh.ads.AppInstallTrackingJobService"
    android:permission="android.permission.BIND_JOB_SERVICE"/>

The AdNolesh SDK uses an Android JobService to run certain background tasks efficiently. When scheduling this JobService, the AdNolesh SDK uses a job ID with value 2000 or 2100.

Job IDs need to be unique within an app, so it can happen that you run into a problem because our ID conflicts with an ID that is used in your app already. To solve this situation, you should use a different job ID (i.e. 2200).

ProGuard
This section is only relevant for projects that do not use Gradle, or for other reasons require manual setup. If you are not going to obfuscate your application using ProGuard, then you can skip this step.
Obfuscation protects an application from reverse-engineering or modification by making it harder for a third-party to access your source (decompiled) code.

If your app uses ProGuard™ to obfuscate your code before packaging it in your APK, you should use Android’s default proguard-android.txt config file, and add the following lines to your own ProGuard configuration file:
-keep class com.nolesh.ads.** { *; }
-dontwarn com.nolesh.ads.**

Initializing the SDK
To use the AdNolesh SDK, you need to make sure that it is initialized in the main Activity class:
import com.nolesh.ads.AdNoleshSDK;
import com.nolesh.ads.InitSDKEvents;

public class YourMainActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

	//1st parameter - Current activity
  	//2nd parameter - Debug mode. Set to true while developing your app
        AdNoleshSDK.initialize(this, true);

	//Or you can use overloaded method with 3 parameters
	//3rd parameter - Callbacks that return the result of initialization
	AdNoleshSDK.initialize(this, true, new InitSDKEvents() {
            @Override
            public void onSuccess() {
                //SUCCESS
            }
            @Override
            public void onError(String errorMsg) {
                //FAIL
            }
        });
    }
}
It is necessary to use AdNolesh in debug mode while developing your app to prevent invalid impressions, clicks, and downloads. Otherwise, it may cause of blocking your application or even terminating your account.
To put the SDK in debug mode set the second parameter of the constructor to true.

Google Analytics SDK
To count the number of app installs, the AdNolesh SDK adds a broadcast receiver to your app that handles the INSTALL_REFERRER intent. If you use Google Play Campaign Measurement, most likely you have implemented the CampaignTrackingReceiver in your application that processes the same intent. In this case, the app has more than one receivers registered to handle this very intent.
There are two ways to solve this issue:
  1. Using the interceptInstallReferrerIntent method that can dispath the INSTALL_REFERRER intent to other receivers, including the Google Analytics receiver, as necessary.
    Here's an example of using the interceptInstallReferrerIntent method to accomplish this:
    import com.nolesh.ads.IInstallReferrerReceiver;
    import com.google.analytics.tracking.android.CampaignTrackingReceiver;
    ...
    
    public class YourMainActivity extends Activity {
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            ...
    
            // Receives an INSTALL_REFERRER intent and pass it to other receivers,
            // including the Google Analytics receiver.
            AdNoleshSDK.interceptInstallReferrerIntent(new IInstallReferrerReceiver() {
                @Override
                public void onReceive(Context context, Intent intent) {
                    // Pass the intent to the Google Analytics receiver and/or other receivers.
                    new CampaignTrackingReceiver().onReceive(context, intent);
                }
            });
        }
    }
    
  2. Another way is to create a custom receiver that can receive the INSTALL_REFERRER intent and dispatch it to other receivers, including the AdNolesh & Google Analytics receivers, as necessary. Here's an example of a simple receiver to accomplish this:
    import android.content.BroadcastReceiver;
    import android.content.Context;
    import android.content.Intent;
    
    import com.nolesh.ads.AppInstallTrackingReceiver;
    import com.google.analytics.tracking.android.CampaignTrackingReceiver;
    
    /*
     *  A simple Broadcast Receiver to receive an INSTALL_REFERRER
     *  intent and pass it to other receivers, including
     *  the AdNolesh & Google Analytics receivers.
     */
    public class CustomReceiver extends BroadcastReceiver {
        @Override
        public void onReceive(Context context, Intent intent) {
            // Pass the intent to other receivers.
    
            // Pass the intent to the AdNolesh receiver.
            new AppInstallTrackingReceiver().onReceive(context, intent);
    
            // When you're done, pass the intent to the Google Analytics receiver.
            new CampaignTrackingReceiver().onReceive(context, intent);
        }
    }
    
    Change the default receiver to CustomReceiver in the AndroidManifest.xml file:
    <manifest>
        <application>
            <!-- Remove the default receiver from the merged manifest file -->
            <receiver
                android:name="com.nolesh.ads.AppInstallTrackingReceiver"
                tools:node="remove" />
            <!-- Register your newly created CustomReceiver -->
            <receiver
                android:name=".CustomReceiver"
                android:enabled="true"
                android:exported="true"
                android:permission="android.permission.INSTALL_PACKAGES">
                    <intent-filter>
                        <action android:name="com.android.vending.INSTALL_REFERRER">
                    </intent-filter>
            </receiver>
        </application>
    </manifest>
    
    For more information, please see the following link.
Make sure your integration follows our integration policies. If you need any assistance, please contact us using our contact form, and we will be happy to help you.

AD UNITS
There are 5 main types of advertising units. Each of them has its own cost and revenue (see price section).
NOTIFICATION
These ad units are displayed in the status bar at the scheduled time. To schedule notification and cancel a previously scheduled one, use the code below:
//1st parameter - the value of the hour when the notification should be displayed
//(might be any value from 0-23)
//2nd parameter - the value of the minute when the notification should be displayed
//(might be any value from 0-59)
//3rd parameter - delay represented in days
//4th parameter - interval (once, twice a day, etc)
//5th parameter - determines whether the current notification schedule will be removed and replaced by this one
//6th parameter - small icon which is used in status bar (may be omitted)
AdNoleshSDK.setNotification(15, 25, 0, NotificationScheduler.INTERVAL_ONCE, false, R.drawable.ic_statusbar);
If you need to cancel a scheduled notification without creating a new one, perform the following method:
AdNoleshSDK.cancelNotification();
You can also override the default title and content text:
//Set the title of the notification ad unit
NotificationScheduler.setTitle(this, "Your title");

//Set the content text of the notification ad unit
NotificationScheduler.setContentText(this, "Your text");
It uses minimum parameters, such as a title, a short description and an icon, which are defined in the campaign.

You may want to use an overloaded function that uses a default notification icon.
AdNoleshSDK.setNotification(15, 25, 0, NotificationScheduler.INTERVAL_ONCE, false);
It requires Android API 23 or higher.
The AdNolesh SDK uses a unique identifier with value 725 to post notifications. If a notification with the same id has already been posted by your application and has not yet been canceled, it will be replaced by the updated information. Thus, it is required to use a different notification ID.
Try NOT to use notification ad unit more than once a day, because notification bar is used for significant events, not for advertising. Otherwise, it may lead the end-user may want to delete your application.
OFFERWALL
The offerwall is a stand-alone activity which shows a list with up to 10 apps at once. To show the offerwall, you can use this code:
//show offerwall with default title
AdNoleshSDK.showOfferwall();

//OR

//show offerwall with custom title
AdNoleshSDK.showOfferwall("POPULAR APPS");

//OR

//shows offerwall with custom title and executes certain logic after it is closed
AdNoleshSDK.showOfferwall("POPULAR APPS", new Runnable() {
    @Override
    public void run() {
        //your code
    }
});
These methods update the offerwall content every time they are called.
There is also a possibility to integrate the offerwall into a custom ListView. This is a more popular way to use the offerwall, because it can be merged with other components in a host application. To show ads inside your ListView, use the following code:
//get ListView instance
ListView lv = (ListView)view.findViewById(R.id.offerwallListView);
AdNoleshSDK.showOfferwall(lv);

The AdNolesh SDK provides a ListAdapter which can wrap another ListAdapter and inserts ads at certain intervals. To wrap your ListAdapter inside an OfferwallAdapter use:
ListView myListView = (ListView)view.findViewById(R.id.myListView);
MyAdapter myAdapter = new MyAdapter(this, R.layout.my_listview_item, items);
OfferwallAdapter newAdapter = OfferwallAdapter.wrapListAdapter(this, myAdapter, myListView);
myListView.setAdapter(newAdapter);
Note that by wrapping your ListAdapter, the position value in your click listener’s onItemClick() could change. If you use ListAdapter.getItem() to retrieve an object this will not be a problem, since the OfferwallAdapter will automatically get the correct item from its wrapped adapter. If however you use the position value to retrieve data from a different source, you can compensate for the change in position by calling OfferwallAdapter.getItemPosition():
listView.setOnItemClickListener(new OnItemClickListener() {
    @Override
    public void onItemClick(AdapterView<?> parent, View view,
                                    int position, long id) {

        position = newAdapter.getItemPosition(position);

        //OPTION #1
        int originalPosition = newAdapter.getItemPosition(position);
        Object object = newAdapter.getUserItem(originalPosition);

        //OPTION #2
        Object object = adapter.getItemAtPosition(position);
        //OR
        Object object = newAdapter.getItem(position);
        //If the user clicks on the ad unit, then the object is null.
        //In this case, we have to ignore this action
        if(object==null) return;

        //For example
        Item item = (Item)object;
        Toast.makeText(getContext(), item.getTitle(), Toast.LENGTH_LONG).show();
    }
});

This ad unit uses minimal parameters such as a title, short description, and icon which are defined in the campaign. However, it is possible to change colors and even customize layouts (see offerwall customization).

Use only one instance of the offerwall that is integrated into a listView in your app, due to its static content. The content is updated each time the "initialize" method is called.
HIDDEN OFFERWALL
The hidden offerwall is a special implementation of offerwall which is located beneath an activity. To uncover it, the user should press and hold the handle and then swipe to the side.
To embed the hidden offerwall to your activity, you can use this code:
//1st parameter - activity
AdNoleshSDK.embedHiddenOfferwall(this);

//OR

//1st parameter - activity
//2nd parameter - if true, the handle aligns along the right side
AdNoleshSDK.embedHiddenOfferwall(this, false);

//OR

//1st parameter - activity
//2nd parameter - if true, the handle aligns along the right side
//3rd parameter - title of the offerwall
AdNoleshSDK.embedHiddenOfferwall(this, true, "POPULAR APPS");
To open and close hidden offerwall programmatically:
//immediate opening hidden offerwall if it's closed
//1st parameter - if true, the hidden offerwall will be opened. Otherwise, it will be closed
//2nd parameter - apply the animation when the offerwall is opening/closing
AdNoleshSDK.hiddenOfferwallSetState(true, false);
Like the previous one, this ad unit uses minimal parameters determined in the campaign and supports color customization.
An embedding of multiple offerwalls into the same activity is not allowed.
Use only one instance of the hidden offerwall in your app, due to its static content. The content is updated each time the "initialize" method is called.
OFFERWALL CUSTOMIZATION
The AdNolesh ListView ads have a default layout that matches your app’s theme. If you want to customize ads for better integration with your ListView, you can provide your own layout. To achieve this, you can call the "customizeAdUnits" method:
OfferwallAdapter.customizeAdUnits(R.layout.your_ad_list,
	R.id.icon, R.id.title, R.id.description);
The call in the above example will use the layout file your_ad_list.xml in your project to display ads. The AdNolesh SDK will search inside this layout for three views:
  • An ImageView to display the ad’s icon in
  • A TextView to display the ad’s title in
  • A TextView to display the ad’s description in

You might also want to specify the default layout colors.
The OfferwallAdapter has methods that allow you to adjust these colors:
  • Set background color of the offerwall:
    //color format: #rrggbb
    OfferwallAdapter.setBackgroundColor("#cccccc");
    
  • Set title color of the advertised apps in the offerwall:
    //color format: #rrggbb
    OfferwallAdapter.setTitleColor("#ff9900");
    
  • Set description color of the advertised apps in the offerwall:
    //color format: #rrggbb
    OfferwallAdapter.setDescriptionColor("#77ccff");
    

Additionally, the OfferwallAdapter makes it possible to change the color of any offerwall elements:
  • Set gradient background of the offerwall header:
    //1st parameter - top color (format: #rrggbb)
    //2nd parameter - bottom color (format: #rrggbb)
    OfferwallAdapter.setHeaderBackgroundColor("#3F51B5", "#303F9F");
    
  • Set title color of the offerwall header:
    //color format: #rrggbb
    OfferwallAdapter.setHeaderTitleColor("#FFFFFF");
    
  • Set close button color of the offerwall header:
    //color format: #rrggbb
    OfferwallAdapter.setHeaderCloseButtonColor("#FF7722");
    
  • Set the handle and arrow color of the hidden offerwall:
    //1st parameter - color of the handle (format: #rrggbb)
    //2nd parameter - color of the arrow (format: #rrggbb)
    OfferwallAdapter.setHandleColor("#3F51B5", "#FFFFFF");
    
Custom layout and colors will be applied to all offerwalls in the application
Banner is rectangular text ad that occupy a spot within an app's layout. It stays on screen while users are interacting with the app, and refreshes automatically after a certain period of time. In a layout XML file, you can add a banner to your app using the following code:
<RelativeLayout
 xmlns:android="http://schemas.android.com/apk/res/android"
 xmlns:adnolesh="http://adnolesh.com">
 ...
<!-- Set the "persistent" attribute to "true" for permanent banner display -->
<com.nolesh.ads.AdNoleshBanner
    android:id="@+id/banner"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    adnolesh:persistent="false"/>
 ...
</RelativeLayout>
If you would like to add a banner to your layout without using XML, you can instantiate the banner programmatically using the following code:
import com.nolesh.ads.AdNoleshBanner;
...
public void createBanner(ViewGroup parent) {
    // Set the second parameter to "true" for permanent banner display
    AdNoleshBanner banner = new AdNoleshBanner(getContext(), false);
    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
            ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
    parent.addView(banner, params);
}
//invoke the function above somewhere you want, for example:
button.setOnClickListener(new OnClickListener() {
    @Override
    public void onClick(View v) {
        RelativeLayout rl = (RelativeLayout)view.findViewById(R.id.bannerContainer);
        createBanner(rl);
    }
});
When there is no connection or content to display, banners are by default hidden. If you would like to show a banner anyway, set the "persistent" attribute to true, as shown in the examples above.

You can customize this ad unit by changing the color of decorations (background, text, border).
For privileged users, there is an ability to pin a sticker and upload an image to set it as a background.
Do not show the banner more than one per activity, because it may have a negative influence on the audience.
BANNER IN PREFERENCES
It is a special banner implementation designed to embed a banner in the PreferenceScreen. For instance, if you decide to integrate the banner into your live wallpaper which uses PreferenceScreen as settings, add the following code in the layout XML file:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:adnolesh="http://adnolesh.com">
...
<!-- Includes AdNolesh banner in preferences -->
<!-- Set the "persistent" attribute to "true" for permanent banner display -->
<com.nolesh.ads.AdNoleshBannerPreference
 adnolesh:persistent="false"/>
...
</PreferenceScreen>
Remember to initialize the SDK in the PreferenceActivity if you haven't done it yet:
public class WallpaperSettings extends PreferenceActivity {
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        addPreferencesFromResource(R.xml.prefs);

        //Initialize the SDK.
        //If done earlier in another activity, the SDK doesn't need to be initialized again.
        AdNoleshSDK.initialize(this, "YOUR_API_TOKEN", true);
    }
}
When there is no connection or content to display, banners in the preferences, like standard banners, are hidden by default. If you would like to show a banner in preferences anyway, set the "persistent" attribute to true, as shown in the example above.
INTERSTITIAL
Interstitial is full screen ad that covers the interface of its host app. It is typically displayed at natural transition points in the flow of an app, such as between activities or during the pause between levels in a game. When an app shows an interstitial, the user has the choice to either tap on the ad and continue to its destination, or close it and return to the app.
There are 2 ad unit orientations - landscape and portrait. The SDK detects and fixes current orientation until the user closes the interstitial.
If the interstitial checkbox is turned on in the campaign settings on the website, and interstitial ads are enabled in your app, the SDK automatically downloads the data for these ad units. By default, interstitial ad units are disabled to reduce Internet traffic. To activate them, you need to call enableInterstitials function with the true parameter as shown below:
//enable interstitial ad units in your app
AdNoleshSDK.enableInterstitials(true);
To show Interstitial ad somewhere in your app, use the following code:
//shows full screen interstitial advertisement
AdNoleshSDK.showInterstitial();

//OR

//shows full screen interstitial advertisement
//and executes certain logic after it is closed
AdNoleshSDK.showInterstitial(new Runnable() {
    @Override
    public void run() {
        //your code
    }
});
The AdNolesh interstitial makes it possible to upload screenshots, change the color of interstitial elements. Also, you can change the direction of the light to show shadows from the text and the icon.
For privileged users, there is an ability to upload an image and then choose it as a background.
VIDEO-INTERSTITIAL
This type of ad units works in conjunction with interstitial ads and available only for privileged users. After playing a video, the SDK shows the interstitial of the same campaign. So, make sure that you have configured and enabled the interstitial ad unit. Otherwise, the video-interstitial will not be displayed. Another thing you need to know about video-interstitial is that video has to be preloaded before showing it to prevent video lag. It may take a few seconds depending on the video size and Internet connection.

There are 2 scenarios to show video-interstitial:
  • The simplest one is to request a video and then show it somewhere:
    //download a video file
    //if 'isPersistentVideoRequestMode' is true, this method should be omitted 
    AdNoleshSDK.requestVideo();
    //show the video when the user clicks on the button
    Button button = (Button) view.findViewById(R.id.offerwall);
    button.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            //if the video is not ready, it won't be shown
            boolean result = AdNoleshSDK.showVideo();
        }
    });
    
  • Show video immediately after downloading:
    import com.nolesh.ads.VideoStatusEvents;
    ...
    
    //register a callback that will be called when a video is downloaded, fail, or interrupted
    //if 'isPersistentVideoRequestMode' is true, the 'onDownloaded' callback will NOT be triggered
    AdNoleshSDK.requestVideo(new VideoStatusEvents() {
        @Override
        public void onDownloaded() {
            //You need to call Toast.makeText() (and most other functions dealing with the UI) from the UI thread: 
            MainActivity.this.getActivity().runOnUiThread(new Runnable() {
               public void run() {
                  Toast.makeText(getContext(), "Downloading of the video is completed!", Toast.LENGTH_LONG).show();
               }
            });
            AdNoleshSDK.showVideo();
        }
    
        @Override
        public void onFail(String errorMsg) {}
    
        @Override
        public void onInterrupted() {}
    });
    
In additional, the "showVideo" method is overloaded to accept a callback that executes after the interstitial is closed.
//shows full screen video-interstitial advertisement and executes certain logic after it is closed
AdNoleshSDK.showVideo(new Runnable() {
    @Override
    public void run() {
        //your code
    }
});
To request a video each time after the user watched it, you have to set persistent video request mode by using the "setPersistentVideoRequestMode" method with true parameter.
//If enabled, a new video will be requested each time after watching a previous one.
//It starts downloading videos immediately after initializing the SDK
AdNoleshSDK.setPersistentVideoRequestMode(true);
If you decide to use a persistent video request mode in your app (setPersistentVideoRequestMode(true)), you should NOT call the "requestVideo" method.

PRICE
This section represents the expenses and revenues of ad units as well as prices for paid services.
Ad Units
In most cases, the consumption of credits for impressions is calculated the same way as their production. The clicks and downloads are counted equally for all ad types.

Cost:
Notification: 2 credits
Offerwall: 1 credit
Banner: 1 credit
Interstitial: 3 credits
Video-interstitial: 5 credits
Click: 3 credits
Download: 5 credits

Revenue:
Notification: 2 credits
Offerwall: 1 - 5 credits (depending on the number of displayed apps)
Banner: 1 credit
Interstitial: 3 credits
Video-interstitial: 5 credits
Click: 3 credits
Download: 5 credits

Paid Services
Privileged account price depends on the chosen plan and term of its validity.

Premium plan:
1 month:$11.99 ($11.99 per month)
3 months:$32.99 ($11.00 per month)
6 months:$61.50 ($10.25 per month)
12 months:$117.00 ($9.75 per month)

Monthly credit replenishment: 5000

Platinum plan:
1 month:$21.99 ($21.99 per month)
3 months:$59.99 ($20.00 per month)
6 months:$117.00 ($19.50 per month)
12 months:$225.00 ($18.75 per month)

Monthly credit replenishment: 12000



Credits cost depends on their number.

Bronze:5,000 credits for $4.99
Silver:10,000 credits for $9.50
Gold:25,000 credits for $22.75
Platinum:50,000 credits for $45.00


We reserve the right to change items and their prices at any time for any reason. This statement does not apply to the orders that are already paid for.

TERMS OF SERVICE
We provide a service to allow you to incorporate AdNolesh's SDK in your Android application, subject to these Terms and Conditions. This agreement will start from the date you include our SDK into one of your apps.

Use of AdNolesh's SDK, its ad units allows you to generate credits. The number of your credits will be determined by the actual performance of your non-incentivized ads. Any impression, install of promoted apps on your users’ device, or a click on the ad unit will generate credits for your app to its further promotion.

The AdNolesh SDK can solely be used for the purpose of using AdNolesh services.
Usage of the service
It is not permitted to use any automated means to access, monitor, modify, or otherwise manage your account or AdNolesh SDK. Any attempt to interfere or otherwise obstruct the functioning of our SDK or the AdNolesh promoted app system may result in immediate account termination. We reserve the right to exclude any app from our system at any time for any reason, including, but not limited to the app not being published on the Google Play, the app not being in accordance with Google Play content policy (http://www.android.com/us/developer-content-policy.html), or the app or the use of the SDK competing with the interests of AdNolesh Network. The publisher should follow the instructions as set forth in the integration guide. Failure to comply with these instructions may result in excluding an app from our system, resetting of all credits generated by that app, or account termination.
Use of information
By this agreement, you grant AdNolesh an irrevocable, worldwide license to use, copy, modify, adapt, reformat, and redistribute all information about applications you have authored, distributed or published in or outside the Google Play store. All uses of the SDK are subject to our approval. Inclusion of the SDK does not guarantee distribution or visibility on the AdNolesh Network.
No warranty and liability
You agree there is no warranty for this service. Any risk related to the quality, performance, uptime, or availability of the SDK or AdNolesh promoted app system lies with you. AdNolesh Network is not liable for any damages resulting from the use or inability to use this service. Without limiting the generality of the foregoing, AdNolesh Network is not liable for any error in the display of promoted apps, system outages, delays in applying changes in settings, or misrepresentation of numbers on the promoted apps dashboard. You assume any liability for the display of materials, any use of a third parties intellectual property, such as copyrighted terms, logotypes or images.
Miscellaneous
The relationship between AdNolesh Network and you is non-exclusive and this agreement does not restrict either party from engaging in any promotion or advertisement relationship with any other party.
You agree that AdNolesh Network can mention our relationship in press releases or on our website. You permit AdNolesh Network to display your application logo and description on AdNolesh website or any other media as part of its client list.

SDK INTEGRATION POLICY
Encouraging installs
You are allowed to stimulate users to install apps through our system or reward them in any way for viewing the ad units. Although, access to the promoted app page should be offered in a way that selects users with a true intent of exploring new apps.
Invalid clicks, downloads, and impressions
In order to protect your interests as well as those of advertisers, you are not allowed to click on the ad units or install promoted apps from one of your own apps. This restriction also applies to impressions.
Please note, we may disable any account if we find any publisher violating this policy.
Thus, to prevent invalid clicks, downloads, and impressions in your application, it is highly recommended to enable the debug mode when developing.

However, we realize that there may be cases where accidental clicks may occur in your app.
Privacy policy
AdNolesh systems store information about your users devices. The information AdNolesh Network collects is solely necessary to run the promoted apps system, and consists of non-privacy sensitive data such as Android SDK version and whether a WiFi connection is present. Also, the AdNolesh Network collects all so-called "package names" of installed applications on an Android device to exclude them from advertising on this device.

It is your sole responsibility to communicate the privacy implications of your use of the AdNolesh SDK to your users.
Privacy policy changes
Although most changes are likely to be minor, AdNolesh may change its Privacy Policy from time to time, and in AdNolesh's sole discretion. AdNolesh encourages visitors to frequently check this page for any changes to its Privacy Policy. Your continued use of this site after any change in this Privacy Policy will constitute your acceptance of such change.
Content guidelines
Your app must conform to the general Android guidelines for apps published in Google Play market.
Your relation with AdNolesh
Your use of the AdNolesh SDK does not mean your app is endorsed by AdNolesh Network. You have not allowed to promote your app in this way.

JAVADOC
There is an implementation example of all ad units. You can get it from GitHub:
IInitSDKEvents
public interface IInitSDKEvents
An interface that represents the SDK initialization events

Methods:
void onSuccess()
Gets called after the SDK was initialized successfully. This method gets called on the UI thread
void onError(String errorMsg)
Gets called after the SDK failed to initialize. This method gets called on the UI thread
Parameters:
errorMsg - information about the error
IInstallReferrerReceiver
public interface IInstallReferrerReceiver
A helper interface that is used to receive an INSTALL_REFERRER intent and dispatch it to other receivers

Methods:
void onReceive(Context ctx, Intent intent)
Called when the INSTALL_REFERRER intent is received
Parameters:
ctx - context of the application
intent - the INSTALL_REFERRER intent
IVideoStatusEvents
public interface IVideoStatusEvents
An interface that represents video state events

Methods:
void onReady()
Gets called after the video was loaded successfully. This method gets called on the UI thread
If video request mode is persistent, this event will NOT be triggered to prevent an endless loop of video playback
void onInterrupted()
Called when the video download is interrupted. This method gets called on the UI thread. This event gets triggered when the SDK shuts down during video download.
void onFail(String errorMsg)
Called when the video failed to load. This method gets called on the UI thread
Parameters:
errorMsg - information about the error
AdNoleshSDK
public class AdNoleshSDK
Entry point to the AdNolesh SDK

Methods:
public static void initialize(Activity activity, boolean debugMode)
Initializes the AdNolesh SDK. This method should be called in the onCreate method of your main Activity
Set debugMode to TRUE while developing. When you're ready to deploy, set it to FALSE
Parameters:
activity - current activity
debugMode - during the integration process, it should be set to true
public static void initialize(Activity activity, boolean debugMode, InitSDKEvents events)
Initializes the AdNolesh SDK. This method should be called in the onCreate method of your main Activity
Set debugMode to TRUE while developing. When you're ready to deploy, set it to FALSE
Parameters:
activity - current activity
debugMode - during the integration process, it should be set to true
events - callbacks that return the result of initialization
public static boolean isDebug()
Determines whether the SDK is in debug mode
Returns:
True if the SDK is in debug mode and initialized, false otherwise
public static boolean areNotificationsAvailable()
Determines whether notifications are enabled in this application. This value can be changed in the app settings on the website
Returns:
True if the "Notifications" option is enabled in the app settings on the website and the SDK was successfully initialized, false otherwise
public static boolean areOfferwallsAvailable()
Determines whether offerwall ad units are enabled in this application. This value can be changed in the app settings on the website
Returns:
True if the "Offerwalls" option is enabled in the app settings on the website and the SDK was successfully initialized, false otherwise
public static boolean areBannersAvailable()
Determines whether banners are enabled in this application. This value can be changed in the app settings on the website
Returns:
True if the "Banners" option is enabled in the app settings on the website and the SDK was successfully initialized, false otherwise
public static boolean areInterstitialsAvailable()
Determines whether interstitial ad units are enabled in this application. This value can be changed in the app settings on the website
Returns:
True if the "Interstitials" option is enabled in the app settings on the website and the SDK was successfully initialized, false otherwise
public static boolean areVideosAvailable()
Determines whether video-interstitial ad units are enabled in this application. This value can be changed in the app settings on the website
Returns:
True if the "Videos" option is enabled in the app settings on the website and the SDK was successfully initialized, false otherwise
public static boolean canSkipVideo()
Determines whether a user can skip video during playback by pressing "Back" button. This value can be changed in the app settings on the website
Returns:
True if the "Skip Video" option is enabled in the app settings on the website and the SDK was successfully initialized, false otherwise
public static void setPersistentVideoRequestMode(boolean enabled)
If enabled, a new video will be requested each time after watching a previous one. It starts downloading video immediately after initializing the SDK. Otherwise, the "requestVideo" method should be called before playing video.
If set to true, the "VideoStatusEvents.onReady" event will not be triggered to prevent an endless loop of video playback
Parameters:
enabled - true if the persistent mode must be activated, false otherwise
public static boolean isPersistentVideoRequestMode()
Determines whether a new video will be requested each time after watching a previous one
Returns:
True if the persistent mode is activated, false otherwise
public static void requestVideo()
Requests video-interstitial data and initiates video download
This method must be called before the "showVideo" method. If video request mode is set to persistent, this method should be omitted
public static void requestVideo(VideoStatusEvents events)
Requests video-interstitial data and initiates video download
This method must be called before the "showVideo" method. If video request mode is set to persistent, this method should be omitted
Parameters:
events - callbacks to be invoked when the video file is downloaded, fail or interrupted
public static boolean showVideo()
Shows full screen video-interstitial advertisement
In case the video request mode is NOT persistent, the "requestVideo" method must be called first
Returns:
True if the video-interstitial is shown, false otherwise
public static boolean showVideo(Runnable onDoneCallback)
Shows full screen video-interstitial advertisement and executes certain logic after it is closed
In case the video request mode is NOT persistent, the "requestVideo" method must be called first
Parameters:
onDoneCallback - a callback for when the video-interstitial is done. This is a convenient way to execute certain logic after the video-interstitial. The callback will be called when the video-interstitial is closed. May be null
Returns:
True if the video-interstitial is shown, false otherwise
public static void enableInterstitials()
Enables interstitial ad units
Parameters:
enabled - true if the interstitial ad units must be activated, false otherwise
public static boolean showInterstitial()
Shows full screen interstitial advertisement
Returns:
True if the interstitial is shown, false otherwise
public static boolean showInterstitial(Runnable onDoneCallback)
Shows full screen interstitial advertisement and executes certain logic after it is closed
Parameters:
onDoneCallback - a callback for when the interstitial is done. This is a convenient way to execute certain logic after the interstitial. The callback will be called when the interstitial is closed. May be null
Returns:
True if the interstitial is shown, false otherwise
public static boolean showOfferwall()
Shows a stand-alone activity which represents the offerwall with default title
Default value:
title - "recommended apps"
Returns:
True if the offerwall is shown, false otherwise
public static boolean showOfferwall(String title)
Shows a stand-alone activity which represents the offerwall
Parameters:
title - custom title of the offerwall
Returns:
True if the offerwall is shown, false otherwise
public static boolean showOfferwall(String title, Runnable onDoneCallback)
Shows offerwall with custom title and executes certain logic after it is closed
Parameters:
title - custom title of the offerwall
onDoneCallback - a callback for when the offerwall is done. This is a convenient way to execute certain logic after the offerwall. The callback will be called when the offerwall is closed. May be null
Returns:
True if the offerwall is shown, false otherwise
public static void showOfferwall(ListView listView)
Embeds the offerwall to the passed listView
Parameters:
listView - host for the offerwall
public static void embedHiddenOfferwall(Activity activity)
Embeds hidden offerwall into an activity
Parameters:
activity - activity that is used as a host for the offerwall
Default values:
alignToRightSide - false
title - "recommended apps"
public static void embedHiddenOfferwall(Activity activity, boolean alignToRightSide)
Embeds hidden offerwall into an activity
Parameters:
activity - activity that is used as a host for the offerwall
alignToRightSide - if true, the handle aligns along the right side
Default value:
title - "recommended apps"
public static void embedHiddenOfferwall(Activity activity, boolean alignToRightSide, String title)
Embeds hidden offerwall into an activity
Parameters:
activity - activity that is used as a host for the offerwall
alignToRightSide - if true, the handle aligns along the right side
title - custom title of the offerwall
public static void hiddenOfferwallSetState(boolean opened, boolean animated)
Sets the state of the hidden offerwall
Parameters:
opened - if true, hidden offerwall will be opened. Otherwise, it will be closed
animated - apply the smooth animation when the offerwall is opening/closing
public static boolean isHiddenOfferwallOpened()
Checks the state of the hidden offerwall
Returns:
True if hidden offerwall is opened
public static boolean showRandomInterstitialAd(String offerwallTitle, Runnable onDoneCallback)
Shows full screen interstitial advertisement, which is randomly selected from the offerwall, interstitial, or video-interstitial
To enable the interstitial and video-interstitial ads, make sure "enableInterstitials" and "setPersistentVideoRequestMode" are called with true parameter respectively
Parameters:
offerwallTitle - offerwall custom title. May be null.
onDoneCallback - a callback for when any of the interstitial ads are done. This is a convenient way to execute certain logic after the interstitials. Callback will be called when any of the interstitial ads are closed. May be null.
Returns:
True if any of the interstitial ads are shown, false otherwise
public static void setNotification(int hourOfDay, int minutes, int delay, long interval, boolean reset, int icon)
Schedules a notification ad unit
1st and 2nd arguments are the times when the scheduler would show a notification for the first time. If the stated trigger time is in the past, the notification will be shown the next day at the scheduled time.
Parameters:
hourOfDay - a number indicating the hour of the day. It is represented in 24-hour format
minute - a number indicating the number of minutes in an hour
delay - the number of days that must be skipped before the scheduler is triggered at the appointed time
interval - notification frequency. Use constants from NotificationScheduler class
reset - if true, the current notification schedule will be removed and replaced by this one. This parameter is always true if the interval is less than NotificationScheduler.INTERVAL_8_HOURS
icon - a resource ID in the application's package of the drawable to be used as a notification icon
public static void setNotification(int hourOfDay, int minutes, int delay, long interval, boolean reset)
Schedules a notification ad unit with a default icon.
1st and 2nd arguments are the times when the scheduler would show a notification for the first time. If the stated trigger time is in the past, the notification will be shown the next day at the scheduled time.
It requires Android API 23 or higher
Parameters:
hourOfDay - the hour value that is used when scheduling the notification ad unit. This value must be from 0 to 23 that corresponds to the 24-hour time format
minute - the minute value that is used when scheduling the notification ad unit. This value must be from 0 to 59
delay - the number of days that must be skipped before the scheduler is triggered at the appointed time
interval - determines a frequency of showing the notification. Use constants from NotificationScheduler class
reset - if true, the current notification schedule will be removed and replaced by this one. This parameter is always true if the interval is less than NotificationScheduler.INTERVAL_8_HOURS
public static void cancelNotification(Context ctx)
Cancels a scheduled notification. There is no need to initialize the SDK to call this method.
Parameters:
ctx - context of the application
public static void interceptInstallReferrerIntent(IInstallReferrerReceiver receiver){
Intercepts an INSTALL_REFERRER intent. This method should be used to receive an INSTALL_REFERRER intent and dispatch it to other receivers, such as the Google Analytics receiver.
It is NOT recommended to register a new broadcast receiver in the Manifest.xml file to receive an INSTALL_REFERRER intent
Parameters:
receiver - callback to be invoked when an INSTALL_REFERRER intent is received
AdNoleshBanner
public class AdNoleshBanner extends LinearLayout
Rectangular text ad that occupy a spot within an app's layout. It can be set either programmatically or in XML. The way this can be set in XML for instance is:
<RelativeLayout
 xmlns:android="http://schemas.android.com/apk/res/android"
 xmlns:adnolesh="http://adnolesh.com"
 android:layout_width="match_parent"
 android:layout_height="match_parent">
 ...
<!-- Set the "persistent" attribute to "true" for permanent banner display -->
<com.nolesh.ads.AdNoleshBanner
	android:id="@+id/banner"
	android:layout_width="match_parent"
	android:layout_height="wrap_content"
	android:layout_alignParentTop="true"
	adnolesh:persistent="false"/>
 ...
</RelativeLayout>
	
To add banner programmatically, use the code below:
// Set the second parameter to "true" for permanent banner display
AdNoleshBanner banner = new AdNoleshBanner(getContext(), false);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
parent.addView(banner, params);
	

Constructors:
public AdNoleshBanner(Context context)
public AdNoleshBanner(Context context, boolean persistent)
public AdNoleshBanner(Context context, AttributeSet attrs)
public AdNoleshBanner(Context context, AttributeSet attrs, int defStyle)

Methods:
public boolean isPersistent()
Determines whether the banner is constantly displayed
Returns:
True if the persistent mode is activated
AdNoleshBannerPreference
public class AdNoleshBannerPreference extends Preference
This is a special banner implementation designed to embed a banner in the PreferenceScreen. It can be set in XML only:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:adnolesh="http://adnolesh.com">
...
<!-- Includes AdNolesh banner in preferences -->
<!-- Set the "persistent" attribute to "true" for permanent banner display -->
<com.nolesh.ads.AdNoleshBannerPreference
 adnolesh:persistent="false" />
...
</PreferenceScreen>
	

Constructors:
public AdNoleshBannerPreference(Context context, AttributeSet attrs)
public AdNoleshBannerPreference(Context context, AttributeSet attrs, int defStyle)

Methods:
public boolean isPersistent()
Determines whether the banner in preferences is constantly displayed
Returns:
True if the persistent mode is activated
NotificationScheduler
public class NotificationScheduler
Stores predefined interval constants for notification scheduling. In addition, it allows to set the title and content text of the notification

Fields:
public static long INTERVAL_1_WEEK = 604800000
public static long INTERVAL_3_DAYS = 259200000
public static long INTERVAL_2_DAYS = 172800000
public static long INTERVAL_1_DAY = 86400000
public static long INTERVAL_12_HOURS = 43200000
public static long INTERVAL_8_HOURS = 28800000
public static long INTERVAL_ONCE = 0

Methods:
public static void setTitle(Context ctx, String title)
Sets the title of the notification ad unit. The title should not exceed 25 characters
Parameters:
ctx - context of the application
title - title of the notification
Default value:
title - application name or "AdNolesh Network"
public static String getTitle(Context ctx)
Gets the title of the notification ad unit
Parameters:
ctx - context of the application
Returns:
Title of the notification
public static void setContentText(Context ctx, String text)
Sets content text of the notification. The text should not exceed 50 characters
Parameters:
ctx - context of the application
text - content text of the notification
Default value:
text - "Pull it down to see the content ..."
public static String getContentText(Context ctx)
Gets content text of the notification
Parameters:
ctx - context of the application
Returns:
Content text of the notification
OfferwallAdapter
public class OfferwallAdapter extends BaseAdapter
A ListAdapter that wraps another ListAdapter and injects ads at certain intervals. Additionally, it allows for the offerwall appearance, ad units in the offerwall and wrapped ListAdapter customization.
Example of usage:
ListView myListView = (ListView)view.findViewById(R.id.myListView);
MyAdapter myAdapter = new MyAdapter(getContext(), R.layout.my_listview_item, items);
OfferwallAdapter newAdapter = OfferwallAdapter.wrapListAdapter(getContext(), myAdapter, myListView);
myListView.setAdapter(newAdapter);

Methods:
public static OfferwallAdapter wrapListAdapter(Context ctx, BaseAdapter adapter, AbsListView listView)
Wraps another ListAdapter and inserts ads at certain intervals
Parameters:
ctx - context of the application
adapter - ListView adapter to be wrapped
listView - ListView that is used to display data from the wrapped ListAdapter
Returns:
Wrapper of ListAdapter
public static void customizeAdUnits(int layoutResource, int icon, int title, int description)
Customizes ad units in the offerwall and wrapped ListAdapter
This method overrides the methods "setTitleColor" and "setDescriptionColor"
Parameters:
layoutResource - a layout file in the project to display ads
icon - an ImageView to display the ad's icon in
title - a TextView to display the ad's title in
description - a TextView to display the ad's description in
public static void setBackgroundColor(String color)
Sets background color of the offerwall
Parameters:
color - offerwall background color (format: #RRGGBB)
Default value:
color - Color.TRANSPARENT
public static void setTitleColor(String color)
Sets title color of the promoted apps in the offerwall and wrapped ListAdapter
Parameters:
color - title color of apps (format: #RRGGBB)
Default value:
color - "#252525"
public static void setDescriptionColor(String color)
Sets description color of the promoted apps in the offerwall and wrapped ListAdapter
Parameters:
color - description color of apps (format: #RRGGBB)
Default value:
color - "#888888"
public static void setHeaderBackgroundColor(String top, String bottom)
Sets gradient background of the offerwall header
Parameters:
top - top color (format: #RRGGBB)
bottom - bottom color (format: #RRGGBB)
Default values:
top - "#616261"
bottom - "#131313"
public static void setHeaderTitleColor(String color)
Sets title color of the offerwall header
Parameters:
color - header text color (format: #RRGGBB)
Default values:
color - Color.WHITE
public static void setHeaderCloseButtonColor(String color)
Sets close button color of the offerwall header
Parameters:
color - close button color (format: #RRGGBB)
Default values:
color - Color.WHITE
public static void setHandleColor(String handleColor, String arrowColor)
Sets the handle and arrow color of the hidden offerwall
Parameters:
handleColor - color of the handle (format: #RRGGBB)
arrowColor - color of the arrow (format: #RRGGBB)
Default values:
handleColor - Color.LTGRAY (#cccccc)
arrowColor - Color.WHITE
public int getOriginalCount()
Gets the number of items excluding ad units
Returns:
The number of items in the wrapped ListAdapter
public int getCount()
Gets the number of items including ad units
Use "getOriginalCount" method instead
Returns:
The number of items in the wrapped ListAdapter
public int getItemPosition(int position)
Calculates the position in the wrapped adapter based on the position in this adapter
Parameters:
position - position in this adapter (OfferwallAdapter)
Returns:
Correct item position of the wrapped adapter
public Object getUserItem(int position)
Gets the data item associated with the specified position in the wrapped data set
Use "getItemPosition" function to get the correct position
Parameters:
position - correct item position of the wrapped adapter
Returns:
The data at the specified position
public Object getItem(int position)
Gets the data item associated with the specified position in the data set
It returns null if the item belongs to the ad unit
Parameters:
position - position of the item whose data we want within the adapter's data set
Returns:
The data at the specified position or null
Utils
public class Utils
The utilities library contains a number of useful functions

Methods:
public static boolean isNetworkAvailable(Context ctx)
Checks whether the device is connected to the network or not
Parameters:
ctx - context of the application
Returns:
True if any network is available and connected, false otherwise
public static boolean isWifiAvailable(Context ctx)
Checks whether WiFi network is connected or not
Parameters:
ctx - context of the application
Returns:
True if WiFi network is connected, false otherwise
public static String getScreenDensityAbbr(Context ctx)
Obtains screen density abbreviation
Parameters:
ctx - context of the application
Returns:
Screen density abbreviation (e.g. MDPI, HDPI)
public static Bitmap flipImage(Bitmap bmp, boolean vertical, boolean horizontal)
Flips the image vertically or horizontally
Parameters:
bmp - source bitmap image
vertical - if true, the image will be flipped vertically
horizontal - if true, the image will be flipped horizontally
Returns:
Flipped bitmap image
public static void startMarket(Context ctx, String url)
Depending on the URI scheme, this method opens a website or app's page in the Google Play store
Parameters:
ctx - context of the application
url - address of website or app's page in Google Play
public static String getApplicationName(Context ctx)
Gets the name of the current application
Parameters:
ctx - context of the application
Returns:
Application name
public static boolean validateHexColor(String hex)
Validates the value of the color represented in the hexadecimal string
Parameters:
hex - hexadecimal string (format: #RRGGBB)
Returns:
True if the value of the color is correct
public static String colorToHex(int color)
Converts a color represented by an integer to a hexadecimal string
Parameters:
color - color represented by an integer
Returns:
Color represented by a hexadecimal string
public static int getForegroundColorBasedOnBrightness(int color)
Returns the foreground color based on the background color brightness
Parameters:
color - background color whose brightness is determined
Returns:
White or black color depending on the brightness
public static Bitmap changeBitmapColor(Bitmap bmp, int color, int addColor)
Changes the bitmap image color
Parameters:
bmp - source bitmap image
color - color to be applied to the bitmap
addColor - color to be added to the resulting image
Returns:
Source bitmap image with the new color
public static boolean isTablet(Context ctx)
Determines whether the device is a phone or tablet
Parameters:
ctx - context of the application
Returns:
True if the device is a tablet
public static boolean isLandscapeOrientation(Context ctx)
Determines the orientation of the device
Parameters:
ctx - context of the application
Returns:
True if the device is in landscape orientation, false otherwise
public static List getInstalledPackageList(Context ctx, boolean excludeItself)
Retrieves the list of packages installed on the device
Parameters:
ctx - context of the application
excludeItself - if true, excludes the current application package from the list
Returns:
The list of installed packages
public static int pxToDp(int px)
Converts raw pixels to the Density Independent Pixels
Parameters:
px - raw pixels
Returns:
Density Independent Pixels
public static int dpToPx(int dp)
Converts Density Independent Pixels to the raw pixels which maps to the screen pixels
Parameters:
dp - Density Independent Pixels
Returns:
Raw pixels

CONCLUSION
Using AdNolesh Network, the success of your campaign in most cases drastically depends on you. Design of your advertisement has a great impact on the involvement of users, their clicks and downloads. The promotion of your application depends on completeness of ad units and number of credits. To get credits you need to purchase them or integrate the SDK into advertised application. You should make sure from time to time that your app has enough credits. In any case, you will be notified by email about a required action or important event.