Skip to content
This repository has been archived by the owner on Jan 14, 2018. It is now read-only.

Android O background service limitations #467

Open
bogdanzurac opened this issue Apr 2, 2017 · 5 comments
Open

Android O background service limitations #467

bogdanzurac opened this issue Apr 2, 2017 · 5 comments

Comments

@bogdanzurac
Copy link

How do the new background service limitations in the newest Android O Developer Preview affect RoboSpice? Even on earlier releases, when the Activity goes into background and a request hasn't finished yet, a blank notification is being shown.

Reference: https://developer.android.com/preview/features/background.html#services

@stephanenicolas
Copy link
Owner

stephanenicolas commented Apr 3, 2017 via email

@Faltenreich
Copy link

Actually I get an IllegalStateException when my app is awoken from the background by an registered alarm through the AlarmManager:

E/AndroidRuntime: FATAL EXCEPTION: SpiceManagerThread 0 Process: com.faltenreich.diaguard, PID: 5028 java.lang.IllegalStateException: Not allowed to start service Intent { cmp=com.faltenreich.diaguard/.networking.openfoodfacts.OpenFoodFactsService }: app is in background uid UidRecord{2d90d59 u0a84 RCVR idle procs:1 seq(0,0,0)} at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1505) at android.app.ContextImpl.startService(ContextImpl.java:1461) at android.content.ContextWrapper.startService(ContextWrapper.java:644) at com.octo.android.robospice.SpiceManager.tryToStartService(SpiceManager.java:1170) at com.octo.android.robospice.SpiceManager.run(SpiceManager.java:247) at java.lang.Thread.run(Thread.java:764)

@ransome1
Copy link

ransome1 commented Jan 12, 2018

Hey there. We are facing similar problems: tryToStartService crashes on Android 8.x devices, since Google limited the backgrounds executions.

@stephanenicolas Is there any update for robospice in sight, that uses the new startForegroundService method for 8.x devices, as Google introduced here: https://developer.android.com/about/versions/oreo/android-8.0-changes.html

@bogdanzurac
Copy link
Author

bogdanzurac commented Jan 12, 2018

Should seriously consider switching to the new, official Android Arch Components. I wouldn't recommend RS on any new project. Now don't get me wrong, it was a very useful library for a quite long time, but its architecture doesn't really suit where Android is at this point. Not to mention the fact that the library hasn't seen an update in over 3 years.

Again, I don't mean to offend anybody on the team, especially @stephanenicolas. You've done a tremendously amazing job with RS and all of us are extremely grateful for that. But I think it's time to call it in.

@stephanenicolas
Copy link
Owner

Thx a lot Bogdan for these kind words. But yes, we froze RS last week, the library is not maintained anymore. Personnally, I now always use a mix of retrofit and Rx instead, RS has sailed a long way home and yes, the latest constraints in android O don't make it easy for RS at all, it's probably the last nail in its coffin.

Thx to all RS users for your warm support, it's been a pleasure to ofer this library to the community. Thx to @rciovati too for his important contributions to RS !

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

No branches or pull requests

4 participants