Skip to content

Instantly share code, notes, and snippets.

@domadev812
Forked from justinplatz/cleanup.java
Last active November 15, 2017 21:06
Show Gist options
  • Save domadev812/a056707c25b8633f751918e43ab22b3d to your computer and use it in GitHub Desktop.
Save domadev812/a056707c25b8633f751918e43ab22b3d to your computer and use it in GitHub Desktop.
public void cleanup(){
try {
JSONObject payload = new JSONObject();
JSONObject left = new JSONObject();
JSONObject right = new JSONObject();
left.put("left_yaw", 400);
left.put("left_pitch",400);
right.put("right_yaw", 400);
right.put("right_pitch",400);
payload.put("left_hand", left);
payload.put("right_hand", right);
pubnub.publish()
.message(payload)
.channel(CHANNEL)
.async(new PNCallback<PNPublishResult>() {
@Override
public void onResponse(PNPublishResult result, PNStatus status) {
// handle publish result, status always present, result if successful
// status.isError to see if error happened
}
});
} catch (JSONException e){
e.printStackTrace();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment