BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 05-31-2007, 05:41 PM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Aug 2006
Model: 7105T
Carrier: T-Mobile
Posts: 19
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Keeping an App Running In The Background

Please Login to Remove!

Ihave a need to run an app in the background after it has been "closed." Is this possible with the BB API?
Offline  
Old 05-31-2007, 07:27 PM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2005
Model: Many
Carrier: Sprint
Posts: 1,475
Post Thanks: 0
Thanked 6 Times in 5 Posts
Default

Hitting the Alt and Escape key typically puts apps in the background.
Offline  
Old 05-31-2007, 11:33 PM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Aug 2006
Model: 7105T
Carrier: T-Mobile
Posts: 19
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default What about programmatically?

What about programmatically? I'd like to avoid telling a user how to do it and just set them in the mode when they hit cancel (a dialog would of course alert them first).

This is a GPS app that needs to keep tracking while allowing a user to continue to use their BB.
Offline  
Old 06-01-2007, 01:59 AM   #4 (permalink)
Talking BlackBerry Encyclopedia
 
Skipper_Joe's Avatar
 
Join Date: Jan 2007
Location: Kharkov, Ukraine
Model: 8300
Carrier: N/A
Posts: 237
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

just call Application.getApplication().requestBackground() instead of System.exit(0)
Offline  
Old 08-01-2007, 11:50 AM   #5 (permalink)
Talking BlackBerry Encyclopedia
 
7100simpleisbetter's Avatar
 
Join Date: Mar 2005
Model: 8120
PIN: Cushion
Carrier: TMobile
Posts: 355
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Skipper_Joe View Post
just call Application.getApplication().requestBackground() instead of System.exit(0)
I am using NetBeans to compile my project and I get the following error using this string:

C:\projectfolder\program.java:64: cannot find symbol
symbol : method requestBackground()
location: class Program
Application.getApplication().requestBackground();

Any help would be great
Offline  
Old 08-01-2007, 12:37 PM   #6 (permalink)
CrackBerry Addict
 
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Posts: 714
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

just do a alt-shift-f to fix the imports

i'm assuming you're using rims api and not writing a midlet?
__________________
new job doesn't allow a public profile - please do not contact this user with questions, you will not get a response. good luck!
Offline  
Old 08-01-2007, 05:15 PM   #7 (permalink)
Talking BlackBerry Encyclopedia
 
7100simpleisbetter's Avatar
 
Join Date: Mar 2005
Model: 8120
PIN: Cushion
Carrier: TMobile
Posts: 355
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by jfisher View Post
just do a alt-shift-f to fix the imports

i'm assuming you're using rims api and not writing a midlet?
I am actually writing midlet. It works great but the only thing I can't figure out is when I hit the end button or try to put the application in the background it completely resets the application to the home screen. Any help would be appreciated.

Is there a way to convert a midlet to rims api so I don't have to rewrite the entire code and also take advantage of rims apis?

Last edited by 7100simpleisbetter : 08-01-2007 at 06:18 PM.
Offline  
Old 08-01-2007, 10:46 PM   #8 (permalink)
Talking BlackBerry Encyclopedia
 
Skipper_Joe's Avatar
 
Join Date: Jan 2007
Location: Kharkov, Ukraine
Model: 8300
Carrier: N/A
Posts: 237
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

There is no way to automaticall convert rim api to midlet api.

But you can try method MIDlet.notifyPaused(), it should pause application.
Offline  
Old 08-02-2007, 04:32 AM   #9 (permalink)
CrackBerry Addict
 
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Posts: 714
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

but the app won't continue to run in the background then?

i don't know how to move a standard midlet to the background and have it still run so can't help you there i'm afriad
__________________
new job doesn't allow a public profile - please do not contact this user with questions, you will not get a response. good luck!
Offline  
Old 08-19-2007, 05:37 PM   #10 (permalink)
Talking BlackBerry Encyclopedia
 
Skipper_Joe's Avatar
 
Join Date: Jan 2007
Location: Kharkov, Ukraine
Model: 8300
Carrier: N/A
Posts: 237
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

sorry for delay with answer - was an vacation.

As far as I understand, it depends on java VM implementation if app runs in paused state or not. There no specific behavior defined in MIDP spec.
I did small sample for BlackBerry - it shows, that BB runs midlet in background after notifyPaused() call and midlet can execute tasks in background - similar to UiApplication.
So this is ok for 7100simpleisbetter problem
Offline  




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