This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:orx:tutorials:setup_android [2015/05/31 04:48 (9 years ago)] – Changed to work with Android Studio sausage | en:tutorials:android:setup_android [2023/03/26 21:39 (12 months ago)] (current) – sausage | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | This guide is based on Android | + | <WRAP center round box 60%>This guide is based on Android |
- | The NDK used was slightly oldish compared | + | |
- | This guide needs to be evaluated with the latest NDK release. | + | |
- | ====== Compiling Orx and the Android Demo Project ====== | ||
- | To follow this guide, you must first ensure you have completed | + | ===== Compiling |
+ | **1. Compiling the Orx library for Android** | ||
- | **1. Compile | + | |
+ | | ||
- | cd < | + | For Linux or Mac use ''build.sh'' |
- | | + | |
- | | + | |
- | + | ||
- | For windows, | + | |
- | + | ||
- | <hidden Notes about ndk-build: what's it for?> | + | |
- | ndk-build compiles all of the orx c source code and links them into usable libraries. It compiles three versions: debug, profile and release. And compiles these three for two CPU types: ARM and x86. | + | |
- | The install batch copies the compiled libraries from the obj folder into the orx\code\lib\static\android folder ready for use by the demo project, or your own projects.</ | + | |
- | + | The compiled libraries will be located under '' | |
- | **2. Compile orxTest sample** | + | - orx-debug.aar |
+ | - orx-profile.aar | ||
+ | - orx-release.aar | ||
- | cd < | + | **2. Compiling |
- | | + | |
- | | + | |
- | + | ||
- | For windows, substitute | + | |
- | set NDK_MODULE_PATH=< | + | |
- | **3. Import | + | Compile the Demo which links in the static |
- | The purpose of this step is to optionally create an updated version of the Orx Library to be used by Demo Project, or your own project. | + | cd < |
+ | build.bat | ||
- | 1. Import an existing project into Android Studio | + | For Linux or Mac use '' |
- | 2. Browse to < | + | |
- | <hidden Errors | + | An APK file (one each for debug, profile |
- | 1. Android Studio may complain that the demo project is set to Gradle 0.14.0 in the build.gradle file. | + | |
- | | + | |
- | 2. It may also complain about " | + | You can copy this to your Android device to test. |
- | + | ||
- | If so, change the line in < | + | |
- | + | ||
- | | + | |
- | | + | |
- | + | ||
- | to: | + | |
- | | + | |
- | 3. You could receive an error: | ||
- | |||
- | | ||
- | |||
- | If so, remove the line: | ||
- | | ||
- | |||
- | For any fix, close project. Reopen project. | ||
- | </ | + | ===== General Troubleshooting ===== |
- | + | There are currently no tips here since our new process has been completely streamlined. Please get in touch on Discord if you experience issues so we can add them here. | |
- | |||
- | If no issues, the library will build automatically and can be found at: < | ||
- | |||
- | A precompiled orx-lib is included with the Demo Project. However, you can always take this one above you compiled yourself, and copy it over the existing one in the demo project at: < | ||
- | |||
- | **4. Import the Demo Project into Android Studio** | ||
- | Click " | + | If you have completed this tutorial and would like to try it with your own project, continue to [[en: |
- | | + | |
- | + | ||
- | + | ||
- | <hidden Errors and Troubleshooting> | + | |
- | 1. Android Studio may complain that the demo project is set to Gradle 0.14.0 in the build.gradle file. | + | |
- | | + | |
- | + | ||
- | 2. It may also complain about " | + | |
- | + | ||
- | If so, change the line in < | + | |
- | + | ||
- | | + | |
- | | + | |
- | + | ||
- | to: | + | |
- | | + | |
- | + | ||
- | For any fix, close project. Reopen project. | + | |
- | + | ||
- | </ | + | |
- | + | ||
- | After a successful project load, it will build files automatically at: < | + | |
- | + | ||
- | Then finally, turn those files into a working APK by selecting Run App. Cancel any Emulator window that opens. An APK or two will be generated at: < | + | |
- | + | ||
- | Now you can copy this APK to your Android device and run the demo. | + | |
- | + | ||
- | < | + | |
- | + | ||
- | If you receive the following error: | + | |
- | * [OrxTest] Unable to resolve target ' | + | |
- | + | ||
- | You don't have the required android SDK (API 19) that the orx Demo is set to. Use the SDK Manager (Tools/ | + | |
- | + | ||
- | </ | + | |
- | + | ||
- | + | ||
- | If you have completed this tutorial and would like to try it with your own project, continue to [[: | + | |