Creating your Activity

This is how you must implement your activity, after connection you can send command or get information from microbees system.
Demo code


public class MainActivity extends AppCompatActivity implements MyBeesClientAndroid.OnConnection {
MyBeesClientAndroid myBeesClientAndroid =null;
MyBeesAction action=null;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
myBeesClientAndroid =new MyBeesClientAndroid(this);
myBeesClientAndroid.addConnectionCallbacks(this);
myBeesClientAndroid.connect();
}

@Override
protected void onDestroy() {
super.onDestroy();
myBeesClientAndroid.closeConnection();

}

@Override
public void onConnectionSuccess() {
action=myBeesClientAndroid.getAction();

action.send("/getMyprofile", new AsyncResponse() {
@Override
public void OnResponseSuccess(JSONObject response) {
Log.d("response",response.toString());

}

@Override
public void OnResponseFailed(String error) {
Log.d("response",error);
}

});

}

@Override
public void onConnectionFailed(String error) {
Log.d("Error",error);
}

}

With this :


actuators.getData()[0].getId();

You can see complete list of all REST API here.