转载请注明出处:http://www.jb51.cc/article/p-omllqquw-dy.html
DEMO下载地址:http://download.csdn.net/detail/oyangyufu/7578451
在经过国内的几个广告平台尝试,最终选择芒果广告,有几个优点:SDK更新较快,支持cocos2d-x3.0,平台还聚合了国内主流广告平台,下载相应的SDK也可加载到工程中。
芒果横幅广告测试
1、将cocos2d-x项目导入到eclipse上
2、下载android SDK cocos2d-x 版本,网址:http://my.adsmogo.com/Apps/Download,下载完名称为:AdsMogo_Android_Cocos2d-x_Demo.zip
3、解压后将jar包放入libs目录下,单击右键->Build Path->Add to Build Path
- <uses-permissionandroid:name="android.permission.INTERNET"/>
- <uses-permissionandroid:name="android.permission.MODIFY_AUdio_SETTINGS"/>
- <uses-permissionandroid:name="android.permission.INTERNET"/>
- <uses-permissionandroid:name="android.permission.READ_EXTERNAL_STORAGE"/>
- <uses-permissionandroid:name="android.permission.READ_PHONE_STATE"/>
- <uses-permissionandroid:name="android.permission.ACCESS_COARSE_LOCATION"/>
- <uses-permissionandroid:name="android.permission.ACCESS_FINE_LOCATION"/>
- <uses-permissionandroid:name="android.permission.ACCESS_NETWORK_STATE"/>
- <uses-permissionandroid:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"/>
- <uses-permissionandroid:name="android.permission.CALL_PHONE"/>
- <uses-permissionandroid:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
- <uses-permissionandroid:name="android.permission.ACCESS_WIFI_STATE"/>
- <uses-permissionandroid:name="android.permission.CHANGE_WIFI_STATE"/>
- <uses-permissionandroid:name="android.permission.VIBRATE"/>
- <uses-permissionandroid:name="android.permission.RECORD_AUdio"/>
- <uses-permissionandroid:name="android.permission.GET_TASKS"/>
- <uses-permissionandroid:name="android.permission.CAMERA"/>
- <uses-permissionandroid:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
- <uses-permissionandroid:name="android.permission.CHANGE_CONFIGURATION"></uses-permission>
5、声明广告平台Activity, 代码到AndroidMainfest.xml文件中的application标签中