Open carbonaro opened 6 years ago
I was about to raise a similar issue. Oreo limitations when doing location in the background are quite annoying, and I really hope we can continue using this lib :(
Creating a foreground service to handle location updates is outside the scope of this library in my opinion.
On Dec 27, 2017 18:01, "lollipierre" notifications@github.com wrote:
I was about to raise a similar issue. Oreo limitations when doing location in the background are quite annoying, and I really hope we can continue using this lib :(
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mcharmas/Android-ReactiveLocation/issues/179#issuecomment-354143319, or mute the thread https://github.com/notifications/unsubscribe-auth/AGV5ODPDIAvLQLou1WpwFKDG3R1QNH78ks5tEnf_gaJpZM4RNpt- .
Fair enough - how would you go about this? I must admit I am a still a little bit confused about Oreo's changes right now.
Not at my computer at the moment so cannot post an example of how I did it but there are plenty of examples of how to create a foreground service.
Official documentation here: https://developer.android.com/guide/components/services.html#Foreground
On Dec 27, 2017 18:08, "Philippe Breuils" notifications@github.com wrote:
Fair enough - how would you go about this? I must admit I am a still a little bit confused about Oreo's changes right now.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mcharmas/Android-ReactiveLocation/issues/179#issuecomment-354144302, or mute the thread https://github.com/notifications/unsubscribe-auth/AGV5OJJN6QGLAwmlqNt62RV0VukvqUS7ks5tEnmfgaJpZM4RNpt- .
@cyrixmorten @carbonaro Have been tested Activity Recognition with Foreground service and it's working fine on Oreo. i'm guessing it's the same with fusedlocation.
Foreground service is the same logic as regular services you just need to add the notification builder and when you start the service startForegroundService()
@cyrixmorten, @Lir10 thanks for the feedback. I'll work on a Foreground service implementation for Activity Recognition.
Have any idea how to keep getting Wi-Fi samples every few minutes in Oreo (without the background service and without the foreground service)?
Do not think it is possible.
You could create a periodic job with a library such as: https://github.com/evernote/android-job https://github.com/evernote/android-job
However, I believe that you would still need to have a foreground service active to prevent the job from being silently killed by the system: https://github.com/evernote/android-job/issues/350 https://github.com/evernote/android-job/issues/350
Not sure though, so worth a shot.
On 19 Feb 2018, at 15.42, Shu1111 notifications@github.com wrote:
Have any idea how to keep getting Wi-Fi samples every few minutes in Oreo (without the background service and without the foreground service)?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mcharmas/Android-ReactiveLocation/issues/179#issuecomment-366712691, or mute the thread https://github.com/notifications/unsubscribe-auth/AGV5OMhrLFq7FQ68EUNYOhmBcUuwIQEXks5tWYhVgaJpZM4RNpt-.
creating a Foreground service would be annoying to some users as they will see the notification in the status bar. I also experienced that oreo displayed a wierd behaviour when i turn on the gps compared to nouget. I monitored this in my app widget. In oreo you have to wait a few minutes in order to see the location updates but in nouget the location will updated immediately after you turn on gps. To get the location updates immediately in oreo i have to open the application (what an annoying to do). So how to solve this problem in oreo without opening the application ?
As per https://developer.android.com/about/versions/oreo/background-location-limits.html the FusedLocationProvider's behaviour has been significantly affected on Oreo :
Fused Location Provider (FLP)
My app needs to receive more frequent update than that ; the documentation page suggests the following :
Is it possible to implement that with Android-ReactiveLocation ?