Coder Social home page Coder Social logo

xamarinandroid.adbuddiz's Introduction

#XamarinAndroid.AdBuddiz

##Instalation

Add the library

  1. Clone this repository
  2. Attach the XamarinAndroid.AdBuddiz.csproj to your solution
  3. Clean the solution and rebuild

###Permissions

The library already adds the permission INTERNET if it's not already added. The following permissions are optional, but without them, you might get less ads and tracking could be less accurate:

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

###Add the AdBuddizActivity to the AndroidManifest.xml of your App

<application ...>
 ...
 <activity android:name="com.purplebrain.adbuddiz.sdk.AdBuddizActivity" 
           android:theme="@android:style/Theme.Translucent" />
</application>

##Usage

###Configure & initialize SDK

Import the following namespace:

using XamarinAndroid.AdBuddiz;

You should request to cache ads as soon as your app starts. In the first created Activity of your app, add the following lines:

protected override void OnCreate(Bundle savedInstanceState)
{
  ...
  AdBuddiz.SetPublisherKey("TEST_PUBLISHER_KEY");
  AdBuddiz.CacheAds(this); // this = current Activity
}

###Test mode (Optional)

You can activate test mode by calling the following code before CacheAds() call:

AdBuddiz.SetTestModeActive();

Remove it before publishing to Google Play.

###Logs (Optional)

You can control the AdBuddiz SDK log level by calling the following code before CacheAds() call:

AdBuddiz.SetLogLevel(AdBuddizLogLevel.Info);    // or Error, Silent

###Show Ads

Whenever you want to display an ad, call ShowAd(). We recommend this call be made where there is a natural break in play like between levels for example.

AdBuddiz.ShowAd(this); // this = current Activity

###Request SDK Status (Optional)

To know if the SDK will be able to display an ad, you can call IsReadyToShowAd().

if (AdBuddiz.IsReadyToShowAd(this)) { // this = current Activity
  ...
}

###Delegate (Optional)

In order to get more information about the SDK behavior, you can register a delegate.

Example is pending...

xamarinandroid.adbuddiz's People

Contributors

eugenioestrada avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.