Android.txt 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 and run with ANDROID STUDIO. Steps:
  7. ====================================================
  8. - install Android Studio
  9. - run Android Studio and import any project as Gradle from examples.
  10. - go to File->Settings->Appearance & Behavior->System Settings->Android SDK
  11. - click to checkbox "Show Package Details"
  12. - select and install "Android SDK Platform 26" (under Android 8.0 (Oreo))
  13. - try to build
  14. - Android Studio will ask to download and install Android NDK. Intall it.
  15. - build and run!
  16. OUTDATED!!!! How to build and run with COMMAND LINE TOOLS. Steps:
  17. ====================================================
  18. - Install "java development kit" JDK 8 (or older)
  19. - Install Android NDK (https://developer.android.com/ndk/downloads/index.html) and set it up
  20. - Install Android SDK "Command line tools" (https://developer.android.com/studio/index.html, scroll to bottom),
  21. Launch SDK Manager and install Android SDK v16
  22. - Configure environment variables properly:
  23. NDK_ROOT points to root NDK folder
  24. example: d:\android\android-ndk-r13b\
  25. ANDROID_HOME points to root Android SDK folder
  26. example: d:/android/android-sdk/
  27. JAVA_HOME points to JDK
  28. example: c:\Program Files\Java\jdk1.8.0_101\
  29. - Add necessary paths to environment variable PATH:
  30. JDK
  31. example: "c:\Program Files\Java\jdk1.8.0_101\bin\"
  32. NDK tools
  33. example: d:\android\android-ndk-r13b\
  34. Android SDK tools and platform-tools
  35. example: d:\android\android-sdk\platform-tools\
  36. example: d:\android\android-sdk\tools\)
  37. - Copy latest source code (and don't forget to update it if you updated SDL)
  38. from SDL/android-project/src/
  39. to oxygine-framework/oxygine/SDL/android/lib/src/
  40. - Go to oxygine-framework\examples and choose any of them. For example "Demo"
  41. - Try to build and run it using shell/batch scripts located in proj.android folder*:
  42. - build-run.bat
  43. * or ./build-run.sh for unix
  44. build-run.bat includes 4 steps:
  45. 1. build C++ code using android-ndk:
  46. ndk-build NDK_MODULE_PATH=../../../../
  47. 2. build android aplication using gradle and android-sdk:
  48. gradlew assembleDebug
  49. 3. intall android application to connected android device:
  50. adb install -r build/outputs/apk/proj.android-debug.apk
  51. 4. run installed application on android:
  52. adb shell am start -n org.oxygine.Demo/org.oxygine.Demo.MainActivity
  53. * if you have any problems with build check each step manually
  54. !!!note!!!:
  55. Folder containing oxygine-framework should have the exact name 'oxygine-framework'
  56. not 'oxygine-framework-master' not 'oxygine-framework.git' etc.
  57. otherwise you would see error:
  58. > Android NDK: jni/src/Android.mk: Cannot find module with tag 'oxygine-framework'
  59. 2c. You could generate your own android build config.
  60. =================================================================================================
  61. - You need installed Python 2.7
  62. - You need to run this script
  63. oxygine-framework\tools\gen_template.py
  64. example:
  65. python gen_template.py MyProject -t android -d path/to/MyProject/