Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
WapStart Plus1 Android SDK
branch: master

This branch is 6 commits ahead, 145 commits behind WapStart:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
doc
examples/Bart
sdk
.gitignore
LICENSE
README-RUS.md
README.md
changelog.txt

README.md

Plus1 WapStart Android SDK

It is an open source library to use for integration with the Plus1 WapStart ad network.

Plus1 WapStart Android SDK is under the terms of the BSD license (as is).

Contents:

Setup Guide

  1. Download the latest SDK: https://github.com/WapStart/plus1-android-sdk/tags
  2. Add the SDK to your project to start working;
  3. Follow these steps to set up the manifest.

Manifest configuration

The application must have permissions to access the Internet and the current location for correct SDK working:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

ACCESS_FINE_LOCATION is optional but it is recommended for matching the relevant ads.

If your application is using geolocation, you can set the current location by yourself (see more - Plus1BannerRequest). It is recommended to turn off the automatic location detection in the SDK (method disableAutoDetectLocation() in Plus1BannerAsker).

You need to add the information about the used Activity to the block:

<application android:label="Bart" android:icon="@drawable/icon">
    <activity android:name="<app Activity name>" ... >
        ...
    </activity>

    <activity android:name="ru.wapstart.plus1.sdk.MraidBrowser" />
</application>

MraidBrowser is using for Rich Media.

Test application setup

For correct test app working you must transfer a Plus1 WapStart unique site identifier in the method setApplicationId() in the BartActivity.java file.

You can find the unique site identifier on the Код для площадки page after signing up for a Plus1 WapStart account and adding the Android application to the account.

SDK using

You can find the examples of the settings and configurations of banners in the Bart test application. The short explanations for a quick setup are given below.

Adding the banner to the application

Add Plus1BannerView into layout:

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
    <ru.wapstart.plus1.sdk.Plus1BannerView
            android:id="@+id/plus1BannerView"
            android:layout_width="320dp"
            android:layout_height="50dp"
            android:layout_gravity="top|center"
        />
</FrameLayout>

View is adapted to the 320x50 size. You should use these settings.

Turn on the necessary classes in the file of your Activity where you are planning to view the ads:

import ru.wapstart.plus1.sdk.Plus1BannerView;
import ru.wapstart.plus1.sdk.Plus1BannerRequest;
import ru.wapstart.plus1.sdk.Plus1BannerAsker;

On the initialization step, create and setup the objects Plus1BannerRequest and Plus1BannerAsker like it is provided below:

@Override
protected void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    ...

    mBannerView =
        (Plus1BannerView) findViewById(R.id.plus1BannerView);

    mAsker =
        new Plus1BannerAsker(
            new Plus1BannerRequest()
                .setApplicationId(...),
            mBannerView
                .enableAnimationFromTop()
                .enableCloseButton()
        )

}

You must set the unique identifier of your site in the setApplicationId() method. You can find it on the Код для площадки page after signing up for a Plus1 WapStart account and adding the Android application to the account.

Then it is necessary to provide the call of onResume() and onPause() handlers of the Plus1BannerAsker class:

@Override
protected void onResume() {
    super.onResume();

    ...

    mAsker.onResume();
}

@Override
protected void onPause() {
    super.onPause();

    ...

    mAsker.onPause();
}

For Rich Media banners you need to send the "Back" button event in Plus1BannerView.

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
    if ((keyCode == KeyEvent.KEYCODE_BACK) && mBannerView.canGoBack()) {
        mBannerView.goBack();
        return true;
    }

    return super.onKeyDown(keyCode, event);
}

You can find the detailed descriptions of the classes, interfaces and the source code below:

Contacts

If you have any questions, please, contact our client support:
E-Mail: clientsupport@co.wapstart.ru
ICQ: 553425962


We are always looking to improve our SDK to make things easier for you and all of our customers. You can help us if you have any comments or suggestions!

Something went wrong with that request. Please try again.