Skip to content

Getting Started

CMAdSDK edited this page May 18, 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.

simple introduction

Our SDK includes juhe_V3.4_base_world and juhe_V3.4_ext_world , the base package(juhe_V3.4_base_world) only include the Orion(cheetah mobile) source of Ad ,but the extend package(juhe_V3.4_ext_world) not only include the Orion(cheetah mobile) source of Ad but also include facebook , Mopub , Yahoo ,Admob etc third-party source of Ad. So , you can choose the sdk which you need to intergrate . The advertising style includes NativeAd , Native BannerAd and InterstitailAd .

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 and demo .

Requirements

Android 2.3.1(API Version 9) and up

Adding as Compiled .aar

Copy .arr file to libs of project,add code to Gradle script. Open your project's build.gradle file and add the below lines :

1.PEGASI SDK World Base Version

repositories { flatDir { dirs 'libs' } }

dependencies { compile(name: 'cmadsdk_world_base_V3.4.1', ext: 'aar') } 2.PEGASI SDK World Ext Version

repositories { flatDir { dirs 'libs' } }

dependencies { compile(name: 'cmadsdk_world_ext_V3.4.1', ext: 'aar') //notice:integration Admob need to add these aar compile(name: 'play-services-ads-7.8.0', ext: 'aar') compile(name: 'play-services-analytics-7.8.0', ext: 'aar') compile(name: 'play-services-base-7.8.0', ext: 'aar') } 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.

1.PEGASI SDK World Base Version

Declare the following permissions:

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

2.PEGASI SDK World Ext Version

2.1、Declare the following permissions:

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

2.2、Configure other information:

if you integrated Mopub , Please declare the following activities:

Add this tag to your to use Google Play Services:

2.3、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. 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