To exchange data between apps I have created 2 applications, one is a UI application and the other is a background application, by setting an alternate entrypoint
I was able to find a similar question but was not able get the help I need there
I am able to create Global Events and a Global Listener,
but my problem is how to transfer Data from one application to another.
In UI APPLICATION we can post globalEvent
ApplicationManager.getApplicationManager().postGlobalEvent(0xba4b84944bb7);
In Background Application we can Listen and send the Acknowledgement
public void eventOccurred( long guid, int data0, int data1, Object object0, Object object1)
{
//Is this the GlobalEvent we are waiting for?
//Long = com.samples.globalEventFiring.GlobalEventListening
if (guid == 0x7d3a74a5ccfe6483L)
{
//Yes it is.
System.out.println("Acknowledgement received.");
UiApplication.getUiApplication().invokeLater(new Runnable()
{
public void run()
{
Dialog.alert("Event was fired and acknowledged.");
}
});
}
}
But how to transfer data from background application to ui application.How UI application can access data or objects of background application.