BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 03-25-2009, 04:29 PM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 9530
PIN: N/A
Carrier: Telus
Posts: 107
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question Run Application in Background

Please Login to Remove!

Hello Everyone

I have an application with user interface and it implements PhoneListener. I want to run that application in the background and bring in front when user selects from the icon or from swtich tab.

How do I achive this?

Thanks
Offline  
Old 03-25-2009, 06:52 PM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Nov 2008
Location: Sioux Falls, SD
Model: 9530
PIN: N/A
Carrier: Verizon Wireless
Posts: 65
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

So your class looks like the following?

Code:
public class MyClass extends UiApplication implements PhoneListener
That should be all you need to do what you're describing. Unless I'm missing something...
__________________
Handspring >> Palm >> BB Pearl >> BB Storm

Tumblog: http://www.geekkink.com
Blog: http://www.zechariahs.org/blog
Offline  
Old 03-25-2009, 07:03 PM   #3 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 9530
PIN: N/A
Carrier: Telus
Posts: 107
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the input zechariahs.

I know how to implement PhoneListener. I want to run the application in the background and bring to front when user selects the icon or from swtich tab.

Thanks
Offline  
Old 03-25-2009, 07:17 PM   #4 (permalink)
Thumbs Must Hurt
 
Join Date: Nov 2008
Location: Sioux Falls, SD
Model: 9530
PIN: N/A
Carrier: Verizon Wireless
Posts: 65
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try this How To - Setup an alternate entry point for my application.

Quote:
Alternate Entry Points can be used to launch the user interface (UI) component of the auto-started application when the user selects the icon from the ribbon.
__________________
Handspring >> Palm >> BB Pearl >> BB Storm

Tumblog: http://www.geekkink.com
Blog: http://www.zechariahs.org/blog
Offline  
Old 03-25-2009, 07:37 PM   #5 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 9530
PIN: N/A
Carrier: Telus
Posts: 107
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks zechariahs.

I understand what is explained in the document. But, what do I need to do from application getting closed using "Close" menu.

Thanks
Offline  
Old 03-25-2009, 08:23 PM   #6 (permalink)
Thumbs Must Hurt
 
Join Date: Nov 2008
Location: Sioux Falls, SD
Model: 9530
PIN: N/A
Carrier: Verizon Wireless
Posts: 65
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

From a user perspective, I would be pretty ticked if I couldn't close an application if I wanted to. Personally, I would override the onClose() method to prompt the user: "Are you sure you want to close? Yes | No | Cancel."

Also, if you really want to prevent the user from closing the application, override the onClose method to always return false.
__________________
Handspring >> Palm >> BB Pearl >> BB Storm

Tumblog: http://www.geekkink.com
Blog: http://www.zechariahs.org/blog
Offline  
Old 03-25-2009, 08:25 PM   #7 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 9530
PIN: N/A
Carrier: Telus
Posts: 107
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks zechariahs.

Thats what I did.
Offline  
Old 03-25-2009, 10:25 PM   #8 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

To put an application in the background call Application.requestBackground(), possibly as mentioned in the onClose() method.
Offline  
Old 06-15-2009, 04:35 AM   #9 (permalink)
Knows Where the Search Button Is
 
Join Date: Jul 2008
Location: India
Model: 9000
Carrier: AirTel
Posts: 29
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I too need the same idea, that i have an icon When i am pressing the icon, i need to invoke an sms application which is running background. When i am exiting and later on coming bak , i need to keep the same screen alive , from where i exit.
__________________
Praveen K
Offline  
Old 06-15-2009, 04:36 AM   #10 (permalink)
Knows Where the Search Button Is
 
Join Date: Jul 2008
Location: India
Model: 9000
Carrier: AirTel
Posts: 29
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

if anyone knows pleas provide a sample code too..
Thanks
__________________
Praveen K
Offline  
Old 06-16-2009, 03:48 AM   #11 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2007
Location: Ernakulam, Kerala, India
Model: 8320
Carrier: Airtel
Posts: 65
Post Thanks: 0
Thanked 0 Times in 0 Posts
Post

Hi pravi

You just need to override the onClose() method for doing that, as mentioned above.
__________________
Regards
Anand.
Offline  




Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.