delight-im / Android-SimpleLocation

Utility class for easy access to the device location on Android
Apache License 2.0
200 stars 75 forks source link

Get zero latitude and longitude #15

Closed SanjayGubaju closed 7 years ago

SanjayGubaju commented 7 years ago

Both latitude and longitude is 0.0.

ocram commented 7 years ago

Right after creating the instance, can you add

mySimpleLocation.setListener(new SimpleLocation.Listener() {});

and implement the method from that interface SimpleLocation.Listener? This way, you should be informed as soon as the location has been detected.

Apart from that, please check the permissions, as always.

Does that help?

jorgecasariego commented 7 years ago

I'm having the same problem. In some cases it works perfect and others returns 0.

ocram commented 7 years ago

@jorgecasariego Did you try the same solution (suggested above)?

jorgecasariego commented 7 years ago

Yes, I read also other issues here. I'm testing now. It isn't always but in some places I receive 0 0

huxaiphaer commented 7 years ago

mySimpleLocation.setListener(new SimpleLocation.Listener() {}); It worked like charm. :-) But i suggest please add this in the documentation.

ocram commented 7 years ago

@huxaiphaer Thanks! You're right, that is definitely needed. Sorry that it was missing so far. A paragraph has been added to the documentation in https://github.com/delight-im/Android-SimpleLocation/commit/adf899da6b9fd55f860979e88e9c247554377683.

huxaiphaer commented 7 years ago

That's fantastic, great Macro.

On Aug 6, 2017 2:08 AM, "Marco" notifications@github.com wrote:

@huxaiphaer https://github.com/huxaiphaer Thanks! You're right, that is definitely needed. Sorry that it was missing so far. A paragraph has been added to the documentation in adf899d https://github.com/delight-im/Android-SimpleLocation/commit/adf899da6b9fd55f860979e88e9c247554377683 .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/delight-im/Android-SimpleLocation/issues/15#issuecomment-320475397, or mute the thread https://github.com/notifications/unsubscribe-auth/ANpjOc2hnPuDcoLnko5FhHithvQmGid_ks5sVPXQgaJpZM4M1sVC .