Cocos2d-x Android Start Guide

This guide explains how to install Geniee Ads SDK to Cocos2dx-Android application.

How to install:

  1. Download Cocos2dx Geniee SDK
  2. Download Android Geniee SDK
  3. Put jar-library
  4. Write Manifest file

Download Geniee SDK

Download Geniee Cocos2dx SDK from following URL

Download Geniee Android SDK from following URL

Put jar-library

  1. Unzip Geniee Android SDK

  2. 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'.
  1. 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'.
      image
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

image

Coding Manifest file

Code information is needed to show file AndroidManifest.xml.

  1. Coding SDK use Google Play Services SDK's information
    • Code Manifest file's <application>.
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version"/>
1
2
3
  1. Coding SDK use internet permissions
<uses-permission android:name="android.permission.INTERNET"/>
1
2
  1. Coding SDK use Network Connection Status permissions.
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
1
2
  1. Coding SDK use Google Play Services SDK permissions.
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
1
2
  1. 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
Last Updated: 4/12/2019, 8:52:28 AM