From 038759506f497ab3b8ad34f4f5bb2d37a63fd173 Mon Sep 17 00:00:00 2001
From: gd <gd@iotide.com>
Date: Wed, 5 Feb 2025 20:31:43 +0200
Subject: [PATCH] android: added 'universal' flavor that includes both both
 arm64-v8a and x86_64 versions of libmpd.so

---
 android/app/build.gradle.kts | 6 ++++++
 android/build.py             | 2 ++
 doc/user.rst                 | 4 +++-
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts
index 4c0a54332..0a2618fac 100644
--- a/android/app/build.gradle.kts
+++ b/android/app/build.gradle.kts
@@ -57,6 +57,12 @@ android {
                 abiFilters += listOf("x86_64")
             }
         }
+        create("universal") {
+            ndk {
+                // ABI to include in package
+                abiFilters += listOf("arm64-v8a", "x86_64")
+            }
+        }
     }
     compileOptions {
         sourceCompatibility = JavaVersion.VERSION_1_9
diff --git a/android/build.py b/android/build.py
index 5a74c4009..c8d950795 100755
--- a/android/build.py
+++ b/android/build.py
@@ -76,5 +76,7 @@ print("""
 ## To build the android app:
 # cd ../../android
 # ./gradlew assemble{}Debug
+## or, for a universal apk (includes both arm64-v8a and x86_64)
+# ./gradlew assembleUniversalDebug
 -------------------------------------
 """.format(android_abi.capitalize()))
\ No newline at end of file
diff --git a/doc/user.rst b/doc/user.rst
index e76d8e8a5..ee77c0008 100644
--- a/doc/user.rst
+++ b/doc/user.rst
@@ -225,8 +225,10 @@ tarball and change into the directory.  Then, instead of
  cd ../../android
  ./gradlew assemble{ABI}Debug
 
-In the argument to `gradlew`, replace `{ABI}` with the build ABI.
+In the argument to `gradlew`, replace `{ABI}` with the build ABI or `Universal`.
 The `productFlavor` names defined in `build.android.kts` match the ABI.
+A universal apk (includes both arm64-v8a and x86_64)
+
 
 :envvar:`SDK_PATH` is the absolute path where you installed the
 Android SDK; :envvar:`NDK_PATH` is the Android NDK installation path;