For the Karma Android (and iOS app) we need to update the hotspot status every second. We'll consider the exact implementation a detail suffice to say that every second some callback needs to be triggered that performs the necesary update. I'm writing this gist to try and explain what I'm trying to do and to get feedback on my approach from experienced developers.
- The main activity has an instance of a
HotspotStatusUpdater
class (initialize inonCreate
) - In
onResume
I callhotspotStatusUpdater.startUpdatingHotspotStatus(this);
(this
is a callback that implements theHotspotStatusCallback
interface) - In
onPause
I callhotspotStatusUpdater.stopUpdating()
;