Android.txt 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. 1. Start from readme.txt
  2. step by step video tutorial:
  3. http://www.youtube.com/watch?v=d8eHHr_KHgQ
  4. 2a. Examples folder have configured android project
  5. =================================================================================================
  6. How to build. Steps:
  7. - Install "java development kit" JDK 8 (or older)
  8. - Install Android NDK (https://developer.android.com/ndk/downloads/index.html) and set it up
  9. - Install Android SDK "Command line tools" (https://developer.android.com/studio/index.html, scroll to bottom),
  10. Launch SDK Manager and install Android SDK v16
  11. - Configure environment variables properly:
  12. NDK_ROOT points to root NDK folder
  13. example: d:\android\android-ndk-r13b\
  14. ANDROID_HOME points to root Android SDK folder
  15. example: d:/android/android-sdk/
  16. JAVA_HOME points to JDK
  17. example: c:\Program Files\Java\jdk1.8.0_101\
  18. - Add necessary paths to environment variable PATH:
  19. JDK
  20. example: "c:\Program Files\Java\jdk1.8.0_101\bin\"
  21. NDK tools
  22. example: d:\android\android-ndk-r13b\
  23. Android SDK tools and platform-tools
  24. example: d:\android\android-sdk\platform-tools\
  25. example: d:\android\android-sdk\tools\)
  26. - Copy latest source code (and don't forget to update it if you updated SDL)
  27. from SDL/android-project/src/
  28. to oxygine-framework/oxygine/SDL/android/lib/src/
  29. - Go to oxygine-framework\examples and choose any of them. For example "Demo"
  30. - Try to build and run it using shell/batch scripts located in proj.android folder*:
  31. - build-run.bat
  32. * or ./build-run.sh for unix
  33. build-run.bat includes 4 steps:
  34. 1. build C++ code using android-ndk:
  35. ndk-build NDK_MODULE_PATH=../../../../
  36. 2. build android aplication using gradle and android-sdk:
  37. gradlew assembleDebug
  38. 3. intall android application to connected android device:
  39. adb install -r build/outputs/apk/proj.android-debug.apk
  40. 4. run installed application on android:
  41. adb shell am start -n org.oxygine.Demo/org.oxygine.Demo.MainActivity
  42. * if you have any problems with build check each step manually
  43. !!!note!!!:
  44. Folder containing oxygine-framework should have the exact name 'oxygine-framework'
  45. not 'oxygine-framework-master' not 'oxygine-framework.git' etc.
  46. otherwise you would see error:
  47. > Android NDK: jni/src/Android.mk: Cannot find module with tag 'oxygine-framework'
  48. 2b. You could generate your own android build config.
  49. =================================================================================================
  50. - You need installed Python 2.7
  51. - You need to run this script
  52. oxygine-framework\tools\gen_template.py
  53. example:
  54. python gen_template.py MyProject -t android -d path/to/MyProject/