Continued: Recently finally freed up time to talkingdata the Cocos version of a good toss, always feel that the previous versions in the integration are very lame. To the vast number of developers with a lot of trouble ... "The game is anxious to go online, which there is time to look closely talkingdatasdk integration details?!, Best can let me the simplest, most convenient to use!!!" presumably this is the vast number of game development of the students ' voice it ...
OK ~ keep you waiting, the simplest way to integrate is finally coming ... How simple is it?! Beijing dialect "Look good son you inside"
First, download the latest version of the SDK on TalkingData's official website. Walk-up
Second, open the downloaded package (with LUA-related, using documents, sample and Talkingdatagameanalytics)
Third, copy the entire Talkingdatagameanalytics folder and folder files.
1. Copy the entire folder in the cocos2dx-2.x version to the Cocos library referenced by your project [Cocos2dx_root]/cocos2dx/platform/third_party/android/source below.
2, in the cocos2dx-3.x version of the folder copy to the Cocos library referenced by your project [cocos2dx_root]/external below.
Taking cocos2dx-3.2 as an example,
Four, simple modification configuration file.
1, ios{
1) Open the creation of a good game project.
2) Add a reference to the TalkingData library that you just copied ([cocos2dx_root]/external/talkingdatagameanalytics/).
3) Add dependent libraries,
4) Call in Classes/appdelegate.cpp's applicationdidfinishlaunching ()
Tdcctalkingdataga::onstart ("Your AppID", "channel");
5) Simple integration complete, more advanced features or see the official documents it.
}
2, android{
1) Play the game project you just created with eclipse.
2) Copy the Talkingdatagameanalytics/andorid/game_analytics_sdk_android_xxx.jar to the Libs directory.
3) Modify Jni/main.cpp, add header file # include "TDGAJniHelper.h"
Note in the cocos2.x version, add the TDGAJNIHELPER::SETJAVAVM (VM) in the Jni_onload () method;
Add TDGAJNIHELPER::SETJAVAVM (VM) to the Cocos_android_app_init () method in the cocos3.x version;
4) Modify the Jni/android.mk file. {
Add Local_whole_static_libraries + = Cocos2dx-talkingdata after local_whole_static_libraries: = Cocos2dx_static.
At $ (call Import-module,.) Add a $ (call import-module,talkingdatagameanalytics/android) later.
}
5) Add the necessary permissions in the Androidmanifext.xml
<uses-permission android:name= "Android.permission.INTERNET"/>
<uses-permission android:name= "Android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name= "Android.permission.READ_PHONE_STATE"/>
<uses-permission android:name= "Android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name= "Android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name= "Android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name= "Android.permission.VIBRATE"/>
6) called in Appactivity.java's OnCreate ()
Talkingdataga.init (This.getapplicationcontext (), "2e9d3a639c5ba2677dd652e02febc489", "TalkingData");
7) Compile and run.
}
TalkingData COCOS2DX Integration Guide "latest"