Пример #1
0
  @Override
  protected void onStart() {
    super.onStart();

    // Bootstrap the OpenMobster Service in the main activity of your App
    CloudService.getInstance().start(this);
  }
Пример #2
0
  @Override
  protected void onResume() {
    super.onResume();

    // Check to make sure the App is activated with the OpenMobster Backend
    boolean isDeviceActivated = CloudService.getInstance().isDeviceActivated();
    if (!isDeviceActivated) {
      this.startDeviceActivation();
      return;
    }

    this.showBeans();
  }
Пример #3
0
    @Override
    protected String doInBackground(Void... arg0) {
      try {
        // Start device activation
        CloudService.getInstance()
            .activateDevice(
                activationRequest.getServerIP(),
                activationRequest.getPortNo(),
                activationRequest.getEmailId(),
                activationRequest.getPassword());

        // Start the local OpenMobster service after a successful activation
        CloudService.getInstance().start(HomeScreen.this);

        message = handler.obtainMessage();
        message.what = 1;

        return null;
      } catch (Exception se) {

        return se.getMessage();
      }
    }