RE: https://mastodon.social/@jimmac/115989543616930121

I maintain that while this app ecosystem shines best on GNOME (whether on a laptop, desktop, or phone), there would be a ton of value in getting it in front of Android users; a long-term path towards them actually using Linux on mobile once it’s ready for “normies.”

Getting these apps on Android feels far more urgent to me than getting Android apps on Linux phones today.

#GNOME #OpenSource #Linux #LinuxMobile

Show existing Android users there’s a better ecosystem out there. Get them to appreciate the consistency, simplicity, and respect for them that these apps have. They’ll start preferring these apps over the ad-filled design sin horrors that plague the Google Play store.

And then eventually when they have the opportunity to use Linux on mobile, all these apps will just be there, too—it would greatly lower the switching cost.

@cassidy I wonder if it's possible to port the gtk app to Android
@bender GTK itself has an Android backend now, but I'm not sure how hard/easy it actually is to build and package a typical GNOME app for Android.

@cassidy @bender GNOME apps written in C or Vala that build with Meson are reasonably easy to get running on Android already. For Rust I believe it shouldn't be that hard, but AFAIK we don't have direct support from the build system yet. Python and GJS probably need some more work to integrate with the interpreters.

If there's any GNOME app maintainer seriously interested in getting their app working on Android, please give me a ping, I'm very happy to help where I can.

@larma @cassidy @bender Tuba would be an awesome app on Android 🙌
@Kelbaz @cassidy @bender Tuba unfortunately has a dependency on libsecret which is not compatible with Android (yet?). I can compile Tuba for Android but it will fail to start due to this.
CC @GeopJr
@larma @Kelbaz @cassidy @bender try setting the WINDOWS or DARWIN flag on meson, it forces libsecret to use the file backend instead of platform keyrings
@GeopJr @Kelbaz @cassidy @bender we're getting there :) The file backend didn't work immediately either because it requires gnutls or gcrypt (which is a little hard to build), but I just disabled all the crypto stuff in it and then it was happy.
@larma @GeopJr @Kelbaz @cassidy @bender holy fuck, that's amazing! Maybe my dreams of using a GNOME app on android would actually happen...
@larma @GeopJr @Kelbaz @cassidy @bender a propos, do you have any guidance on how to get Tuba running on android? i'd like to try myself :p

@tragivictoria @GeopJr @Kelbaz @cassidy @bender
Steps (for any GTK app using Meson and C ABI linking) roughly are:
1. Setup Android SDK and NDK
2. Create a meson cross file for it
3. Create an Android app skeleton for gradle
4. Link the GTK app stub java code from GTK source into the skeleton
5. Add all dependencies as meson submodules
6. Make the meson build target aware of it being an android app

(1/2)

@tragivictoria @GeopJr @Kelbaz @cassidy @bender
7. Build with meson and install into a temporary directory
8. Link installed lib .so files into jniLibs of app skeleton
9. Link all other installed files into assets of app skeleton
10. Build the Android app skeleton with gradle

Steps 3-6 and 8-9 could be committed to upstream repositories. And one could probably create the meson cross file using gradle and then call meson from gradle, so that in the end it's just a single gradle command.

(2/2)

@larma @GeopJr @Kelbaz @cassidy @bender thanks for this! Sadly its more complicated than i thought it would be
@cidra @tragivictoria @GeopJr @Kelbaz @cassidy @bender
yes, pixiewood can be used to do steps 3-5 and 8-9, which as I said above can (and IMO should) be committed upstream. You can also use pixiewood to do steps 2, 7 and 10 on the build environment. So I would say that pixiewood is a good starting point for app developers who want to add support for building their app for Android.
@cidra @tragivictoria @GeopJr @Kelbaz @cassidy @bender
An interesting tool though could be a gradle plugin that:
- Makes sure Android SDK+NDK are set up correctly (easy via existing android gradle plugin)
- Invokes meson setup/compile/install during the Gradle assemble process
- Adds respective meson build artifacts into sources on the Android gradle plugin
This would bundle steps 1-2, 4 and 7-10 into a single gradle invocation and could make it convenient to build GTK apps from Android Studio.
@larma This is so cool! I feel like it opens up for a future GNOME-on-my-phone where projects like postmarketos works from the bottom up while this enables app developers to *relatively* easily test their apps in a mobile setting until all the pieces for "daily driving" a GNOME phone is there!
@larma @tragivictoria @GeopJr @cassidy @bender I think the lack of information and documentation on how to compile a gtk4 app on android is a big obstacle for someone to start build for phones. That is really helpful! I wish we had some docs for this 
@Kelbaz @tragivictoria @GeopJr @cassidy @bender I believe one reason why we don't have a lot of docs for developers yet is that things are likely going to change soon. Some of the Android-specific code is going to be moved from GTK into GLib, which is great, because we can have more platform-specific logic in GLib (e.g. to post notifications) and it means GStreamer and GTK can share some of the Android logic that's currently duplicated.
@larma @GeopJr @Kelbaz @cassidy @bender can you please tell us about the performance?