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
Contributor
akhilmuppa
Posts: 41
Registered: ‎11-18-2012
My Device: blackberry sms message making

how to run a application in background?

I have created a application which sends sms messages and it has a schedule option were we can schedule it by selcting date and time even that runs pretty good but i want to run my application in background.

for example if i write a sms and if i schedule it after 3 min ,the sms will go only if my application is open if i exit my application it doesnt works..So i want it to work even if i exit my application..

 

So please any one help me to do this...

 

Even i have searched some sites but i dint get the clear idea...So please help me 

Developer
myraddin
Posts: 412
Registered: ‎09-12-2008
My Device: 9000 9810

Re: how to run a application in background?

You gave little info but judging from what you said I would suggest you do not close your app when User clicks ESC.

 

Try overriding the onClose of your main screen:

 

public boolean onClose()
{
    UiApplication.getUiApplication().requestBackground();
    return true;
}

  That way your app is alive in the background and the SMS sender will continue its work.

 

 



"Listen carefully, I shall say this only once"
Contributor
akhilmuppa
Posts: 41
Registered: ‎11-18-2012
My Device: blackberry sms message making

Re: how to run a application in background?

yeahh i know that way ..but their is another way by  using application instead of taking Uiapplication..

By taking application we can put our app to work in background...

 

So can you help for that

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

Re: how to run a application in background?

maybe you can describe your request in more detail, because at the moment i have no idea what you mean.

if your application has an UI it is most likely an UiApplication, and for that you just use requestBackground to let it run in the background.

You could use an alternate entry point to create an Application instance to run as a background process, see http://supportforums.blackberry.com/t5/Java-Development/Set-up-an-alternate-entry-point-for-an-appli...
----------------------------------------------------------
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
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: how to run a application in background?

You can help yourself.  Just use the Search box and look for background application.