User Tools

Site Tools


proton:android_setupv3

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
proton:android_setupv3 [2022/04/13 05:35] sethproton:android_setupv3 [2022/08/01 06:06] (current) seth
Line 5: Line 5:
 This is a lot easier than it used to be. This is a lot easier than it used to be.
  
-  * Install Android Studio+  * Install [[https://developer.android.com/studio|Android Studio]]
   * Make sure everything is working by creating a project using its "Native C++" template.  It will automatically download Gradle and the NDK, you should be able to run it on a simulator device and real Android device plugged in.   * Make sure everything is working by creating a project using its "Native C++" template.  It will automatically download Gradle and the NDK, you should be able to run it on a simulator device and real Android device plugged in.
   * Edit the local.properties file in AndroidGradle dir and change RTappID value to your app android package id, and sdk.dir should be set to your Android SDK dir.  The package ID must match the one set inside your App.h   * Edit the local.properties file in AndroidGradle dir and change RTappID value to your app android package id, and sdk.dir should be set to your Android SDK dir.  The package ID must match the one set inside your App.h
 +  * local.properties also has settings for your cert and passwords if needed, this is needed to do release builds for testing, even if Google signs the bundle for you later, I find this is needed to test final releases locally anyway
   * Edit AndroidGradle\app\src\main\cpp\CMakeLists.txt and add/remove the C++ files used.   * Edit AndroidGradle\app\src\main\cpp\CMakeLists.txt and add/remove the C++ files used.
   * You should now be able to click build and play or debug.   * You should now be able to click build and play or debug.
Line 14: Line 15:
  
   * Notice that PrepareResources.bat is run when you build a project, it copies assets from bin/interface (etc) to android directories.   * Notice that PrepareResources.bat is run when you build a project, it copies assets from bin/interface (etc) to android directories.
-  * You probably want to edit the App/AndroidManifest.xml file.  Don't change the RTAndroidApp app id anywhere, it's automatically replaced when you build with what is set in local.properties.+  * You probably want to edit the app display title and permissions in App/AndroidManifest.xml file.  Don't change the RTAndroidApp app id anywhere, it's automatically replaced when you build with what is set in local.properties.
   * Note that Main.java is project specific, but the other java files are copied from /shared/Android/v3_src during the build, they are designed to be shared between all proton projects.   * Note that Main.java is project specific, but the other java files are copied from /shared/Android/v3_src during the build, they are designed to be shared between all proton projects.
-  * To replace the proton icon, in Android Studio right-click the res folder and select New > Image Asset.  Set the path to AndroidGradle/app_icon.png (or another file).  You should see all icons resized to this image.  Click next and save, it will overwrite everything. (see?  this is why we used Android Studio now, makes this part really quick)+  * To replace the app icon, in Android Studio right-click the res folder and select New > Image Asset.  Set the path to AndroidGradle/app_icon.png (or another file).  You should see all icons resized to this image.  Click next and save, it will overwrite everything. (see?  this is why we used Android Studio now, makes this part really quick)  I usually have to do it twice for some reason.
   * In Android Studio, I like to choose Run->Edit Configurations, click the Miscellaneous tab and enable "Show logcat automatically" and "Clear log before launch"   * In Android Studio, I like to choose Run->Edit Configurations, click the Miscellaneous tab and enable "Show logcat automatically" and "Clear log before launch"
  
Line 26: Line 27:
   * Run "BuildFinalBundles.bat" (or type "gradlew bundle" from the command-line.  Builds release and debug bundles in AndroidGradle\app\build\outputs\bundle <-- This is the only thing the Play Store will accept for submission now.  I recommend letting them sign your builds for you.   * Run "BuildFinalBundles.bat" (or type "gradlew bundle" from the command-line.  Builds release and debug bundles in AndroidGradle\app\build\outputs\bundle <-- This is the only thing the Play Store will accept for submission now.  I recommend letting them sign your builds for you.
  
 +== Errors and problems == 
 +  * If you get a weird "clang++: error: no such file or directory" linker error, it's possible your paths are just too long.  Even with the max path Win 11 fix I had this issue with one particularly huge fmod library path, so something to keep in mind.
  
 (this is under construction and github may not reflect these latest changes yet) (this is under construction and github may not reflect these latest changes yet)
  
proton/android_setupv3.1649828136.txt.gz · Last modified: 2022/04/13 05:35 by seth