Cocos2d-x Android Start Guide
This guide explains how to install Geniee Ads SDK to Cocos2dx-Android application.
How to install:
- Download Cocos2dx Geniee SDK
- Download Android Geniee SDK
- Put jar-library
- Write Manifest file
Download Geniee SDK
Download Geniee Cocos2dx SDK from following URL
Download Geniee Android SDK from following URL
Put jar-library
Unzip Geniee Android SDK
Add Ads-SDK to project
- If it does not exit in proj.android-studio/app/libs/ folder, you have to create it
- Copy GenieeAdsSDK / jar flies to libs folder.
GNAdSDK-8.5.1.jar
- Add to
app/build.gradle
in 'dependencies'.compile files('libs/GNAdSDK-8.5.1.jar')
- Check to add 'Project Structure' in 'Dependencies'.
- Add Google Play Services SDK to project
If Google Play Services SDK is already installed, No need to add.
How to add1 (Recommended)
- Google Developers Official WebSite Setting Up Google Play Services
- Add to
app/build.gradle
in 'dependencies'.compile 'com.google.android.gms:play-services-ads:8.1.0'
- Check you have been added in 'Dependencies' of 'Project Structure'.
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
compile 'com.google.android.gms:play-services-ads:8.1.0'
compile files('libs/GNAdSDK-8.5.1.jar')
}
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
Coding Manifest file
Code information is needed to show file AndroidManifest.xml.
- Coding SDK use Google Play Services SDK's information
- Code Manifest file's
<application>
.
- Code Manifest file's
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version"/>
1
2
3
2
3
- Coding SDK use internet permissions
<uses-permission android:name="android.permission.INTERNET"/>
1
2
2
- Coding SDK use Network Connection Status permissions.
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
1
2
2
- Coding SDK use Google Play Services SDK permissions.
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
1
2
2
- Coding SDK use to get location information permission. (optional)
- It is no problem coding either "ACCESS_COARSE_LOCATION" and "ACCESS_FINE_LOCATION"
- If you don't use location information, no need to coding.
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
1
2
3
2
3