proton:android_setup
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
proton:android_setup [2012/05/23 08:50] – seth | proton:android_setup [2017/05/22 08:33] (current) – seth | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | Before going in to compilation details check [[proton: | ||
+ | |||
====Compiling for Android from Windows==== | ====Compiling for Android from Windows==== | ||
- | **NEW: | + | |
+ | ** NOTE: ** 5/ | ||
+ | |||
+ | **NOTE: | ||
Originally the Android platform was crippled by requiring all " | Originally the Android platform was crippled by requiring all " | ||
Line 18: | Line 23: | ||
The C++ " | The C++ " | ||
- | ** Side Note **: There is actually an even newer way to do NDK now - something called a NativeActivity where you can use 100% C++. Except you can't, because things like IAP and Tapjoy integration would still be in Java so I assume more ugly bridging would be required.. also it requires Android 2.3+ (boo, hiss), but I plan to do an android target supporting this eventually, especially since it seems to be the only way to fully support the xperia play gamepad controls. -Seth | + | ** Side Note **: There is actually an even newer way to do NDK now - something called a NativeActivity where you can use 100% C++. Except you can't, because things like IAP and Tapjoy integration would still be in Java so I assume more ugly bridging would be required.. also it requires Android 2.3+, but I plan to do an android target supporting this eventually, especially since it seems to be the only way to fully support the xperia play analog sticks. -Seth |
====Prerequisites==== | ====Prerequisites==== | ||
Line 33: | Line 38: | ||
Important note: For all this stuff, try to choose a custom install path WITHOUT spaces in it. There, I just saved you like 40 minutes of diagnosing vague errors that will happen later. | Important note: For all this stuff, try to choose a custom install path WITHOUT spaces in it. There, I just saved you like 40 minutes of diagnosing vague errors that will happen later. | ||
- | * Install the [[http:// | + | * Install the [[http:// |
- | * Add **C: | + | * Add **C: |
- | * Add **C: | + | * Add **C: |
- | If you type " | + | If you type " |
Here is how I setup my AVD (note my naming format.. helps later to remember which AVD is which version) | Here is how I setup my AVD (note my naming format.. helps later to remember which AVD is which version) | ||
Line 64: | Line 69: | ||
* In Settings-> | * In Settings-> | ||
* After plugging in your phone, in the Win device manager it will probably say "no drivers installed" | * After plugging in your phone, in the Win device manager it will probably say "no drivers installed" | ||
- | * Typing "abd devices" | + | * Typing "adb devices" |
Line 79: | Line 84: | ||
First, mentally throw away Eclipse if you were using it for testing - you'll never need it again. | First, mentally throw away Eclipse if you were using it for testing - you'll never need it again. | ||
- | * Install [[http:// | + | * Install [[http:// |
- | * Add the ant directory to your windows path. Verify it's working by typing " | + | * Add the ant directory to your windows path. Verify it's working by typing " |
* Download the [[http:// | * Download the [[http:// | ||
* Make sure that the environmental variable ANT_HOME exists and is set to your ant path. (ie, c:\pro\ant) | * Make sure that the environmental variable ANT_HOME exists and is set to your ant path. (ie, c:\pro\ant) | ||
- | **Note**: The NDK version should be r7c (latest at the time this was written) or later. | + | **Note**: The NDK version should be r8 (latest at the time this was written) or later. |
| | ||
Ant is a command line utility that will do the Android packaging for us after the .so binary is built. | Ant is a command line utility that will do the Android packaging for us after the .so binary is built. | ||
- | Annoying | + | More annoying |
* Add your android ndk dir to the windows path | * Add your android ndk dir to the windows path | ||
- | * Edit RTBareBones/ | ||
====Finally, | ====Finally, | ||
Line 104: | Line 108: | ||
* build.bat uses InstallOnDefaultPhone.bat which installs it to whatever device is plugged in, as long as only one device exists, it works. | * build.bat uses InstallOnDefaultPhone.bat which installs it to whatever device is plugged in, as long as only one device exists, it works. | ||
* If any headers change, you may want to use Clean.bat to make sure make notices that they changed correctly. | * If any headers change, you may want to use Clean.bat to make sure make notices that they changed correctly. | ||
+ | * Use buildRelease.bat to make the final, signed version to upload to the android store. | ||
Run ViewLogDefaultPhone.bat to see the debug output. (As long as only one device is plugged in/active, it will work, be it the emulator or a real device) | Run ViewLogDefaultPhone.bat to see the debug output. (As long as only one device is plugged in/active, it will work, be it the emulator or a real device) | ||
====Customize the .mak==== | ====Customize the .mak==== | ||
- | If you need to add/remove source files to the project, manually edit RTBareBones/ | + | If you need to add/remove source files to the project, manually edit RTBareBones/android/ |
Also, if you're having trouble, it's a good idea to enable debug mode compiling. | Also, if you're having trouble, it's a good idea to enable debug mode compiling. | ||
Line 135: | Line 140: | ||
Don't forget to change it back later. | Don't forget to change it back later. | ||
- | Note: The above is sort of outdated and instead of LOCAL_CFLAGS/ | + | Note: The above may be outdated |
The only app specific .java file is located in / | The only app specific .java file is located in / | ||
Line 146: | Line 151: | ||
* Want to clone one of the example apps to be the starting place of a new app? Then read the tutorial on [[: | * Want to clone one of the example apps to be the starting place of a new app? Then read the tutorial on [[: | ||
* Want to compile faster? | * Want to compile faster? | ||
- | |||
- | ====V2 Android setup==== | ||
- | If you look at android/ | ||
- | |||
- | The preprocessor allows #define and #ifdef stuff to work in java, and also replaces the package name with your own. It also runs on AndroidApp.cpp and modifies the JNI bindings to match the package name. | ||
- | |||
- | When you're done building, you can see what it changed by looking in the temp directories android/ | ||
- | |||
- | build_prepare.bat also also where it copies any required 3rd party sources/ | ||
- | |||
- | Most examples use the new V2 android setup, but a few older ones don' |
proton/android_setup.1337763029.txt.gz · Last modified: 2012/05/23 08:50 by seth