318 Commits

Author SHA1 Message Date
gd
0bf77f4eb3 android: converted Main from java to kotlin 2025-02-05 11:20:39 +02:00
gd
034bcf4f44 android: added product flavors to separatly build apk for arm64-v8a or x86_64 2025-02-04 10:23:26 +02:00
gd
834d6dcf46 android: build version of kotlin and compose updated.
Changed to compatible versions according to https://developer.android.com/jetpack/androidx/releases/compose-kotlin#kts
2025-02-04 10:22:57 +02:00
gd
8a642c8a83 android: MainScreen - use Icons.AutoMirrored.Filled.List instead of deprecated Icons.Default.List 2025-02-04 10:22:57 +02:00
gd
fe42ad2439 android: .gitignore - added previously misspelled app/src/main/jniLibs/ 2025-02-04 10:22:57 +02:00
gd
51242be72b android: changed permissions handling UI in status screen when show rationale is false
Android will ignore permission request and will not show the request dialog
if the user's action implies "don't ask again."
This leaves the app in a crippled state and the user confused.
Google says "don't try to convince the user", so it returns false for `shouldShowRequestPermissionRationale`.

To help the user proceed, we show the `Request permission` button only if `shouldShowRequestPermissionRationale == true`
because there's a good chance the premission request dialog will not be ignored.

If `shouldShowRequestPermissionRationale == false` we instead show the "rationale" message and a button to open
the app info dialog where the user can explicitly grand the permission.
2025-02-04 10:22:57 +02:00
gd
cb62aff43e android: added missing package declaration in SettingsScreen.kt 2025-02-04 10:22:57 +02:00
gd
491e726540 android: manifest - added sdk version to legacy permission READ_EXTERNAL_STORAGE, added permission READ_MEDIA_AUDIO
Change fo r SDK version 33 and above
2025-02-04 10:22:57 +02:00
gd
7404be41dc android: git ignoring .idea directory completely until a good reason emerges not to 2025-02-04 10:22:57 +02:00
gd
7df041310c android: build.gradle.kts - updated dependencies versions. Updated compile sdk to 35, and target sdk to 34 2025-02-01 18:09:12 +01:00
gd
cd9522c1d1 android: manifest - added android:foregroundServiceType=mediaPlayback and permission FOREGROUND_SERVICE_MEDIA_PLAYBACK
Required by newer android sdk.
2025-02-01 18:09:07 +01:00
gd
59bd0fe0f0 android: added README.md for notes and resources for MPD android maintainers. 2025-02-01 18:09:02 +01:00
gd
0872a761c8 android: gradle build - add ndk.abiFilters to package the prebuilt arm64-v8a/libmpd.so with the apk 2025-02-01 18:08:58 +01:00
gd
996e158f56 android: updated gradle version 2025-02-01 18:08:55 +01:00
Colin Edwards
9dcd0604f2 android: Install the libmpd.so output on android
libmpd.so was getting written as a file called `arm64-v8a` instead of `arm64-v8a/libmpd.so`
2024-05-04 00:13:25 -05:00
Max Kellermann
823d6c9c0f Merge branch 'android_deps' of https://github.com/DDRBoxman/MPD 2024-04-24 14:52:31 +02:00
Colin Edwards
57e26eb832 android: Always force wrap deps
This ensures that android is always built with the deps we build
with wrap.

Also put back the asm disable for openssl since the version we use needs
that flag
2024-04-23 17:58:43 -05:00
Colin Edwards
a0e9dfbec2 android: null check intent in onStartCommand
For some reason the type annotations here show @NonNull but that is
actually false according to the documentation under service.

This may be null if the service is being restarted after its process has gone away, and it had previously returned anything except START_STICKY_COMPATIBILITY.
2024-04-23 00:24:32 -05:00
Colin Edwards
cb6f61cf37 android: Update to NDK 27 2024-04-22 22:34:34 -05:00
Max Kellermann
cd3c34e7b9 Merge branch 'intents' of https://github.com/DDRBoxman/MPD 2024-04-08 08:23:25 +02:00
Colin Edwards
b0cd456753 android: Button to jump to bottom of log view
This adds a button that can jump to the bottom of the log view.
If the user scrolls up we now disable the auto scroll down and show the
down button. When the down button is clicked the auto scroll resumes and
the button is removed.
2024-04-06 20:11:01 -05:00
Colin Edwards
fff9ceccc2 android: Add intents for service start and stop
org.musicpd.action.StartService
org.musicpd.action.StopService

You can test these actions like:
adb shell am broadcast -a org.musicpd.action.StartService org.musicpd

Calling these from an app like tasker should allow for automation
2024-04-05 23:46:14 -05:00
Colin Edwards
4bcbeae1e0 android: Move service client into it's own file
The service file was getting harder to read so lets pull the client code
into it's own file
2024-04-05 23:27:41 -05:00
Max Kellermann
7a40ac52a8 Merge branch 'bottombar' of https://github.com/DDRBoxman/MPD 2024-01-18 09:59:48 +01:00
Max Kellermann
6352d1b1ca Merge branch 'sdkcheck' of https://github.com/DDRBoxman/MPD 2024-01-18 09:59:17 +01:00
Colin Edwards
5b7de2bc2f android: Refactor settings UI into screens and add a bottom bar.
This puts Status, logs, and settings all on different tabs. This gives us plenty more room to work to improve these views going forward
2024-01-18 01:23:31 -06:00
Colin Edwards
04ba7eb987 android: Use build tools and SDK 34
The gradle config for the app is already compiling with the 34 SDK
so lets bump it for the bridge build too
2024-01-17 23:55:01 -06:00
Colin Edwards
5a2267bdb4 Android: Look for license to verify Android SDK folder
The `android` command was depricated and has been removed from new installs of the sdk

The license file existing is about all that is stable between different sdk versions and
cli vs Android studio installs
2024-01-17 23:46:17 -06:00
Colin Edwards
87873c9a73 android: Support play / pause from media session 2024-01-13 23:15:56 -06:00
Max Kellermann
3e862b85d4 Merge branch 'mediasession' of https://github.com/DDRBoxman/MPD 2024-01-13 22:27:00 +01:00
Colin Edwards
3711bd0d24 android: Implement basic media session handling for next and previous track
This starts a Media3 MediaSession when the service starts. A custom player class gets passed into that session to receive commands from other apps and the android os.

Currently we pad out some dummy items to make SimpleBasePlayer think we can do next and previous tracks.

MPD handles the threading for the native calls so we can just directly call the bridge from the player class.
2024-01-05 18:23:16 -06:00
Colin Edwards
e086f09d48 android: add next and previous track to the jni bridge
This will allow the android client to directly make calls to the mpd process to change tracks

I went with camel case on the function names here, if you use an underscore
javac generates a function tht looks like this:
 JNIEXPORT void JNICALL Java_org_musicpd_Bridge_play_1previous

I figured what we ended up with looks a little nicer:
JNIEXPORT void JNICALL Java_org_musicpd_Bridge_playPrevious
2024-01-05 18:21:46 -06:00
Colin Edwards
324bd95c91 android: Move logging into it's own repository class.
Logs will be maintained and appended even when the main UI is not bound to the service.

This also lets us log without filling a Handler with a bunch of messages we might just throw away anyway.
2024-01-04 17:44:49 -06:00
Colin Edwards
5d122c3bc8 android: Add dependencies and new application class for dagger / hilt support
Dagger and hilt give us dependency injection which makes it easier to split up parts of the app. This lets us easily split out things like logging and paves the way to migrate off preferences to DataStore

This also remove the process name on the service to pull eveything into one process so we don't have to do IPC to pass logs around. This lets us use the same instances of injected classes between the UI and the service side.
2024-01-04 17:44:43 -06:00
Colin Edwards
201e081750 android: Fix boot receiver settings and intent check 2023-12-27 13:38:38 -06:00
Colin Edwards
5f7f1d738d android: set kotlin target to 9
The naming scheme was changed in kotlin but not java after java 8
2023-12-27 13:34:37 -06:00
Colin Edwards
8a3d144714 android: Set kotlin jvm target to 1.9 2023-12-27 13:27:02 -06:00
Max Kellermann
658a7f1ca7 Merge branch 'material' of https://github.com/DDRBoxman/MPD 2023-12-27 12:35:13 +01:00
Max Kellermann
bd408cd627 Merge branch 'bootfix' of https://github.com/DDRBoxman/MPD 2023-12-27 12:33:14 +01:00
Colin Edwards
ddc048e2c3 android: Move settings to compose and material UI 3
This changes lets us use the latest UI design from Google, Material 3.

Google only provides the material UI 3 themes for compose, compose only works with kotlin.
2023-12-22 23:04:51 -06:00
Colin Edwards
625ab6decd android: Move preferences class out of settings 2023-12-22 22:51:14 -06:00
Colin Edwards
2638396df5 android: add dependencies for Material 3 and Compose 2023-12-22 13:30:43 -06:00
Colin Edwards
3d8e285e2b android: Fix launching on device boot 2023-12-22 12:30:45 -06:00
Colin Edwards
793a12d58d android: Use Java 9 2023-12-22 12:30:27 -06:00
Max Kellermann
c4d8888972 subprojects: add id3tag 2023-12-22 18:15:25 +01:00
Max Kellermann
d9bbe39f48 android/include/meson.build: remove custom "-I" flag
This is not necessary because the declared dependency is enough for
Meson to generate the "-I" flag automatically.
2023-12-22 17:07:50 +01:00
Max Kellermann
38226dfe81 android/include/meson.build: generate *.class in @PRIVATE_DIR@
We're not interested in the *.class files, we run javac only to
generate the JNI header.  By using @PRIVATE_DIR@, it gets stored to a
directory we can ignore, and not into the source tree.
2023-12-22 16:46:25 +01:00
Max Kellermann
94ef1e13e0 android/include/meson.build: call javac directly, eliminate run-javac.sh 2023-12-22 16:41:35 +01:00
Max Kellermann
35c7c005ba android/meson.build: move target org_musicpd_Bridge.h to include/meson.build 2023-12-22 16:39:13 +01:00
Max Kellermann
1e732f9b9b android/run-javac.sh: remove unnecessary realpath call 2023-12-22 16:35:06 +01:00