how to get user GPS location while app in background on Android 8.0(Oreo devices) using service?
up vote
1
down vote
favorite
I want to get GPS location when the app in background, I have tried with services it will be working fine when the app in foreground and taking the locations, when the app goes to background it will stop the service automatically,
but I have tried with the same code below 7.0 devices it will be working fine. can anyone suggest me a good way to get the GPS location while app in background 8.0+ above devices?
Thanks!
android service location background-service
add a comment |
up vote
1
down vote
favorite
I want to get GPS location when the app in background, I have tried with services it will be working fine when the app in foreground and taking the locations, when the app goes to background it will stop the service automatically,
but I have tried with the same code below 7.0 devices it will be working fine. can anyone suggest me a good way to get the GPS location while app in background 8.0+ above devices?
Thanks!
android service location background-service
2
use a foreground service if you want it to continue working in background
– Vladyslav Matviienko
Nov 8 at 13:24
@VladyslavMatviienko if we use foreground service it is possible to get the location more than an hour(1- 2 hours) continuously background?
– Ram Suthakar
Nov 8 at 13:33
2
Should be possible as long as the service is running. Another thing is that so long running location service will make the device battery run out fast
– Vladyslav Matviienko
Nov 8 at 13:35
Okay will check, but some of the manufacturer who customizes native os like (oppo, vivo, xiaomi, samsung) they have a clear option so when service stops automatically even we start the service at foreground service is that any possible way to prevent this one?
– Ram Suthakar
Nov 8 at 13:41
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I want to get GPS location when the app in background, I have tried with services it will be working fine when the app in foreground and taking the locations, when the app goes to background it will stop the service automatically,
but I have tried with the same code below 7.0 devices it will be working fine. can anyone suggest me a good way to get the GPS location while app in background 8.0+ above devices?
Thanks!
android service location background-service
I want to get GPS location when the app in background, I have tried with services it will be working fine when the app in foreground and taking the locations, when the app goes to background it will stop the service automatically,
but I have tried with the same code below 7.0 devices it will be working fine. can anyone suggest me a good way to get the GPS location while app in background 8.0+ above devices?
Thanks!
android service location background-service
android service location background-service
asked Nov 8 at 13:17
Ram Suthakar
12811
12811
2
use a foreground service if you want it to continue working in background
– Vladyslav Matviienko
Nov 8 at 13:24
@VladyslavMatviienko if we use foreground service it is possible to get the location more than an hour(1- 2 hours) continuously background?
– Ram Suthakar
Nov 8 at 13:33
2
Should be possible as long as the service is running. Another thing is that so long running location service will make the device battery run out fast
– Vladyslav Matviienko
Nov 8 at 13:35
Okay will check, but some of the manufacturer who customizes native os like (oppo, vivo, xiaomi, samsung) they have a clear option so when service stops automatically even we start the service at foreground service is that any possible way to prevent this one?
– Ram Suthakar
Nov 8 at 13:41
add a comment |
2
use a foreground service if you want it to continue working in background
– Vladyslav Matviienko
Nov 8 at 13:24
@VladyslavMatviienko if we use foreground service it is possible to get the location more than an hour(1- 2 hours) continuously background?
– Ram Suthakar
Nov 8 at 13:33
2
Should be possible as long as the service is running. Another thing is that so long running location service will make the device battery run out fast
– Vladyslav Matviienko
Nov 8 at 13:35
Okay will check, but some of the manufacturer who customizes native os like (oppo, vivo, xiaomi, samsung) they have a clear option so when service stops automatically even we start the service at foreground service is that any possible way to prevent this one?
– Ram Suthakar
Nov 8 at 13:41
2
2
use a foreground service if you want it to continue working in background
– Vladyslav Matviienko
Nov 8 at 13:24
use a foreground service if you want it to continue working in background
– Vladyslav Matviienko
Nov 8 at 13:24
@VladyslavMatviienko if we use foreground service it is possible to get the location more than an hour(1- 2 hours) continuously background?
– Ram Suthakar
Nov 8 at 13:33
@VladyslavMatviienko if we use foreground service it is possible to get the location more than an hour(1- 2 hours) continuously background?
– Ram Suthakar
Nov 8 at 13:33
2
2
Should be possible as long as the service is running. Another thing is that so long running location service will make the device battery run out fast
– Vladyslav Matviienko
Nov 8 at 13:35
Should be possible as long as the service is running. Another thing is that so long running location service will make the device battery run out fast
– Vladyslav Matviienko
Nov 8 at 13:35
Okay will check, but some of the manufacturer who customizes native os like (oppo, vivo, xiaomi, samsung) they have a clear option so when service stops automatically even we start the service at foreground service is that any possible way to prevent this one?
– Ram Suthakar
Nov 8 at 13:41
Okay will check, but some of the manufacturer who customizes native os like (oppo, vivo, xiaomi, samsung) they have a clear option so when service stops automatically even we start the service at foreground service is that any possible way to prevent this one?
– Ram Suthakar
Nov 8 at 13:41
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Android 8 background has restricted location services. Please check this enter link description here
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Android 8 background has restricted location services. Please check this enter link description here
add a comment |
up vote
0
down vote
Android 8 background has restricted location services. Please check this enter link description here
add a comment |
up vote
0
down vote
up vote
0
down vote
Android 8 background has restricted location services. Please check this enter link description here
Android 8 background has restricted location services. Please check this enter link description here
answered Nov 8 at 14:04
user65505
35
35
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53208562%2fhow-to-get-user-gps-location-while-app-in-background-on-android-8-0oreo-devices%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
use a foreground service if you want it to continue working in background
– Vladyslav Matviienko
Nov 8 at 13:24
@VladyslavMatviienko if we use foreground service it is possible to get the location more than an hour(1- 2 hours) continuously background?
– Ram Suthakar
Nov 8 at 13:33
2
Should be possible as long as the service is running. Another thing is that so long running location service will make the device battery run out fast
– Vladyslav Matviienko
Nov 8 at 13:35
Okay will check, but some of the manufacturer who customizes native os like (oppo, vivo, xiaomi, samsung) they have a clear option so when service stops automatically even we start the service at foreground service is that any possible way to prevent this one?
– Ram Suthakar
Nov 8 at 13:41