Hi, The problem is that location.getTime() returns UTC timestamp. You have to convert it in a GMT timestamp.
If you already solved the problem could you please post the solution. thx regards Fabi On 12 Apr., 20:54, Lukasz <[email protected]> wrote: > Hi, > > I am trying to implement some functionality using GPS in Android > emulator. To set my current position I am using geo fix command > invoked after telneting to localhost 5554. To fulfill my requirements, > after receiving GPS location I am checking its timestamp (using > location.getTime()) to invoke some action when location fix is older > than 10 minutes. > > My intuitive assumption was that the timestamp is set to the time of > invoking geo fix command in the emulator. Unfortunately it works in > the following way: year, date and month are set for the current day, > hours and minutes are zeroed and seconds are set as a sequence number > increased after every invocation of geo fix command starting from 0 > (from midnight). For example when running my application today i get > the following values: > > I invoke geo fix for the 1st time and location.getTime() returns: > 1271030400000, which means Mon, 12 Apr 2010 00:00:00 GMT > I invoke geo fix for the 2nd time and location.getTime() returns: > 1271030401000, which means Mon, 12 Apr 2010 00:00:01 GMT > I invoke geo fix for the 3rd time and location.getTime() returns: > 1271030402000, which means Mon, 12 Apr 2010 00:00:02 GMT > I invoke geo fix for the 4th time and location.getTime() returns: > 1271030403000, which means Mon, 12 Apr 2010 00:00:03 GMT > ... > > This behaviour means that I can test positive scenario in my > application only in first 10 minutes after midnight everyday, which is > quite inconvenient for me ;) Any idea how can I solve that problem? > > Thank you for your help, > Lukasz. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

