Multiple (2 BLE) Sensors based off meta-wear sample App
Hi everyone, I'm pretty new to android development as a whole, but I've been playing around with the sensors and have found the meta-wear sample app extremely useful for providing documentation on how to use many features. I was wondering how I could go about connecting the second sensor in a method similar to the ScannerActivity here. I've looked at the MultiMw to try and figure it out but it seems to be implemented quite differently. Connecting this second sensor is pretty much the final piece of the puzzle for my app.
Could I implement an OnClickListener to the Listview rather than using the OnDeviceSelected to connect to the board? I would just setup the data route that way instead, have a dialogue box asking if I want to add another sensor and implement a loop with conditions on a yes or no result. If I press yes, the sensor connects and runs:
Intent navActivityIntent = new Intent(ScannerActivity.this, NavigationActivity.class);
Then i can pair a second sensor, those two lines are repeated... but this time i run the following line after the first two in order to start the activity:
Would an implementation lke this work? I'm fairly certain with traditional GATT as long as I allow one connection to finish before starting the second this would work...
Anyways let me know what you think or if i'm clearly missing something. Thanks.