Thank you for visiting the BlackBerry Support Community Forums.
BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)
BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.
"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."
- Kevin Michaluk, Founder, CrackBerry.com
Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.
04-12-2010 04:42 AM
Dear BB Developers,
I am currently creating an application that will use 2 applications: 1 for the GUI and 1 application for the push listener (auto start and always run in the background, and I do not want the application icon appear in the ribbon). The background application will,
I've searched for some -what they say useful- articles, but I still have some questions on how to do that. So please don't refer me to such articles and I prefer to see some working code and good guide on how to do that from the start.
Article DB--00157 tells about how to create background app and UI app, but the code snippet is too few I just don't understand what type of application should the background listener be.
The article said that we have to reference each application to each other. If I add the UI project to the listener build path, and the listener project to the UI project build path, it will be an error. And If I only add those projects to the project reference (in the project properties), I cannot create the reference in the code.
DB--00406 is about folder listener, and it is actually only one application. I don't like this idea, I really need 2 separate application
Solved! Go to Solution.
04-12-2010 04:53 AM
applications can communicate on different ways. the easiest way would be to send global events.
you can create your pushlistener as an own application and start it in an autostart entry point of your app.
send a global event to your UI app (which has to implement GlobalEventListener and add itself as a listener).
if global events offer too few possibilities you can also use the runtimestore.
04-12-2010 05:02 AM
Any links about that thing called 'Global Events'? Any code snippet?
i see, so the background application auto-start is configured in the project properties. And how do the background application calls the GUI application? How do they reference the UI application?
I still don't get it how I should do this.
04-12-2010 05:10 AM
to communicate using global events you first device a long as a GUID. in the jde/ejde there is a tool to convert strings to longs, usually you use the package name + the event name.
to send a global event you use the applicationmanager.
there are several methods that allow you to add a payload:
in your UI application implement GlobalEventListener and use this code:
in the eventOccured method you get the GUID of the occured event, check if it is MY_GUID and do your processing
04-19-2010 02:29 AM
Still got some more questions:
1. If both of the application has been finished, how to deploy them as one installer anyway? So when people want to install my application, they don't have to install twice
2. I am still not sure about the advantages of having separate push listener application. Can someone show me what makes it better?
04-19-2010 03:47 AM
depends on your use-case if you want separate apps or not.
you can use alternate entry points to have more than one app in one application.
or you can distribute multiple cods with one alx or jad.