BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 04-11-2008, 05:44 AM   #1
euskalhenriko
New Member
 
Join Date: Apr 2008
Model: 8300
PIN: N/A
Carrier: Vodafone
Posts: 7
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, 06:40 AM   #2
pa4o85
Thumbs Must Hurt
 
Join Date: May 2007
Location: Bulgaria
Model: none
PIN: N/A
Carrier: Mtel
Posts: 150
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, 08:57 AM   #3
simon.hain
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
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, 10:37 AM   #4
euskalhenriko
New Member
 
Join Date: Apr 2008
Model: 8300
PIN: N/A
Carrier: Vodafone
Posts: 7
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, 11:34 AM   #5
richard.puckett
Talking BlackBerry Encyclopedia
 
richard.puckett's Avatar
 
Join Date: Oct 2007
Location: Seattle, WA
Model: 9020
PIN: N/A
Carrier: T-Mobile
Posts: 212
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, 03:03 AM   #6
arunk
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
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, 03:07 AM   #7
arunk
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
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, 06:50 AM   #8
euskalhenriko
New Member
 
Join Date: Apr 2008
Model: 8300
PIN: N/A
Carrier: Vodafone
Posts: 7
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, 01:56 AM   #9
reshma1
New Member
 
Join Date: Mar 2008
Model: 8700
PIN: N/A
Carrier: vodafone
Posts: 3
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, 12:33 AM   #10
arunk
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
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 12:37 AM..
Offline  
Old 05-15-2008, 09:45 AM   #11
aux
New Member
 
Join Date: May 2008
Model: 8100
PIN: N/A
Carrier: mtel
Posts: 8
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, 10:17 AM   #12
pa4o85
Thumbs Must Hurt
 
Join Date: May 2007
Location: Bulgaria
Model: none
PIN: N/A
Carrier: Mtel
Posts: 150
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, 11:10 AM   #13
aux
New Member
 
Join Date: May 2008
Model: 8100
PIN: N/A
Carrier: mtel
Posts: 8
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, 01:56 AM   #14
pa4o85
Thumbs Must Hurt
 
Join Date: May 2007
Location: Bulgaria
Model: none
PIN: N/A
Carrier: Mtel
Posts: 150
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



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


128K RAM - APPLE - ORIGINAL APPLE prototype BOARD picture

128K RAM - APPLE - ORIGINAL APPLE prototype BOARD

$408.75



APPLE 630-0895-B  VRAM 128K X 8 BOARD CARD VINTAGE picture

APPLE 630-0895-B VRAM 128K X 8 BOARD CARD VINTAGE

$74.77



APPLE 820-0522-A 630-0895-B LITE VRAM 128K X 8 BOARD  picture

APPLE 820-0522-A 630-0895-B LITE VRAM 128K X 8 BOARD

$149.99







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