BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 04-11-2008, 06:44 AM   #1 (permalink)
New Member
 
Join Date: Apr 2008
Model: 8300
PIN: N/A
Carrier: Vodafone
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question autostart uiapplication

Please Login to Remove!

hola,
I'm new on blackberry development...
I need to start an UI application when bb start.
I try with JDE (check auto start) and the application start but not in foreground and i need this.
It's possible to do?
I read a lot of post about this but none of the solutions works.
Thanks a lot for help and sorry for my english
Offline  
Old 04-11-2008, 07:40 AM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: May 2007
Location: Bulgaria
Model: none
PIN: N/A
Carrier: Mtel
Posts: 150
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can look the BlackBerry API for that classes:

- net.rim.device.api.system.ApplicationManager
- net.rim.device.api.system.ApplicationDescriptor
- net.rim.device.api.system.Application.

Maybe you will find there the right solution. I have just made the application to be started at specific time. Good luck !
Offline  
Old 04-11-2008, 09:57 AM   #3 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

afaik autostart applications do never start in foreground. you can try and call requestForeground() from your application
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 04-17-2008, 11:37 AM   #4 (permalink)
New Member
 
Join Date: Apr 2008
Model: 8300
PIN: N/A
Carrier: Vodafone
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question

The problem is that when i call pushscreen or requestforeground the blackberry still on startup process... (i set my project as run on startup).
I try with this
... instantiate the screen ...
while(ApplicationManager.getApplicationManager().i nStartup()){
try{
Thread.sleep(100); //without this i block the startup process
}catch(InterruptedException e){}
}
pushScreen(myscreen);
requestForeground();

and it work but it's horrible...
any better idea?
p.d. the application start normally but i need to start in foreground as first application
Offline  
Old 04-17-2008, 12:34 PM   #5 (permalink)
Talking BlackBerry Encyclopedia
 
richard.puckett's Avatar
 
Join Date: Oct 2007
Location: Seattle, WA
Model: 9020
PIN: N/A
Carrier: T-Mobile
Posts: 212
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Not saying it's not horrible, but that's the same method RIM recommends using to check for startup completion. Would be handy if there was a system listener one could implement to get notified of this event.
__________________
Do your homework and know how to ask a good question.
Offline  
Old 04-18-2008, 04:03 AM   #6 (permalink)
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think :

When you start the application using Autostart, Application starts in background
write a method like this and invoke it...

fitst:

Application.getApplication().getProcessId();

then:

public static void setApplicationToForeground(int appProcessID) {
ApplicationManager manager = ApplicationManager.getApplicationManager();
manager.requestForeground(appProcessID);
}
Offline  
Old 04-18-2008, 04:07 AM   #7 (permalink)
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question

Instead of specifying Autostart in JDE, is there any method, by which we can set this property through Application...

I mean depends on a flag it should autostart, or not...
Offline  
Old 04-18-2008, 07:50 AM   #8 (permalink)
New Member
 
Join Date: Apr 2008
Model: 8300
PIN: N/A
Carrier: Vodafone
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

@richard thank, i think the same
@arunk
i don't try your method but the problem seem the same. Your screen can request the foreground only if the blackberry end the startup process.
I think that for your solution i also need to write the code that look for ApplicationManager.getApplicationManager().inStart up() every x milisec (i think 100 because i need that the principal blackberry screen not appear)
Offline  
Old 05-09-2008, 02:56 AM   #9 (permalink)
New Member
 
Join Date: Mar 2008
Model: 8700
PIN: N/A
Carrier: vodafone
Posts: 3
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default hi

Quote:
Originally Posted by euskalhenriko View Post
The problem is that when i call pushscreen or requestforeground the blackberry still on startup process... (i set my project as run on startup).
I try with this
... instantiate the screen ...
while(ApplicationManager.getApplicationManager().i nStartup()){
try{
Thread.sleep(100); //without this i block the startup process
}catch(InterruptedException e){}
}
pushScreen(myscreen);
requestForeground();

and it work but it's horrible...
any better idea?
p.d. the application start normally but i need to start in foreground as first application
thanks I also got this trick work out for my application.
Offline  
Old 05-12-2008, 01:33 AM   #10 (permalink)
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am not sure, but you can try invokeLater() method

I mean use a runnable class to invoke requestforeground()

After the screen creation is complete, use invoke later while invoking request foreground

Last edited by arunk : 05-12-2008 at 01:37 AM.
Offline  
Old 05-15-2008, 10:45 AM   #11 (permalink)
aux
New Member
 
Join Date: May 2008
Model: 8100
PIN: N/A
Carrier: mtel
Posts: 8
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default I need your help!!!

Quote:
Originally Posted by pa4o85 View Post
You can look the BlackBerry API for that classes:

- net.rim.device.api.system.ApplicationManager
- net.rim.device.api.system.ApplicationDescriptor
- net.rim.device.api.system.Application.

Maybe you will find there the right solution. I have just made the application to be started at specific time. Good luck !

Please, say me!!!
How did you an aplication that start at specific time?
Offline  
Old 05-15-2008, 11:17 AM   #12 (permalink)
Thumbs Must Hurt
 
Join Date: May 2007
Location: Bulgaria
Model: none
PIN: N/A
Carrier: Mtel
Posts: 150
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello! I made it like this. Not exactly the same code but kind of. I just give you the main idea.

I used this piece of code:


Code:
ApplicationDescriptor descriptor = new ApplicationDescriptor(ApplicationDescriptor.currentApplicationDescriptor(), new String[] {"autoStart"});
Then:

Code:
ApplicationManager.getApplicationManager().scheduleApplication(descriptor, time, true);
The time variable in this code is long value and that is the specific date and time you want the application to be started. So when the time is come, the application will starts itself with the "autoStart" arguments, or whatever you need. Good Luck !
Offline  
Old 05-15-2008, 12:10 PM   #13 (permalink)
aux
New Member
 
Join Date: May 2008
Model: 8100
PIN: N/A
Carrier: mtel
Posts: 8
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default ThanksHi, is you a genius!!!

I have a little time searching one way to do it, thank, I did see the API but, I not found the way of do it. Thanks for you help.
Offline  
Old 05-16-2008, 02:56 AM   #14 (permalink)
Thumbs Must Hurt
 
Join Date: May 2007
Location: Bulgaria
Model: none
PIN: N/A
Carrier: Mtel
Posts: 150
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Have you done it ? It is not that complicated. I just can't give you the whole code cause it is a part of a bigger project, but the post before give you the tip. Good luck !
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





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