yayaa / LocationManager

Simplify getting user's location for Android
807 stars 187 forks source link

Marshmallow Timeout #8

Closed jesusmartinoza closed 8 years ago

jesusmartinoza commented 8 years ago

Hi, awesome library I like the clean code but I have a problem with Marshmallow devices. I just can't make it work, always throws failType = 5.

I have all the permission in the manifest.

Thanks.

yayaa commented 8 years ago

Thanks for your kind comment :)

First of all, FailType.TIMEOUT doesn't mean that you have anything wrong, but it means it wasn't possible to receive location update in specified time periods. What is your configurations? You may try with higher provider wait time periods...

jesusmartinoza commented 8 years ago

Thanks for the fast answer. Here is my LocationConfiguration()

  return new LocationConfiguration()
                .keepTracking(false)
                .askForGooglePlayServices(true)
                .setMinAccuracy(200.0f)
                .setWaitPeriod(ProviderType.GOOGLE_PLAY_SERVICES, 5 * 1000)
                .setWaitPeriod(ProviderType.GPS, 10 * 1000)
                .setWaitPeriod(ProviderType.NETWORK, 5 * 1000)
                .setGPSMessage("Would you mind to turn GPS on?")
                .setRationalMessage("Gimme the permission!");

The problem only happen with > API 23

yayaa commented 8 years ago

Are you using emulator/genymotion to test on Android API 23? If so, please try with real device as well.

jesusmartinoza commented 8 years ago

Thank you @yayaa. I wasn't sending the location to my emulator u.u jeje

yayaa commented 8 years ago

Glad to help :)