User Tools

Site Tools


en:tutorials:android:setup_android

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:orx:tutorials:setup_android [2015/05/31 04:48 (9 years ago)] – Changed to work with Android Studio sausageen:tutorials:android:setup_android [2023/03/26 21:39 (12 months ago)] (current) sausage
Line 1: Line 1:
-   This guide is based on Android 1.2.1.1 and NDK version r10. +<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:tutorials:android:getting_android_tools_and_orx|Getting Android Studio and Orx]] step first.</WRAP>
-   The NDK used was slightly oldish compared to the latest Android Studio used. +
-   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 the [[:getting_android_tools_and_orx|Getting Android Studio and Orx]] step. repository step.+===== Compiling the Orx Library and the Android Demo Project =====
  
 +**1. Compiling the Orx library for Android**
  
-**1. Compile orx**+   cd orx/code/build/android 
 +   build.bat
  
-   cd <DEV_FOLDER>/orx/code/build/android +For Linux or Mac use ''build.sh'' instead
-   ndk-build +
-   ./install.sh +
-    +
-   For windows, use install.bat instead. +
-    +
-<hidden Notes about ndk-build: what's it for?>\\ +
-ndk-build compiles all of the orx c source code and links them into usable librariesIt 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.</hidden>\\+
  
-   +The compiled libraries will be located under ''orx\code\build\android\orx\build\outputs\aar''
  
-**2Compile orxTest sample**+  - orx-debug.aar 
 +  - orx-profile.aar 
 +  - orx-release.aar
  
-   cd <DEV_FOLDER>/orx/code/demo/android/app/src +**2. Compiling the Android Demo**
-   export NDK_MODULE_PATH=<DEV_FOLDER>/orx/code +
-   ndk-build +
-    +
-   For windows, substitute the export command above as: +
-   set NDK_MODULE_PATH=<DEV_FOLDER>\orx\code+
  
-**3. Import Orx Library project into Android Studio.**+Compile the Demo which links in the static Orx library that we prepared in step 1:
  
-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 <DEV_FOLDER>/orx/code/demo/android 
 +   build.bat
  
-    1Import an existing project into Android Studio +For Linux or Mac use ''build.sh'' instead
-    2Browse to <DEV_FOLDER>/orx/extern/android+
  
-<hidden Errors and Troubleshooting>\\ +An APK file (one each for debug, profile and release) be created are available at: ''orx\code\demo\android\app\build\outputs\apk''
-   1. Android Studio may complain that the demo project is set to Gradle 0.14.0 in the build.gradle file.  +
-   Android Studio 1.2.1.1 doesn't like this old version and will ask if you want it to update this for you. Click "Fix plug-in version and sync project"+
  
-   2. It may also complain about "Error:(16, 0) Gradle DSL method not found: 'runProguard()'" +You can copy this to your Android device to test.
-    +
-   If so, change the line in <DEV_FOLDER>/orx/extern/android/orx-lib/build.gradle +
-    +
-   From: +
-   runProguard false +
-    +
-   to+
-   minifyEnabled false+
  
-   3. You could receive an error:  
-    
-   Error: Library projects cannot set applicationId. applicationId is set to 'org.orx.lib' in default config. 
-    
-   If so, remove the line: 
-   applicationId "org.orxproject.orxtest" 
-  
-For any fix, close project. Reopen project. 
  
-</hidden>\\+===== 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:  <DEV_FOLDER>/orx/extern/android/orx-lib/build/outputs/aar 
-  
- 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: <DEV_FOLDER>/orx/code/demo/android/app/aars 
-    
-**4. Import the Demo Project into Android Studio** 
  
-   Click "Import an existing project" with Android Studio +If you have completed this tutorial and would like to try it with your own project, continue to [[en:tutorials:android:using_the_android_demo_as_a_template_for_your_own_projects|Using the Android demo as a template for your own projects]].
-   Browse to <DEV_FOLDER>/orx/code/demo/android +
-  +
-  +
-<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.  +
-   Android Studio 1.2.1.1 doesn't like this old version and will ask if you want it to update this for you. Click "Fix plug-in version and sync project".  +
- +
-   2. It may also complain about "Error:(16, 0) Gradle DSL method not found: 'runProguard()'" +
-    +
-   If so, change the line in <DEV_FOLDER>/orx/code/demo/android/app/build.gradle +
-    +
-   From: +
-   runProguard false +
-    +
-   to: +
-   minifyEnabled false +
-  +
-For any fix, close project. Reopen project. +
- +
-</hidden>\\ +
- +
-After a successful project load, it will build files automatically at: <DEV_FOLDER>/orx/code/demo/android/app/build +
-  +
-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:  <DEV_FOLDER>/orx/code/demo/android/app/build/outputs/apk +
- +
-Now you can copy this APK to your Android device and run the demo. +
-    +
-<hidden  Tips for SDK errors> +
- +
-   If you receive the following error: +
-     * [OrxTest] Unable to resolve target 'android-19' +
-    +
-   You don't have the required android SDK (API 19) that the orx Demo is set to. Use the SDK Manager (Tools/Android/SDK Manager) to check and download API 19. +
- +
-</hidden> +
- +
- +
-If you have completed this tutorial and would like to try it with your own project, continue to [[:using_the_android_demo_as_a_template_for_your_own_projects|Using the Android demo as a template for your own projects]].+
        
en/tutorials/android/setup_android.1433072931.txt.gz · Last modified: 2017/05/30 00:50 (7 years ago) (external edit)