Let Xgsdkcocos2d_demo run up in eclipse

Source: Internet
Author: User

Jin Shan's second need to record the task is to let Xgsdkcocos2d_demo run in Eclipse, Xgsdkcocos2d_demo is the predecessors have written a simple cocos2d game (simple to menu) and already in the game code , access to some of the xgsdk necessary interface (login, logout, payment, User Center, switch account, exit). One of the functions of the demo is to test the access of the God channel (the so-called Test Master pack), the God Channel is an artificial channel SDK, which is provided to the game developer to verify that it accesses the interface required by the XGSDK. My task is to perfect God's channel, from which I learned the XGSDK running process and the callback process. Let's start by documenting how to get Xgsdkcocos2d_demo to run in Eclipse.

1. Download the development project Xgsdk-common-lib,goddemo-sdk,xgsdk-cocos2dx.zip as follows:

2. Open the Eclipse,import three items:

Modify the properties of these three projects for Android project Build target for Android 5.1.1

Right click on Project->properties->android->library add two library projects:

Then the Hellocpp project will be automatically compiled, it takes a long time (later to solve, in fact, it can not be compiled so early, you can finally compile):

3. Add the god Channel, divided into two pieces, the first one is the Export God Channel Jar package, and then introduce the God Channel Jar package in Hellocpp.

The SRC right-click Export in the GODDEMO-SDK project has a JAR export format under Java,

Select the option in the export to the appropriate location, my location is D:\XGSDK\xgsdk_godchannel_new.jar:

After exporting, delete the Xgsdk-plugin-1.3.jar file that was originally under Libs, and copy the exported Xgsdk_godchannel_new.jar to the Libs folder of the Hellocpp project:

4. Copy the picture and layout files under the GODDEMO-SDK Res folder to the Hellocpp Res folder:

and delete the Hellocpp Project src folder under the two package, do not delete the words will and Xgsdk-common-lib conflict:

5. Copy the content from Androidmanifest.xml under the GODDEMO-SDK project to modify the Androidmanifest.xml file under the Hellocpp project to add the corresponding <uses-permission> tags and <activity> Tags:

    <uses-permission android:name= "Android.permission.READ_PHONE_STATE"/> <uses-permission android:name= "and Roid.permission.ACCESS_NETWORK_STATE "/> <uses-permission android:name=" android.permission.ACCESS_WIFI_ State "/> <uses-permission android:name=" Android.permission.ACCESS_FINE_LOCATION "/> <uses-permission an Droid:name= "Android.permission.CHANGE_WIFI_STATE"/> <uses-permission android:name= "android.permission.GET_ TASKS "/> <uses-permission android:name=" Android.permission.INTERNET "/> <uses-permission android:name=" Android.permission.MOUNT_UNMOUNT_FILESYSTEMS "/> <uses-permission android:name=" android.permission.RESTART_  PACKAGES "/> <uses-permission android:name=" Android.permission.SYSTEM_ALERT_WINDOW "/> <uses-permission Android:name= "Android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name= " Android.permission.INTERNET "/> <uses-permission Android:namE= "Android.permission.READ_PHONE_STATE"/> <uses-permission android:name= "Android.permission.WRITE_EXTERNAL _storage "/> <uses-permission android:name=" Android.permission.ACCESS_COARSE_LOCATION "/>

  and the corresponding <activity> tags:

<activity android:name= "com.seasun.example.test.DataActivity" Android:theme= "@android: style/theme.translucent "> <intent-filter> <action android:name=" Android.intent.action.VIEW "/> <category Android Oid:name= "Android.intent.category.LAUNCHER"/> </intent-filter></activity><!--video playback-->< Activity android:name= "Com.seasun.example.test.VideoSurfaceDemo" Android:theme= "@android: style/theme.translucent "> <intent-filter> <action android:name=" Android.intent.action.VIEW "/> <category Android Oid:name= "Android.intent.category.LAUNCHER"/> </intent-filter></activity><activity android: Name= "com.seasun.example.test.VideoViewActivity" Android:theme= "@android: Style/theme.translucent" > < intent-filter> <action android:name= "Android.intent.action.VIEW"/> <category android:name= "Android Oid.intent.category.LAUNCHER "/> </intent-filTer></activity><activity android:name= "COM.EXAMPLE.GODDEMO_SDK. Goddemomainactivity "android:label=" @string/app_name "> <intent-filter> <action android:name=" and Roid.intent.action.VIEW "/> <category android:name=" Android.intent.category.LAUNCHER "/> </intent-fi Lter></activity><activity android:name= "COM.EXAMPLE.GODDEMO_SDK. Godpayactivity "android:label=" @string/app_name "> <intent-filter> <action android:name=" Android. Intent.action.VIEW "/> <category android:name=" Android.intent.category.LAUNCHER "/> </intent-filter& Gt;</activity>

6. Tick the IS library check box in the properties of the right-click Xgsdk-common-lib Project:

Then right-xgsdk-common-lib the project point build projects so that hellocpp can reference the xgsdk-common-lib that has been build well.

Finally, in the Hellocpp project right-click Run as,android application, start compiling hellocpp demo. can be run successfully ~ ~.

Let Xgsdkcocos2d_demo run up in eclipse

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.