Skip to content

Initializing SDK

CMAdSDK edited this page Jun 20, 2016 · 15 revisions

Init SDK

Please initialize PEGASI SDK before you integrate advertisement, we highly recommend you call the onCreate method in Application class. For example:

/**
 * it is strongly recommended that custom Application
 * and initialized SDK in application#onCreate()
 */
public class MyApplication extends Application {

	@Override
	public void onCreate() {
        super.onCreate();
        //init sdk
        //The first parameter:Context
        //The second parameter: Mid(the identifier of the app,the first four numbers of posid)
        //The third parameter:product channel id(can be null)
        CMAdManager.applicationInit(Context, Your Mid, "");

        //if you want to print debug log ,set it
        //CMAdManager.enableLog();
	//if you access Interstitial and Banner ad you must set it 
	  /**
         * 	MyImageLoadListener() if you hava imageLoad module in local  the MyImageLoadListener is imageLoad  module
         *  if you don't hava imageLoad module in local please reference CMAdSDKdemo to add MyImageLoadListener
         *
         */
       // CMAdManagerFactory.setImageDownloadListener(new MyImageLoadListener());
    }
}

Clone this wiki locally