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
[code lang=”Java” style=”line-height:10px”]
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);
}

}

[/code]

With this :
[code lang=”Java”]
actuators.getData()[0].getId();
[/code]

You can see complete list of all REST API here.