Exemplo n.º 1
0
  @Override
  public void onCreate() {
    super.onCreate();

    // First, we initialize the Hub singleton with an application identifier.
    Hub hub = Hub.getInstance();
    if (!hub.init(this, getPackageName())) {
      showToast("Couldn't initialize Hub");
      stopSelf();
      return;
    }

    // Next, register for DeviceListener callbacks.
    hub.addListener(mListener);

    // Finally, scan for Myo devices and connect to the first one found.
    hub.pairWithAnyMyo();
  }