Replies: 2 comments 1 reply
-
Google groups discussion of this here. It does seem like if there was a |
Beta Was this translation helpful? Give feedback.
0 replies
-
I hope we can deliver a good background service abstraction in 2.6 as we improve the thread handling work in other areas as well. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Fyne packages android apps as a single activity of type
org.golang.app.GoNativeActivity
. Activities cannot run in the background on Android, for that one must use a Service. There doesn't appear to be a well carved path to extending Android's service class in go that Fyne could offer right now. Currently all Fyne apps will stop running a few seconds / minutes after leaving the foreground on Android. There's been some discussion on golang android services on stack overflow, but no working examples I could find.I could imagine, in theory, it being possible to build some go code into a shared object and then start that from Java in an android service implementation. How Fyne would package that is an open question, but perhaps in the future I could manually build an app that runs Fyne in the activity and my long running code in a service and facilitates communication between the two. Ideally it would be awesome for Fyne to support a platform-agnostic (sans iOS where this isn't possible) "keep this running" feature, and have representations of background and foreground services.
The app I've created relies on keeping network sockets open in the background at all times for notifications (which is an anti-pattern in mobile development I know, but unavoidable in this case as these sockets are the result of running a Tor client). So for my use case, there isn't an alternative to backgrounding for the app to function.
Beta Was this translation helpful? Give feedback.
All reactions