ifaz / little-fluffy-location-library

Automatically exported from code.google.com/p/little-fluffy-location-library
0 stars 0 forks source link

Location not getting updated #9

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Following logs are recorded:

"LocationBroadcastService: Force a single location update, as current location 
is beyond the oldest location permitted"
I am getting this log again and again. Location not getting updated. I tried 
the sample app you have provided.

What is the expected output? What do you see instead?
I was expecting location. instead i get logs i mentioned above,

What version of the product are you using? On what operating system?
Can be reproduced on almost all the devices randomly. from 2.2 to 4.1. 
Reproduced on s3 as well.

Please provide any additional information below.

Original issue reported on code.google.com by kapil.ga...@gmail.com on 28 Feb 2013 at 9:51

GoogleCodeExporter commented 9 years ago
It's something wrong with Android I guess... I have the same problems with 
little fluffy location library sometimes. Try to use another location-apps in 
that moment. You will see that Google Maps is only one app that works properly. 
Some others can't fetch your location too...

Original comment by froger.mcs on 1 Mar 2013 at 11:54

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
It seems quite inconsistent as well. My location was changing every second as i 
was travelling. I set alarmFrequency and locationMaximumAge as 5 minutes.I was 
carrying multiple devices.  But on some devices i am getting changed location 
every 10 minutes instead of 5 minutes. I got changed location sometimes in 7 
minutes as well. On one device i did not got location at all. On some devices 
it was working fine.
If i use any other app side by side which request location, it start behaving 
properly. i got changed location every 5 minutes. As i set locationMaximumAge 
as 5 minutes, i was expecting to get location after every 5 minutes 
irrespective of whether any other app requesting location or not. 

Other apps are working fine at that time. In fact if i start using any other 
app side by side(which req location), i get proper location using this library.

Seems like its forceUpdate not working properly.

Original comment by kapil.ga...@gmail.com on 7 Mar 2013 at 2:54

GoogleCodeExporter commented 9 years ago
I have sometimes the same problem too..
I try it in emulator with telnet gps coordinates.

Original comment by syt...@gmail.com on 26 Mar 2013 at 5:03

GoogleCodeExporter commented 9 years ago
03-26 18:56:00.984: DEBUG/LittleFluffyLocationLibrary(877): 
LocationBroadcastService: Single Location Update Received: 
39.64112333333333,-98.42651333333333
03-26 18:56:01.004: DEBUG/LittleFluffyLocationLibrary(877): 
LocationBroadcastService: onDestroy
03-26 18:56:02.004: DEBUG/LittleFluffyLocationLibrary(877): 
LocationBroadcastService: onStartCommand
03-26 18:56:02.033: DEBUG/LittleFluffyLocationLibrary(877): 
LocationBroadcastService: No new location update found
03-26 18:56:02.033: DEBUG/LittleFluffyLocationLibrary(877): 
LocationBroadcastService: Force location updates (pre-Gingerbread), as current 
location is beyond the oldest location permitted
03-26 18:56:02.084: DEBUG/LittleFluffyLocationLibrary(877): 
LocationBroadcastService: Single Location Update Received: 
39.624465,-98.46050166666667
03-26 18:56:02.104: DEBUG/LittleFluffyLocationLibrary(877): 
LocationBroadcastService: onDestroy
03-26 18:56:03.113: DEBUG/LittleFluffyLocationLibrary(877): 
LocationBroadcastService: onStartCommand
03-26 18:56:03.143: DEBUG/LittleFluffyLocationLibrary(877): 
LocationBroadcastService: No new location update found
03-26 18:56:03.143: DEBUG/LittleFluffyLocationLibrary(877): 
LocationBroadcastService: Force location updates (pre-Gingerbread), as current 
location is beyond the oldest location permitted

bit the location is not Broadcast and saved - LocationInfo don`t hold it.

Original comment by syt...@gmail.com on 26 Mar 2013 at 5:06

GoogleCodeExporter commented 9 years ago
How to fix this. add in you Application onCreate() metod after 
initialiseLibrary this:
LocationLibrary.startAlarmAndListener(getBaseContext());

Original comment by syt...@gmail.com on 26 Mar 2013 at 6:33

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Actually, it appears that even the forced updates (claimed by this library 
don't work unless your app (or another app) is reading the GPS coordinates.  I 
tried firing up the LittleFluffyTestClient on my Google Nexus 7 with GPS 
systems enabled, with no other GPS-enabled apps running - click "Force 
location" - nothing happens.  

If I start another app that uses non-passive GPS (Waze, Google Maps/directions, 
or one of my GPS test apps) then Little Fluffy Test Client receives and 
displays GPS data.  

I'm not sure how to interpret all this, as the project docs don't provide much 
in the way of design and theory of operation.  All I know is my app never 
receives any updates (forced or otherwise) if some other app isn't *actively* 
reading the GPS receiver.

So, is a forceLocationUpdate() call *supposed* to force an immediate update 
(including initializing the GPS system if it's not running?)  Or are client 
apps supposed to implement their own active GPS polling in order to force an 
update?

Original comment by inactiv...@gmail.com on 9 Apr 2013 at 3:45

GoogleCodeExporter commented 9 years ago
Sorry, this hasn't had a lot of love lately. It will get revisited later this 
month when I'll be using it in a high-profile project. From the comments so 
far, #6 is correct - you definitely want to initialise it in your application 
object. #8 sounds like a bug, but given it does work for nearly everyone else 
the chances are it's PBKC ;) Try turning on logging and outputting it in a 
comment here. forceLocationUpdate() is meant to request a location update, wait 
for the updates to stabilise, and then within 30 seconds it will make its way 
back to your app. Google changed a lot in this area between 4.2.1 (where they 
totally broke it) and 4.2.2 where it should have been fixed. But like I said, 
I'll be doing a lot of investigations into it later this month.

Original comment by ken...@kentonprice.com on 9 Apr 2013 at 3:50

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I've just run the test client on a Nexus 7 and a Nexus 4 both running stock 
4.2.2 and it works exactly as expected. Click force location, and 30 seconds 
later it shows the update on the screen and in the notification bar.

Original comment by ken...@kentonprice.com on 9 Apr 2013 at 4:26

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
The test client works fine on a Nexus 4 and Nexus 7. Please try the test client 
and tell me what happens.

Original comment by ken...@kentonprice.com on 9 Apr 2013 at 9:41

GoogleCodeExporter commented 9 years ago
@kenton - thanks for the update.  I have tried the test client (downloaded from 
https://code.google.com/p/little-fluffy-location-library/downloads/list) -- 
Perhaps there's some other problem with my system.

I suppose I'll have to try it on another device, or do a factory reset and see 
what happens.

Original comment by inactiv...@gmail.com on 9 Apr 2013 at 9:46

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Try the APK I just put into downloads. What happens with that when you click on 
force location?

Original comment by ken...@kentonprice.com on 9 Apr 2013 at 9:52

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Who is "inactivist" and who is "thatmichaelcurry"? Are they the same person?

There's nothing here I can help with. The test APK posted works absolutely 
perfectly on a stock Nexus 4 and Nexus 7, as well as the millions of other 
devices it's installed in. You need to debug it on your device, understand the 
code, and work out why it doesn't work for you. You will need to learn about 
one-shot updates, discover where in the code they are used, and work out why it 
doesn't work on your device.

Original comment by ken...@kentonprice.com on 10 Apr 2013 at 9:31

GoogleCodeExporter commented 9 years ago
@kenton, 

Yes, I was logged in to another gmail account (two different machines).  I 
apologise for any confusion this may have caused.

In any case, thanks for your help.  Of course I'll dig in and try to figure out 
why it's not working on my machine -- all I was looking for was guidance on 
what to expect, and you've provided that.  Thanks again.

Original comment by inactiv...@gmail.com on 10 Apr 2013 at 1:00

GoogleCodeExporter commented 9 years ago
I can confirm that test sample and also apk don't get location on htc desire C 
with android 4.0.3

Original comment by martin.v...@gmail.com on 17 Apr 2013 at 6:31

GoogleCodeExporter commented 9 years ago
Interesting:

On a hunch, I modified LocationBroadcastService.forceLocationUpdate() to use 
criteria.setAccuracy(Criteria.ACCURACY_FINE) (as opposed to ACCURACY_COARSE).

Result: the GPS receiver is enabled (the notification area shows the GPS 
activity indicator) and my test app receives a location update via my 
LOCATION_CHANGED receiver callback once the GPS location is known.

Original comment by inactiv...@gmail.com on 23 Apr 2013 at 2:47

GoogleCodeExporter commented 9 years ago
I guess it's possible that if the only location providers available are fine 
ones (e.g. GPS but not wi-fi or celltower), then it could fail to give a coarse 
reading as it requests. Needs testing to see if that's the case. If so, I guess 
the solution would be to test what providers are available, and if only fine 
then ask for fine.

Original comment by ken...@kentonprice.com on 1 May 2013 at 8:18