ScanActivity.class Alternative in Myo Android API

624 Views Asked by At

I'm currently looking through the Myo Android SDK sample HelloWorld application. It uses the following code to connect to the Myo armband. This method is called after the user selects "Scan" from the options menu.

private void onScanActionSelected() {
    // Launch the ScanActivity to scan for Myos to connect to.
    Intent intent = new Intent(this, ScanActivity.class);
    startActivity(intent);
}

The full example can be found here.

This requires the user to choose the Myo armband through a menu. Is there any way to bypass this and automatically connect to a specific Myo armband?

1

There are 1 best solutions below

0
On

Yes, in addition to the Scan Activity, you can pair with nearby Myo armband using the following two methods:

hub.attachToAdjacentMyo();

This allows you to pair Myo that is very near (almost touching) the Android device.

hub.attachByMacAddress();

This allows you to pair with a specific Myo armband, defined by the armband's Mac Address.