Skip to content

Getting Started

liuluchao edited this page Jul 5, 2016 · 28 revisions

This document details the process of integrating the PEGASI SDK with your Android application .

Here are the basic integration steps:

1.Obtain the PEGASI SDK source from github(Download PEGASI SDK)

2.Add our SDK(and dependencies) to your project.

3.Create ad units in your app.

##1、simple introduction Pegasi SDK includes NativeAd (the NativeAd you can choose only cm ad or choose cm and anyone ad from facebook,yahoo,mopub and admob), Native BannerAd and InterstitailAd .

##2、Download the PEGASI Android SDK You can visit https://github.com/CMAdSDK/android_sdk and download the PEGASI Android SDK . The zip package includes document,demo,adapter and apk .

Note:please do not download aar by right click the link

##3、Requirements Android 2.3.1(API Version 9) and up

##4、Adding as Compiled .aar Copy .aar file to libs of project,add code to Gradle script. Open your project's build.gradle file and add the below lines :

repositories {
flatDir {
      dirs 'libs'
    }
}

dependencies {
	compile(name: 'cmadsdk_world_base_V3.4.7', ext: 'aar')
}

##5、Updating your Android Manifest Your AndroidManifest.xml will need to be updated in order to complete the SDK integration. Add the following permissions and activity declarations according to the bundle you are integrating. ####5.1、Declare the following permissions:

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

**Note:**The INTERNET permission is required which is used to access the internet to get ad. The ACCESS_NETWORK_STATE or ACCESS_WIFI_STATE permission are optional which used for checking whether there is avaible Internet connection(suggest configure them).

#####5.2、Important Notes

  • If you're compiling against APIs below 13, you should exclude screenSize from the manifest entries.
  • Make sure the com.mopub.mobileads.MraidVideoPlayerActivity is added to your manifest. Without it, video ads will not work correctly.

##Proguard Script ####5.3、Add the following script in your proguard script:

-dontwarn com.cmcm.adsdk.**
-dontwarn com.cleanmaster.**
-keep class  com.cmcm.adsdk.** { *;}
-keep class  com.cleanmaster.** { *;}

##6、Pegasi mediation others Ads

pegasi asdk mediation ohters ads you can reference([Pegasi mediation others ads](https://github.com/CMAdSDK/android_sdk/wiki/Pegasi mediation others ads))

##7、Others mediation pegasi Ads

others sdk mediation pegasi ads you can reference (Other mediation pegias ads)

##8、Displaying Ads Once you've completed the above steps, you can start displaying ads in your application by following the simple instructions on the Native Ad , the Banner Ad or Interstitial Ad pages.

Clone this wiki locally