Information générale
Catégorie:
Codage, syntaxe et commandes
>>>>>had a look - it uses an array
>>>>
>>>>But claims to be far more efficient than using the native behaviour ?
>>>>
>>>
>>>Dunno - but if you only keep 5 to 10 items - what difference will it make ?
>>
>>True. Probably not worth worrying about. I'm going to try with a stack of 10 which equates (roughly) to averaging over the last second. But the GPS interval of 20 secs is too long to wait to update the display so I'll use my own timer - I think I'll initially try using 5 second intervals.
>
>You're doing the updates from the direction readings ? Why is the GPS interval important ?
I was thinking of averaging the array and updating the display only when the GPS event fired to avoid adding my own timer - but 20 secs is too long ......
>
>>>>BTW, another quirk (at least on Nexus 7):
>>>>
>>>>I've got energy saving configured to shut down the screen after a couple of mins. inactivity. When the screen shuts down GPS readings stop coming in - but orientation continues for about another 5 mins (by which time it's accumulated about 5000 events :-{ )
>>>
>>>
>>>>Don't know why it stops at that point - maybe some other power-saving setting.....
>>>>
>>>>Same thing if I switch to a different app - gps stops, orientation continues .....
>>>
>>>Is that a problem ?
>>
>>No, guess not. Biggest problem I anticipated was if orientation stopped coming in when it was not changing - but that turns out to not be the case (at least on the Nexus - but this may not be true of other devices....)
>
>
>In both cases (inactivity, switched to another app ), no one is watching the screen anyway
But they are still walking so I need to keep the array up-to-date to give a good result when the screen is back on ?
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement