@Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    handler = new Handler(Looper.getMainLooper());

    devices = new ArrayList<>();
    // devices.add(new Device(1, "Z-Wave Light Bulb", false, true));

    ListView list = (ListView) findViewById(R.id.list);
    adapter = new Adapter(this, devices);
    list.setAdapter(adapter);

    // MQTT initialization
    Log.d(TAG, "Start to connect to MQTT server.");
    // connect to server
    try {
      client = new MqttAndroidClient(this, URI, CLIENT_ID);
      client.setCallback(this);
      // connect to server
      client.connect(null, this);
    } catch (MqttException e) {
      Log.d(TAG, "Error when connect to server " + URI + ", error code:  " + e.getReasonCode());
    }

    // Alljoyn initialzation
    alljoyn_wrapper = new AlljoynWrapper();

    // InviteShare Initialzation
    HttpWrapper.disableSSLCertificateChecking();
  }