项目作者: MyanmarOnlineAdvertising

项目描述 :
MOA Android SDK to tap into MOA Ad Network.
高级语言:
项目地址: git://github.com/MyanmarOnlineAdvertising/moa-android-jdk.git
创建时间: 2017-05-31T17:20:24Z
项目社区:https://github.com/MyanmarOnlineAdvertising/moa-android-jdk

开源协议:Apache License 2.0

下载


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
    1. flatDir {
    2. dirs 'libs'
    3. }
  3. add the following code in Application build.gradle and sync with gradle

    1. compile(name: 'moaadssdk', ext: 'aar')
    2. compile 'com.squareup.moshi:moshi:1.5.0'
    3. 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

    1. <com.zeta.moaadssdk.Views.MoaAdsView
    2. xmlns:android="http://schemas.android.com/apk/res/android"
    3. xmlns:app="http://schemas.android.com/apk/res-auto"
    4. android:id="@+id/moa_ads_container"
    5. android:layout_width="wrap_content"
    6. android:layout_height="wrap_content"
    7. android:gravity="center_vertical|center_horizontal|center"
    8. app:adsUnitId="aid_xxxxxxxxxxxxxx"
    9. ></com.zeta.moaadssdk.Views.MoaAdsView>

    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

    1. int showPerTime =2;
    2. MoaAds moaAds = new MoaAds(this);
    3. 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.

    1. moaAdsView.addAdsListener(new MoaAdsView.MoaAdListener() {
    2. @Override public void onAdsLoaded(int code) {
    3. //create your own logic
    4. }
    5. @Override public void onAdsFailed(int code) {
    6. //create your own logic
    7. }
    8. });

    MoaAdsView with RecyclerView

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

    1. PeopleAdapter mPeopleAdapter = new PeopleAdapter();
    2. mPeopleAdapter.setItems(mList);
    3. MoaAdsAdapter moaAdsAdapter = new MoaAdsAdapter(mPeopleAdapter, this, "aid_xxxxxxxxx");
    4. 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.