geeksville / Gaggle

An Android application for glider pilots
http://groups.google.com/group/gaggle-users/
33 stars 16 forks source link

Display Barometer status, and FlyNet tweaks #70

Closed relet closed 12 years ago

relet commented 12 years ago

A simple status message that can display the name and/or status of the barometer used next to the reading.

For FlyNet, it displays "? FlyNet" if the driver is chosen, but it is searching the device, and "+ FlyNet" if it is connected and has readouts. For the other barometers, I set a default status message to "CNET" or "int." respectively.

Also, disables FlyNetBarometer observer thread when no observers are present, to conserve battery.

Flight tested at: http://www.paraglidingforum.com/leonardo/flight/628649 ;)

dkm commented 12 years ago

Hey !

I've read your patch, and I have a little comment. I see that your keep a reference to context within the activity. From the very little I've read, I've understood that this is not a good idea, as the context may change (screen orientation for example) and this reference will prevent the gc from freeing memory. See : http://android-developers.blogspot.fr/2009/01/avoiding-memory-leaks.html

Maybe this reference could be removed (you don't even use it) ?

relet commented 12 years ago

Certainly, I don't use it at all. I think it was legacy code that came with the CNET barometer code.