This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:tutorials:android:setup_android [2023/03/19 03:23 (2 years ago)] – sausage | en:tutorials:android:setup_android [2023/03/26 21:39 (2 years ago)] (current) – sausage | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | <WRAP center round box 60%>This guide is based on Android Studio Electric Eel (which ships with SDK 33) and NDK version 23.2.8568313. If you need to set up a development environment for Android, you must first ensure you have completed the [[en: | + | <WRAP center round box 60%>This guide is based on Android Studio Electric Eel (which ships with SDK 33). If you need to set up a development environment for Android, you must first ensure you have completed the [[en: |
- | |||
- | ===== Setting up the NDK version inside the Orx library Project ===== | ||
- | |||
- | You need to specify what version of NDK you have. Version '' | ||
- | |||
- | Confirm your version by visiting your drive at: Locate NDK version at '' | ||
- | |||
- | Add this version to your '' | ||
- | |||
- | ndkVersion " | ||
===== Compiling the Orx Library and the Android Demo Project ===== | ===== Compiling the Orx Library and the Android Demo Project ===== | ||
Line 18: | Line 8: | ||
cd orx/ | cd orx/ | ||
| | ||
- | + | ||
For Linux or Mac use '' | For Linux or Mac use '' | ||
Line 27: | Line 17: | ||
- orx-release.aar | - orx-release.aar | ||
- | **2. Compiling the Android Demo Native Code** | + | **2. Compiling the Android Demo** |
- | This section is still in the process of being re-written. | + | Compile the Demo which links in the static Orx library that we prepared in step 1: |
- | Let's compile the native | + | cd < |
+ | | ||
- | cd < | + | For Linux or Mac use '' |
- | ndk-build | + | |
- | This step creates the native library | + | An APK file (one each for debug, profile and release) be created are available at: '' |
- | Creating a native library is only half the story, and will provide only a shared library (.so). This library and assets still need to be packaged for use on a device. | + | You can copy this to your Android |
- | That's what Android Studio (and Gradle: it's build system) are used for. | ||
- | |||
- | |||
- | |||
- | |||
- | **3. Building the Android Demo in Android Studio** | ||
- | |||
- | Now that we have the shared library of the demo, we need to build it in Android Studio. What really happens at the step? | ||
- | |||
- | Android Studio (using Gradle) will take the shared library and wrap some java code around it so that the application can be executed. Everything will be packaged up. | ||
- | |||
- | - Open Android Studio | ||
- | - Load in the demo by selecting the orx/ | ||
- | - Gradle inside Android Studio will begin building automatically. | ||
- | - If there are no setup issues, the build will complete. | ||
- | - You can test the build on a real Android device or the emulator by selecting the Run / Run ' | ||
- | - When running this step, an APK file be created and deployed to your device. | ||
- | |||
- | You can also create an APK at any time and copy this to your Android device as well. | ||
- | \\ | ||
===== General Troubleshooting ===== | ===== General Troubleshooting ===== | ||
- | **Tip:** If you receive the following error: | + | There are currently |
- | //[OrxTest] Unable to resolve target ' | + | |
- | + | ||
- | + | ||
- | You don't have the minimum required android SDK (API 19) that the orx Demo is set to. Use the SDK Manager (Tools/ | + | |
- | + | ||
- | + | ||
- | **Tip:** If you only receive a debug build, and no release build, there is an excellent workaround detailed | + | |
- | + | ||
- | **Tip:** Android NDK: Could not find application project directory ! | + | |
- | Android NDK: Please | + | |
- | + | ||
- | If you get this when running ndk-build, then you are not in the correct folder. Check the instructions to ensure | + | |
- | + | ||
- | \\ | + | |
If you have completed this tutorial and would like to try it with your own project, continue to [[en: | If you have completed this tutorial and would like to try it with your own project, continue to [[en: | ||