InsFi
InsFi

Reputation: 1318

Android O API 26. Newly added Location methods don't work as needed

I'm using Android O Developer preview 4 - API 26

Device - Google Pixel XL

enter image description here

And seems like the new features such as:

for both fused and gps location providers. I've tried it while was moving in the car. So I have speed and bearingthemselves but don't their accuracy.

Am I missing something?

See docs here

Thanks!

Upvotes: 22

Views: 1672

Answers (3)

Pedro Varela
Pedro Varela

Reputation: 2425

@InsFi, Check this sample code I wrote. I had some trouble before.

Android: "Calling thread must be a prepared Looper thread" error when I use AsyncTask

I implemented the LocationCallback, read the whole post so you get an idea.

I have a pixel phone and it works well.

Upvotes: 0

el Punch
el Punch

Reputation: 230

these method will not work depending on the API level of the device you are running/debugging on.

Can you check what API level your Google Pixel XL is?

Upvotes: 3

Arun Shankar
Arun Shankar

Reputation: 2295

Check what value you are getting when you try to use getSpeedAccuracyMetersPerSecond()

Go through the definition of getSpeedAccuracyMetersPerSecond(). If that is going to return you 0.0, then you will keep getting false irrespective of what location provider you use

Upvotes: 2

Related Questions