Git Product home page Git Product logo

chartboost-x's Introduction

Chartboost Icon ==> -X Icon

#ChartboostX A C++ wrapper of Chartboost for Cocos2d-X. Supports Android and iOS.

#Environment

  • ###Chartboost SDK

    • Android: v3.0.1
    • iOS: v3.1.1
  • ###cocos2d-x

    • cocos2d-x-2.0.3 or higher

#Example Project

  1. iOS: example/proj.ios/HelloChartboostX.xcodeproj
  2. Android: example/proj.android

You need to change the build script (such as build_native.sh) according to your own environment before compiling.

#Add to Your Own Project

iOS and Android will share the same ChartboostX.h header file. You need add Chartboost-x/ChartboostX.h to your Classes folder in the beginning.

iOS

All the following files you need in iOS are in Chartboost-x/ios fold.

  1. Add the previous ChartboostX.h to your Xcode project
  2. Add CBAnalytics.h, Chartboost.h, ChartboostX_ios.mm, libChartboost.a to your Xcode project
  3. Ensure you're linking with the following libraries:
    • SystemConfiguration.framework
    • CoreGraphics.framework
    • QuartzCore.framework
    • StoreKit.framework (weak-link)
    • AdSupport.framework (weak-link, needed in iOS 6)

Android

All the following files you need in Android are in Chartboost-x/android fold.

  1. Add the package com.wenbin.ChartboostX and its ChartboostXBridge.java to your Eclipse project. (You can just add the whole com fold to src fold in Eclipse project, and refresh in Eclipse)

  2. Add the ChartBoost.jar file as an external jar to your project. (You can just add the ChartBoost.jar file to libs fold in Eclipse project, and refresh in Eclipse)

  3. Add ChartboostX_android.cpp, ChartboostXJni.cpp and ChartboostXJni.h to your jni fold.

  4. Add ChartboostX_android.cpp, ChartboostXJni.cpp to your jni's Android.mk.

  5. In the java implementation of your main activity (which should have been created by the Cocos2d-X script), import com.wenbin.ChartboostX.*;

  6. At the beginning of onCreate(Bundle savedInstanceState), right after super.onCreate(savedInstanceState), add the following code:

     ChartboostXBridge.initChartboostXBridge(this);
    
  7. Add the following code to your main activity:

     @Override 
     protected void onResume()
     {
     	super.onResume();
     	ChartboostXBridge.initChartboostXBridge(this);
     }
    
  8. Add the following xml to your Android Manifest file:

    Add permission:

     <uses-permission android:name="android.permission.INTERNET" />
    

    Add activity:

     <activity android:name="com.chartboost.sdk.CBDialogActivity"
     	android:configChanges="orientation|keyboard|keyboardHidden"
     	android:windowSoftInputMode="adjustResize"
     	android:theme="@android:style/Theme.Translucent"
     	android:launchMode="singleTop" 
     	>
     </activity>
    

##Email: [email protected] ##Blog: http://geeksavetheworld.com

##You're welcome to contribute. ;-)

chartboost-x's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.