-3

I am getting location in background through Fused Location Provider but always getting null Location.

Can you please help me

  • https://stackoverflow.com/questions/29441384/fusedlocationapi-getlastlocation-always-null – Skizo-ozᴉʞS ツ Jun 29 '21 at 11:48
  • What does your code look like? Do you request location updates? Have you asked for the location permission at runtime? What is the Android version and have you read the documentation about background location limitations in recent Android versions? Are you requesting a GPS location but stay indoors where GPS won't work? Are you requesting a network based location, but don't have a SIM card in the device? There are a lot of things to go wrong and a lot of details missing from the question. – Markus Kauppinen Jun 29 '21 at 13:03

1 Answers1

0

Are you using an android emulator?

The fused location provider manages the underlying location technologies, such as GPS and Wi-Fi, and provides a simple API that you can use to specify the required quality of service. For example, you can request the most accurate data available, or the best accuracy possible with no additional power consumption.

well, it happened to me before when I used some android emulators with low API levels (Lollipop L25). so the emulator doesn't have any location info to return but it will work on a physical device.

now if your problem just in the background what background service are you using can you share some code?

Ganesh MB
  • 1,109
  • 2
  • 14
  • 27
  • using inside Workmanager , if you have then can you share some code with me. Thank you. Testing in Real device not in emulator – Pramod Sinha Jun 29 '21 at 11:53