Comments (3)
Thanks for your excellent description of the problem and what you have done!
So you’re saying it doesn’t work on a Pixel 3 with Android 10, but it does work on an emulator with Android 10, right? (Since API level 29 is Android 10, isn’t it?)
First, could you try using a longer interval, such as 1000 * 15
(15 seconds) and see if that changes anything? You definitely don’t need to wait for 5 minutes then. A location update should be available within a minute.
Second, does it make any difference whether you are outside (perhaps with a clear view of the sky) or inside (a larger building)? Other apps could be relying on Wi-Fi location here while you are explicitly requesting a GPS location with the constructor arguments.
Third, are you running the app in the foreground or in the background while testing this? At least with Android 10, this really makes a difference. You may even have to request the android.permission.ACCESS_BACKGROUND_LOCATION
permission if running in the background.
from android-simplelocation.
@ocram
Thank you for your help! Your second statement solved the issue.
After I changed the requireFine
to false, it could get the lat & long.
Because I want to get the most accurate location of the user, is it possible to get the "fine" location with automatic fallback to "coarse" location if can't get the "fine" location (or if get 0.0/0.0)?
from android-simplelocation.
That’s great to hear, thanks!
Currently, you can only use the “coarse” location with a fallback to the “fine” location, i.e. the other way round – in case the “coarse” location is not available.
The reason is that, when you want “fine” location, you usually want a guarantee that what you’re getting really has the accuracy you need. For example, if you’re working on turn-by-turn navigation, you rather want “no location available” than a location that is actually only Wi-Fi location and is of no real value to the use case at hand.
from android-simplelocation.
Related Issues (20)
- Location not updated in background service HOT 6
- lat, lng is 0 HOT 3
- Location is not giving updated latitude and longitude HOT 1
- Getting latitude and longitude 0.0 HOT 3
- Accuracy HOT 1
- I've just copy+paste the code but returns 0.0 HOT 1
- calculateDistance not found HOT 1
- Cannot resolve HOT 5
- Lat : 0, Lon : 0 HOT 3
- Location tracking failed on background HOT 1
- Speed is 0.0 and interval is not decreased HOT 1
- precise only upto 3 digits of longitude & lattitude HOT 5
- GPS UTC time? HOT 1
- Is this library working on background process HOT 1
- Works only first time then It does not work HOT 1
- passiveMode, what does it mean ? HOT 1
- Cannot resolve method 'getTimestampInMilliseconds()' HOT 3
- Received first coordinates (not 0, 0), but values did not update afterward. HOT 12
- Only Updating very occasionally, despite update interval being set to 500 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-simplelocation.