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
neoknip
Posts: 38
Registered: ‎10-27-2010
My Device: Blackberry Torch 9800

Re: How to avoid creating two instances of the application , when using alternate entry point?

As per my current application, i have one more issue. When i try to push a global screen from the sms listener thread, it is creating a runtime exception (pushglobalscreen(modal) called by a non-event thread). eventhough i am getting the event lock, i am getting this run time exception.

 

 

May be i should create two application as per Hithredin suggestion...

one extending application (for sms listener and sms sender)

and one extending UiApplication (for GUI)

 

For communicating between the two application, can i use the global event and listener concept?

 

But if i have two applications, My basic doubts and concerns are

 

1) My one requirement is tat.. when the bacground sms listener detects an incoming message(and the GUI application is not active), then i should display a global popup(with yes or no options for opening the GUI application). when user selects yes, is it possible to run the GUI application through the ApplicationManager?

2) If i have two applications, how can i package it as a single application for mobile deployment? how can i have it as a single project?

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: How to avoid creating two instances of the application , when using alternate entry point?

1) yes. you can use Ui.getUiEngine().pushGlobalScreen to push a screen from a background application. 2) alternate entry point
----------------------------------------------------------
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
neoknip
Posts: 38
Registered: ‎10-27-2010
My Device: Blackberry Torch 9800

Re: How to avoid creating two instances of the application , when using alternate entry point?

 

Thanks simon, i ll try it out .. Creating two applications instead of single application. 1) can i use application manager to launch the gui application from the background application? 2) if i use alternate entry point, i ll have to have only one public void main, either in background app or the gui app?

Developer
neoknip
Posts: 38
Registered: ‎10-27-2010
My Device: Blackberry Torch 9800

Re: How to avoid creating two instances of the application , when using alternate entry point?

Thanks guys, for helping me out...

To solve the exception issue (runtiem exception : push global screen called from non event thread), i used global event to avoid pushing the global screen from the background thread. I was able to push the global screen from the event thread itself.

 

I might try the two app method(which seems more efficient) ... after completing the current project .......