Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Oiling my tablet
Message
De
29/04/2013 07:32:52
 
 
À
29/04/2013 07:21:18
Information générale
Forum:
Javascript
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01572116
Message ID:
01572133
Vues:
34
>>>>>>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 ?

Ok, but with the screen off, the orientation keeps coming in, so you keep updating the screen - that no one is watching

Also, I would not update if the orientation hasn't changed since the previous update (ie I am stationary)

Well, you have to decide on an update interval. You'll have to test some whilst walking and see which one seems the best. Enjoy the walk
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform