Polling GPIO in background on Android
I'm seeking an architectural advice from the developer(s) who engineered Android API.
What I'm planning to do is to connect sensor to GPIO pins which will measure some values. Now I want to constantly poll those values in Android application.
What I have in mind:
1. When app is launched, start Service, call it SensorService
2. From SensorService, bind to MetaWearBleService, register broadcast receiver.
3. Schedule polling by calling GPIO.readDigitalInput
4.Receive value with callback
So basically I want to get values from GPIO in background all the time. Is this how you would do it? I'm a bit confused by the necessity of binding from one Service to another, since this is not a common pattern in Android development(AFAIK).
Thanks in advance!
This discussion has been closed.