Create an android project under vs, see the article "Environment deployment of cocos2d-x V2.14 and later versions"
Import the project you just created with eclipse, project path: E: \ cocos2d-x-2.2.2 \ cocos2d-x-2.2.2 \ projects \ WjHelloWorld \ proj. android
Copy the org package under the cocos2d directory \ cocos2dx \ platform \ android \ java \ src to the src directory of the android project.
Copy and generate resources under the project path/Resource Directory to the assets under the android project directory.
E: \ cocos2d-x-2.2.2 \ cocos2d-x-2.2.2 \ projects \ WjHelloWorld \ Resources ------> E: \ cocos2d-x-2.2.2 \ cocos2d-x-2.2.2 \ projects \ WjHelloWorld \ proj. android \ assets
Download NDK, said to download 8C version and above, http://developer.android.com/tools/sdk/ndk/index.html
Right-click an android project and choose Properties C/C ++ Build. Create a Configuration in the first line.
Set the new Configuration to the project activation status
NDK path config Build command ------> E: \ android-ndk-r9c \ ndk-build.cmd
Configure Build directory ------ >$ {ProjDirPath}
Expand C/C ++ Build and find Environment add settings NDK_MODULE_PATH ------> E: \ cocos2d-x-2.2.2 \ cocos2d-x-2.2.2 \ cocos2dx \ platform \ third_party \ android \ prebuilt
In the jni folder of the Android project, locate Android. mk and edit it. Add the following content under include $ (BUILD_SHARED_LIBRARY ):
$ (Call import-add-path, E:/cocos2d-x-2.2.2/cocos2d-x-2.2.2)
$ (Call import-add-path, E:/cocos2d-x-2.2.2/cocos2d-x-2.2.2/cocos2dx/platform/third_party/android \ prebuilt)
If you are running on a virtual machine, select Use Host GPU when setting the Device on the Virtual Machine. Otherwise, an error will be reported on the virtual machine after running.
Effect:
In addition, there are two methods to create cocos2d in.
Method 1:
Run in DOS: python create_project.py-project WjHelloWorld-package com. lvchuang. test-language cpp // Where Test is the project name, com. jacky. test is the package name
Method 2:
@ Echo off
Set/p projectName = enter the Project name:
If "% projectName %" = "" goto inputError
Set/p packageName = enter the package name:
If "% packageName %" = "" goto inputError
Create_project.py-project % projectName %-package % packageName %-language cpp
Pause
Exit
: InputError
@ Echo project name or package name cannot be blank!
Pause