yayaa / LocationManager

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

method useOnlyGPService not acting right behavior as document says #30

Closed xxxifan closed 7 years ago

xxxifan commented 7 years ago

useOnlyGPService documentation:

While this is set true default location providers (GPS & Network)
 will not be used to receive location, set false if you want them to be used.

but actually it been using for check whether to use GooglePlay service instead of GPS service https://github.com/yayaa/LocationManager/blob/master/library/src/main/java/com/yayandroid/locationmanager/LocationManager.java#L249

and there's another method for decide whether to use GooglePlay service doNotUseGooglePlayServices

yayaa commented 7 years ago

Naming issue :( GPService = GooglePlayService not GPS It'll be fixed with v2 still working on it though :)

xxxifan commented 7 years ago

But I need a function like the doc says :( please

yayaa commented 7 years ago

So you don't want to use GooglePlayServices or/and Network Provider? But only GPS provider?

xxxifan commented 7 years ago

yes, can you make it :P

yayaa commented 7 years ago

I'll consider within v2 :) But you can always set your own LocationProvider? Just extend LocationProvider class do your GPS Provider implementation and should be fine

yayaa commented 7 years ago

And one more thing, if library is able to retrieve location in given waiting period for GPS then it'll not switch to network. So you can set setWaitPeriod for GPS long enough you think that you'd receive location from, and network will never be used. And for the GooglePlayServices you can set doNotUseGooglePlayServices

So it is already possible.

xxxifan commented 7 years ago

Thanks for the tip, I was doing like this and works like a charm, thanks ;)

yayaa commented 7 years ago

You're welcome :)