Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always updating the last known location rather than the current one. #3

Closed
Abhinab01 opened this issue Apr 9, 2015 · 7 comments
Closed
Labels

Comments

@Abhinab01
Copy link

Hello mwaclawek,
I am very grateful that you have made this wonderful library available to everyone and it is pretty awesome.

But currently im facing some issues with getting the current location, as the old known location is only getting updated most of the times... And in many devices im only getting (0,0) coordinates...

Is there any way I can correct it and make it update the location to the current one every-time asked for and eliminate the (0,0) coordinate results?...

I really need your help and I shall always be grateful to you for the same... Please help...

@ocram ocram added the question label Apr 13, 2015
@ocram
Copy link
Contributor

ocram commented Apr 13, 2015

Thanks for your kind feedback!

What's your code that isn't really working yet? Did you include the call to beginUpdates()?

Otherwise, if the default interval between new location updates (10 minutes) does not work for you, you can pass a custom interval (in milliseconds) to the constructor:

public SimpleLocation(final Context context, final boolean requireFine, final boolean passive, final long interval) {

Does that help?

@Abhinab01
Copy link
Author

Thanks a lot for your kind response... Yes I figured out that I was not
calling beginUpdates(); but like you said, to change the default update
time I need to pass a custom interval (in milliseconds) to the constructor,
but HOW? I'm using your .jar file in my library, How can I edit that?
Please Help... I really need it... :(

Thank You Again... :)
On Apr 14, 2015 3:12 AM, "Marco" notifications@github.com wrote:

Thanks for your kind feedback!

What's your code that isn't really working yet? Did you include the call
to beginUpdates()?

Otherwise, if the default interval between new location updates (10
minutes) does not work for you, you can pass a custom interval (in
milliseconds) to the constructor:

public SimpleLocation(final Context context, final boolean requireFine, final boolean passive, final long interval) {

Does that help?


Reply to this email directly or view it on GitHub
#3 (comment)
.

@ocram
Copy link
Contributor

ocram commented Apr 17, 2015

Using the JAR is fine, it's possible without changing any library code:

Right now, you're calling the constructor like this:

location = new SimpleLocation(this);

You just have to replace that call with the following one:

location = new SimpleLocation(this, false, false, 5000);

... to request a new location every 5 seconds. This will drain the battery more than the default interval, of course. You have to try and see what works for you.

If you had the second parameter of the constructor set to true like this:

location = new SimpleLocation(this, true);

... then keep that parameter as well and just add the two false and 5000.

Please report if that worked :)

@Abhinab01
Copy link
Author

Thanks a lot.... I'll let you know if it works... :)

On 17 April 2015 at 22:44, Marco notifications@github.com wrote:

Using the JAR is fine, it's possible without changing any library code:

Right now, you're calling the constructor like this:

location = new SimpleLocation(this);

You just have to replace that call with the following one:

location = new SimpleLocation(this, false, false, 5000);

... to request a new location every 5 seconds. This will drain the battery
more than the default interval, of course. You have to try and see what
works for you.

If you had the second parameter of the constructor set to true like this:

location = new SimpleLocation(this, true);

... then keep that parameter as well and just add the two false and 5000.

Please report if that worked :)


Reply to this email directly or view it on GitHub
#3 (comment)
.

@Abhinab01
Copy link
Author

The edits you suggested, are working like a charm...! But there's a little
problem that my Mobile and some other phones keeps updating the same
location again and again until I restart my phone, but on many other phones
it does updates every 5 seconds as you suggested....

Is there a way I can correct it?

I do call location.beginUpdates(); before I start the rest of the program,
but still I receive the same locations until restarted...

Thank You. :)

On 17 April 2015 at 22:55, Abhinab Das abhinabdas001@gmail.com wrote:

Thanks a lot.... I'll let you know if it works... :)

On 17 April 2015 at 22:44, Marco notifications@github.com wrote:

Using the JAR is fine, it's possible without changing any library code:

Right now, you're calling the constructor like this:

location = new SimpleLocation(this);

You just have to replace that call with the following one:

location = new SimpleLocation(this, false, false, 5000);

... to request a new location every 5 seconds. This will drain the
battery more than the default interval, of course. You have to try and see
what works for you.

If you had the second parameter of the constructor set to true like this:

location = new SimpleLocation(this, true);

... then keep that parameter as well and just add the two false and 5000.

Please report if that worked :)


Reply to this email directly or view it on GitHub
#3 (comment)
.

@ocram
Copy link
Contributor

ocram commented Apr 21, 2015

Thanks, apparently, there's no bug here and everything is working as intended.

If you continue to have problems with some devices that use the same location again and again (what does that mean, exactly?) please check your integration and check if GPS is enabled on the device.

Should you need more help even after debugging your integration, please open a separate issue here. Thank you!

@ocram ocram closed this as completed Apr 21, 2015
@Abhinab01
Copy link
Author

Ok I'll check it, Thanks a lot anyways.. :)
On Apr 22, 2015 12:37 AM, "Marco" notifications@github.com wrote:

Closed #3 #3.


Reply to this email directly or view it on GitHub
#3 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants