Saying that I wrote this article on the building packaging Android environment, is not a bit premature (in fact, I am mainly afraid of reloading the system later, forget how to build), but sooner or later to face the pain, has been postponed is not a way, right.
In the official documentation, for the package Android APK, it is clear that I write this, but add a picture, the introduction of more detailed.
Build packaged Android environment, need a lot of installation of a lot of things, I directly to my use of all the packaging to the network disk, the need for friends, to the network disk download on the line
Integrated Package network disk: http://pan.baidu.com/s/1hquz7fe Password: R2NQ
First, build an Android environment I created an Android folder under my G-packing directory, storing ant ADK ndk open G:\Android\adk\eclipse below the Eclipse.exe, we started to set up Eclipse actually can also develop C + +, as long as we install the CDT, we first install the CDT, online there are many ways, I picked a simple direct method, directly in Eclipse download installation. Select Install New software name:cdt : http://download.eclipse.org/tools/cdt/releases/ kepler Click OK, the interface appears two options, select the first one can direct next, install on the line below to enter the Settings section set the SDK address Here is the NDK settings, in the package I gave, set the option inside without NDK, we will copy the Com.android.ide.eclipse.ndk_23.0.2.1259578.jar to G:\Android\adk\eclipse\ Plugins below, restart Eclipse, go to Settings to see NDK options Click OK, complete settings As for the ant I provided, the setup.py inside the COCOS2DX is set, I'm not using it in quick. here are the environment variables that are required by the official documentation, so that the bat file in our project can be used I'll copy the content directly.
-
Under Windows, add the following environment variables in the system settings:
ANDROID_NDK_ROOT=NDK absolute path android_sdk_root= SDK absolute path android_home=%android_sdk_root%
For example:
android_ndk_root=c:\ work\android-ndk-r9dandroid_sdk_root=c:\work\android-sdkandroid_home=%android_sdk_root%
By the way, add a java_home variable with the value of the JDK installation address, my value is C:\Program files\java\jdk1.6.0_43 two, load the project file, start trying to package our new quick project, Anysdktest I go into G:\quick-3.3rc1\quick\samples\anysdk and copy all of the contents into the new project, replace We import the Quick Java project in eclipse Click Browse, select the Android project under the Quick directory, my directory is g:\quick-3.3rc1\cocos\platform\android\java OK Project list There are Java projects below to import our Anysdktest project, the same operation, my path is G:\quickLuaProject\anysdktest\frameworks\ runtime-src\proj.android determine the Finish,ok we have just imported into the project, we will find that our project has a red fork, right-click on the project file entry settings, you will find the library inside the Thing Red Fork, We use the imported Java add then remove the Big Red Fork, OK, complete in the quick document mentioned, with Build_native.bat compiled C + + code for so file, At first I did not pay attention to this, run directly in Eclipse, the APK has not run up, search the error message, only to find that I did not pack so files, resulting in my apk is wrong. Go to project g:\quickluaproject\anysdktest\frameworks\runtime-src\proj.android\build_apk.bat run this bat, will see is compiling information, for a period of time, I first go to other things, and so he finished good, packaging completed, we entered the G:\quickLuaProject\anysdktest\frameworks\ Runtime-src\proj.android\libs\armeabi, see there's a libcocos2dlua.so underneath. We have the RES and SRC foldersInto the Assert folder, replace the original folder and file into eclipse, insert Android device, select Run->run, choose android Program, OK, do the real machine debugging (remember to hook the Android device developer options) Android device successfully run packaged Apk ho, this article concludes, as for the selection of Android system, in the Windows->android SDK Manager to download if the download, In Tools Select option, tick the box to choose the picture, if still download, Agent FQ, Baidu tutorial a lot
Quick Cocos2dx-lua (V3.3R1) Learning notes (10)-----Build an Android packaging environment, create an APK run with the official sample ANYSDK