Git Product home page Git Product logo

moa-android-jdk's Introduction

MOA-Android-Sdk

MOA Android SDK to tap into MOA Ad Network.

Register at Myanmar Online Advertising as Publisher to get the ad unit code

https://moa.com.mm/register

How to Add library

  1. Download moaadssdk.arr and place it under the libs folder
  2. add the following code to project build.gradle file
  flatDir {
    dirs 'libs'
  }
  1. add the following code in Application build.gradle and sync with gradle
 compile(name: 'moaadssdk', ext: 'aar')
 compile 'com.squareup.moshi:moshi:1.5.0'
 compile 'com.squareup.okhttp3:okhttp:3.8.0'

Usage for Banner Ads and FullScreen Ads

adsUnitId need to replace with Ads Unit ID from your publisher project at www.moa.com.mm

 <com.zeta.moaadssdk.Views.MoaAdsView
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:id="@+id/moa_ads_container"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:gravity="center_vertical|center_horizontal|center"
      app:adsUnitId="aid_xxxxxxxxxxxxxx"
  />

Fullscreen Ads can be implemented as the following: adsUnitId need to replace with FullScreen Ads Unit ID from your publisher project at www.moa.com.mm

   int showPerTime =2;
   MoaAds moaAds = new MoaAds(this);
   moaAds.initFullScreenAds(showPerTime, "fid_xxxxxxxxxxxxx");

with the above example Fullscreen ad will be shown whenever user enters the app the second time.

Ads Listeners for MoaAdsView

You can also listen to Ads request status with MoaAdListener as the following int code is Http Status code, 400 means error and 204 means rate limited.

moaAdsView.addAdsListener(new MoaAdsView.MoaAdListener() {
    @Override public void onAdsLoaded(int code) {
      //create your own logic
    }

    @Override public void onAdsFailed(int code) {
      //create your own logic
    }
  });

MoaAdsView with RecyclerView

You can also use MoaAdsView with the RecyclerView as the following,

  PeopleAdapter mPeopleAdapter = new PeopleAdapter();
  mPeopleAdapter.setItems(mList);
  MoaAdsAdapter moaAdsAdapter = new MoaAdsAdapter(mPeopleAdapter, this, "aid_xxxxxxxxx");
  mRecyclerView.setAdapter(moaAdsAdapter);

adsUnitId needs to replace with Ads Unit ID from your publisher project at www.moa.com.mm

Example Projects

MoaAds Example

Help

Report a bug by creating an issue on our github repo.

Also contact us if you have any difficulties implementing our ad jdk.

MOA - The ad network that helps you earn more while you focus on creating better contents.

moa-android-jdk's People

Contributors

indexer avatar moeseth avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.