This is an Android location information question.

Asked 2 weeks ago, Updated 2 weeks ago, 2 views

I'm making an application about getting Android location information I'm trying to put in the background location information, and from the latest version of Android 11 and above, Unless the user allowed the background location information, if the application was not visible on the screen through the home button or hold key, the location information could not be collected normally and only the approximate location seemed to be brought. So, I'm using it for permission in the app, but when I used other apps, I found that Naver map is on the screen Even though the application was not visible and went down, it seemed to bring location information just by allowing it in the app.

If you don't always allow location information, but if you allow it in the app, do you have accurate location information once a second? Can I bring it? Currently, we are using Kakao Map API and we are importing location information through Location Manager, not Kakao itself.

If there is no way, I would appreciate it if you could explain that there is no way!

kotlin android

2022-09-20 10:43

1 Answers

I solved it myself. When you bring all the GPS information, not just Kakao Maps, If the background service is not registered, it cannot be null or registered. However, I checked that it is possible to collect location information in Android 11 version or higher even if it is allowed in the app, but the general foreground service does not work similarly to the background when collecting location information, so the null value is the same. However, as a result of further searching, when registering your foreground service in AndroidManifest.xml, you specified the type through Android:foregroundServiceType="location", and eventually the service was foreground, but it worked well when running the app, lowering the app, or turning off the cell phone screen through the hold key. The test was done once, so it was not clear information, but it went well without any problems during the test.


2022-09-20 10:43

If you have any answers or tips


© 2022 pinfo. All rights reserved.