From 088e69a577261781f0b279519c56b32eb6e12676 Mon Sep 17 00:00:00 2001 From: Velaron Date: Fri, 29 Dec 2023 12:30:40 +0200 Subject: [PATCH] android: add some documentation --- README.md | 25 ++++++++++++++++++- android/app/build.gradle | 9 ++----- android/app/src/main/AndroidManifest.xml | 2 +- .../xash}/hlsdk/MainActivity.java | 2 +- 4 files changed, 28 insertions(+), 10 deletions(-) rename android/app/src/main/java/{com/example => su/xash}/hlsdk/MainActivity.java (97%) diff --git a/README.md b/README.md index d7912d20..2f8d7bb7 100644 --- a/README.md +++ b/README.md @@ -241,8 +241,31 @@ schroot --chroot jessie -- cmake --build build-in-chroot ``` ## Android +1. Set up [Android Studio/Android SDK](https://developer.android.com/studio). -TODO +### Android Studio +Open the project located in the `android` folder and build. + +### Command-line +``` +cd android +./gradlew assembleRelease +``` + +### Customizing the build +settings.gradle: +* **rootProject.name** - project name displayed in Android Studio (optional). + +app/build.gradle: +* **android->namespace** and **android->defaultConfig->applicationId** - set both to desired package name. +* **getBuildNum** function - set **releaseDate** variable as desired. + +app/java/su/xash/hlsdk/MainActivity.java: +* **.putExtra("gamedir", ...)** - set desired gamedir. + +src/main/AndroidManifest.xml: +* **application->android:label** - set desired application name. +* **su.xash.engine.gamedir** value - set to same as above. ## Nintendo Switch diff --git a/android/app/build.gradle b/android/app/build.gradle index 084b5100..ee029686 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -12,7 +12,7 @@ android { applicationId 'com.example.hlsdk' versionName '1.0' versionCode getBuildNum() - minSdkVersion 19 + minSdkVersion 3 targetSdk 34 compileSdk 34 } @@ -20,6 +20,7 @@ android { externalNativeBuild { cmake { version '3.22.1' + path file('../../CMakeLists.txt') } } @@ -42,12 +43,6 @@ android { } } - externalNativeBuild { - cmake { - path file('../../CMakeLists.txt') - } - } - lint { abortOnError false } diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index ee5e0d62..d928f396 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -13,7 +13,7 @@ android:value="valve" /> diff --git a/android/app/src/main/java/com/example/hlsdk/MainActivity.java b/android/app/src/main/java/su/xash/hlsdk/MainActivity.java similarity index 97% rename from android/app/src/main/java/com/example/hlsdk/MainActivity.java rename to android/app/src/main/java/su/xash/hlsdk/MainActivity.java index ebfc1c36..5d1dd353 100644 --- a/android/app/src/main/java/com/example/hlsdk/MainActivity.java +++ b/android/app/src/main/java/su/xash/hlsdk/MainActivity.java @@ -1,4 +1,4 @@ -package com.example.hlsdk; +package su.xash.hlsdk; import android.app.Activity; import android.content.ComponentName;