Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 90
Registered: ‎04-03-2012
My Device: 9100
My Carrier: movilnet

Start the UiApp with arguments from notification icon (entry point)

[ Edited ]

hi there,  i send a push notification from my server (java class), when i recive the push in the client side app  i store in the client app a instance of ApplicationIndicator and set it visible, when the notfication icon is pressed,  is defaut behavior of that event ( dunno why ) if is like istart applications with the argumens "gui" that are setup the entry point  in the xml file.

  

the question is how i open the Uiapp, like above ) with some argumes ??? where i can use the appManager to achieve this, if that is the wahy  ??? i read something about use the AppManager with a template if the UIApp is alredy open is that right??

Developer
Posts: 692
Registered: ‎08-09-2010
My Device: Not Specified

Re: Start the UiApp with arguments from notification icon (entry point)

Hello,

 

    Please follow below step.

 

   Set the Icon

	ApplicationDescriptor appDescriptor = getAppDescriptor();

					HomeScreen.updateIcon(bit, appDescriptor);

    

    

	private ApplicationDescriptor getAppDescriptor() {
		int codeModuleHandle = CodeModuleManager.getModuleHandle("name");
		ApplicationDescriptor[] apDes = CodeModuleManager
				.getApplicationDescriptors(codeModuleHandle);
		ApplicationDescriptor appDescriptor = new ApplicationDescriptor(
				apDes[0], new String[] { "init" });

		return appDescriptor;

	}

   

     and write below code into constuctor or into main

 

    

net.rim.blackberry.api.homescreen.HomeScreen.updateIcon(Bitmap
				.getBitmapResource("Icon.png"));

 

Thanks.

---------------------------------------------------------------------------------------------------------------------------------------

 

feel free to press the like button on the right side to thank the user that helped you.

Developer
Posts: 90
Registered: ‎04-03-2012
My Device: 9100
My Carrier: movilnet

Re: Start the UiApp with arguments from notification icon (entry point)

private ApplicationDescriptor getAppDescriptor() {
		int codeModuleHandle = CodeModuleManager.getModuleHandle("name");
		ApplicationDescriptor[] apDes = CodeModuleManager
				.getApplicationDescriptors(codeModuleHandle);
		ApplicationDescriptor appDescriptor = new ApplicationDescriptor(
				apDes[0], new String[] { "init" });

		return appDescriptor;

	}

i understand the above code, my problem is  where to put that code with the push  arguments that i send from the server, and later recive in the client app.

 

Developer
Posts: 90
Registered: ‎04-03-2012
My Device: 9100
My Carrier: movilnet

Re: Start the UiApp with arguments from notification icon (entry point)

help plox !!!

Developer
Posts: 16,986
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Start the UiApp with arguments from notification icon (entry point)

while it is possible to do that, i think you would do better with another approach.
you can launch the main app normally and send a global event, for example.
or you can store the data in runtimestore and launch the app then, check for the data and do something different if it is there.

the problem with launching different entry points is that they all represent own application processes, that means you could have both the normal (user started) and your special entry point running as basically the same application at once.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 90
Registered: ‎04-03-2012
My Device: 9100
My Carrier: movilnet

Re: Start the UiApp with arguments from notification icon (entry point)

you can launch the main app normally and send a global event

 

well i know how to implement the GlobalEvent  interface Smiley Happy, the thing is where send the postglobalevent??? how you do in urs app?? because I do not know how to handle/manage  the menotification has u see in the attachment

Developer
Posts: 16,986
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Start the UiApp with arguments from notification icon (entry point)

you can take a look at the messagelist demo, it explains how to integrate with the message list (which is the dropdown from the notification indicators since os 6).
it is a bit complicated, don't hesitate to ask if you have any issues with it.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 90
Registered: ‎04-03-2012
My Device: 9100
My Carrier: movilnet

Re: Start the UiApp with arguments from notification icon (entry point)

well i must stay stick to jdk 5.0 so i cant implement that feature rigth now, then the only way that i have to achieve the "full" push funcionality in my app is that a 2 new approach u said 2 post befeore, the first one is about implement GlobalEvent Listener  ( i know how to do it ) but i dont know how to post the event should be when the user click the the notification icon  or where?? ?? .

 

the second approach sounds dirty but, i can see how to do it store the push info in the runtimesore then when the gui app is open check the info and redirect the UI.

Highlighted
Developer
Posts: 16,986
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Start the UiApp with arguments from notification icon (entry point)

let's clarify what you mean with notification icon.
you mean the application indicator, for example the little message symbol on the top part of the homescreen when a new message is there, correct?

the click handling for those is not possible in OS 5, it was added in OS 6 using http://www.blackberry.com/developers/docs/7.1.0api/net/rim/blackberry/api/messagelist/ApplicationFol...

we use a preprocessing construction to use a message folder integration for OS 5, and a message AND homescreen integration for OS 6. I say homeScreenIntegration because that is the name used in the API.

You have two options:
- build two versions, one for OS 5, one for OS 6+, using preprocessing
- just notify the user (with the indicator), he would have to click your application icon to see the new message

you could change (replace) the icon of your app, for example, to show that there are new messages. there is, again, an API to show a notification on the app icon, but that was introduced with 6.0 as well Smiley Happy
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter