publishing a message and receive when data changes

I am stuck. I am working with custom business logic. I want to publish a message after data is inserted in a Table. The message should contain the object which has been inserted. Then receive that message, get the object and do some staff(updating content provider).
My question is, when i extend BackendlessBroadcastReceiver, how do i get the object. I am subscribing to the message in onMessage(). am i doing it right?

public boolean onMessage(Context context, Intent intent) {
 Backendless.Messaging.subscribe(new AsyncCallback<List<Message>>() {
 public void handleResponse(List<Message> messages) {
 //get message details
 String header_details;
 Object dataObject = new Object();
 for (Message message : messages) {
 Map<String, String>header_map = message.getHeaders();
 dataObject = message.getData();
 header_details = header_map.get( EventPublishingHeader.getCurrentEventHeader() );
 Log.e("BROADCASTrECEIVER", ""+ (dataObject != null ? dataObject.toString() : "DATA OBJECT IS EMPTY"));
 public void handleFault(BackendlessFault backendlessFault) {
 Log.i("BROADCASTRECEIVER_E", backendlessFault.getMessage());
 return super.onMessage(context, intent);

TableEventHandler is this,

PublishOptions publishOptions = new PublishOptions();
public void afterCreate( RunnerContext context, HashMap hashmap, ExecutionResult<HashMap> result ) throws Exception
 // add your code here
 publishOptions.putHeader(EventPublishingHeader.getCurrentEventHeader(), "object_created");

EventPublishHeader is

private static String CURRENT_EVENT_HEADER = "event_happening";

I will appreciate if i get help soon… And please if you dont mind, would you guide on how to configure compilation directory for coderunner in ANDROID STUDIO please.

Thank you

CodeRunner always disconecting, here’s the project dir


You can use messaging tutorials to correctly configure messaging app
I recommend you to use IntelliJ IDEA or eclipse for code runner project.

Thanks Kate. Let me do that and I’ll let you know


When setting up a subscriber, do we extend the BackendlessReceiver and write the subscribers code there or where is the subscriber set up? or i can create a dedicated class just for that?