Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WorkManager brainstorming and future of this library #610

Open
gotev opened this issue Nov 4, 2021 · 7 comments
Open

WorkManager brainstorming and future of this library #610

gotev opened this issue Nov 4, 2021 · 7 comments

Comments

@gotev
Copy link
Owner

gotev commented Nov 4, 2021

From Android 8 onwards, Google started to push back on Android Services. With the release of Android 12, services are no longer considerable "first class citizens", as clearly Google is pushing stuff to be made with WorkManager now and it does make sense. You currently cannot start uploads while the app is the background on Android 12.

Current internal architecture revolves around the now "old school" android way of doing stuff:

  • Create an intent
  • Start a service with that intent
  • Do stuff in the service
  • Send broadcast intents from the service
  • Listen to broadcast intents coming from the service to display the notification or to update some app UI

With WorkManager it will be completely different. Also the library name as it is now won't be representative anymore.

This issue is meant to be a brainstorming room about the future of this library going forward. It's clear that the Service architecture is coming to an end.

I'm also wondering if it does make sense to still maintain the lib, as moving to WorkManager will mean a total rewrite from the ground up, to be "just" a bunch of job implementations to be used with WorkManager APIs, changing the face of this library and its usage completely.

@stale
Copy link

stale bot commented Jan 4, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@JessHolle
Copy link

One note on an issue raised on #657 regarding ForegroundServiceStartNotAllowedException occurring.

One should apply the workaround for this issue noted in https://stackoverflow.com/questions/70711950/android-12-foregroundservicestartnotallowedexception-while-in-foreground if this has not already been done.

See https://issuetracker.google.com/issues/229000935#comment34

@JessHolle
Copy link

I believe there is a point to this library continuing (or perhaps a renamed version thereof) to take the work out of using WorkManager for upload tasks and (hopefully) improving on the current state of affairs by reloading app code only when conditions are met for the upload (e.g. network availability).

@gotev
Copy link
Owner Author

gotev commented Jul 10, 2024

One note on an issue raised on #657 regarding ForegroundServiceStartNotAllowedException occurring.

One should apply the workaround for this issue noted in https://stackoverflow.com/questions/70711950/android-12-foregroundservicestartnotallowedexception-while-in-foreground if this has not already been done.

See https://issuetracker.google.com/issues/229000935#comment34

See

builder.foregroundServiceBehavior = Notification.FOREGROUND_SERVICE_IMMEDIATE

@gotev
Copy link
Owner Author

gotev commented Jul 10, 2024

I believe there is a point to this library continuing (or perhaps a renamed version thereof) to take the work out of using WorkManager for upload tasks and (hopefully) improving on the current state of affairs by reloading app code only when conditions are met for the upload (e.g. network availability).

So your point of view is maintaining the library public API and use WorkManager internally instead of the upload service, right?

@JessHolle
Copy link

I believe there is a point to this library continuing (or perhaps a renamed version thereof) to take the work out of using WorkManager for upload tasks and (hopefully) improving on the current state of affairs by reloading app code only when conditions are met for the upload (e.g. network availability).

So your point of view is maintaining the library public API and use WorkManager internally instead of the upload service, right?

Yes. Maintain an easy-to-use but flexible external API but internally use WorkManager to get Google to stop pestering and hopefully improve behavior from a user perspective by letting the OS kill the app/service process when resources are tight and only start it up again when conditions are right for the upload work. That seems like the underlying user benefit of the WorkManager that Google is pushing -- only loading/keeping app code in memory only when actually helpful.

@gotev
Copy link
Owner Author

gotev commented Jul 11, 2024

That sounds good on paper. To actually make it, it's necessary to first and foremost be proficient at using WorkManager and know its lifecycle and concepts, then those have to be put in the context of the actual internal architecture of the library and its internal lifecycle, mapping all the needed changes and checking if that's going to cause changes for actual users, eliminating classes and code which will not be needed anymore. After the plan is made, actual implementation could start.

For the foreseeable future I won't have the needed time to do this work, but I'll leave this thread open for everyone who wants to help or try an implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants