BlackBerryForums.com : Your Number One BlackBerry Community      

»Sponsored Links




Reply
 
LinkBack Thread Tools
  (#1 (permalink)) Old
euskalhenriko Offline
New Member
 
Posts: 7
Join Date: Apr 2008
Model: 8300
PIN: N/A
Carrier: Vodafone
Question autostart uiapplication - 04-11-2008, 05:44 AM

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
   
Reply With Quote
Sponsored Links
Please Login or Register to Remove these Advertisements!

  (#2 (permalink)) Old
pa4o85 Offline
Thumbs Must Hurt
 
Posts: 133
Join Date: May 2007
Location: Bulgaria
Model: none
PIN: N/A
Carrier: Mtel
Default 04-11-2008, 06:40 AM

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 !
   
Reply With Quote
  (#3 (permalink)) Old
simon.hain Offline
CrackBerry Addict
 
Posts: 624
Join Date: Apr 2005
Location: hamburg, germany
Model: 8700
Carrier: o2
Default 04-11-2008, 08:57 AM

afaik autostart applications do never start in foreground. you can try and call requestForeground() from your application


java developer, Devinto, hamburg/germany
   
Reply With Quote
  (#4 (permalink)) Old
euskalhenriko Offline
New Member
 
Posts: 7
Join Date: Apr 2008
Model: 8300
PIN: N/A
Carrier: Vodafone
Question 04-17-2008, 10:37 AM

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
   
Reply With Quote
  (#5 (permalink)) Old
richard.puckett Offline
Talking BlackBerry Encyclopedia
 
richard.puckett's Avatar
 
Posts: 211
Join Date: Oct 2007
Location: Seattle, WA
Model: 8800
PIN: N/A
Carrier: AT&T
Default 04-17-2008, 11:34 AM

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.
   
Reply With Quote
  (#6 (permalink)) Old
arunk Online
Thumbs Must Hurt
 
arunk's Avatar
 
Posts: 176
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Default 04-18-2008, 03:03 AM

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);
}
   
Reply With Quote
  (#7 (permalink)) Old
arunk Online
Thumbs Must Hurt
 
arunk's Avatar
 
Posts: 176
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Question 04-18-2008, 03:07 AM

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...
   
Reply With Quote
  (#8 (permalink)) Old
euskalhenriko Offline
New Member
 
Posts: 7
Join Date: Apr 2008
Model: 8300
PIN: N/A
Carrier: Vodafone
Default 04-18-2008, 06:50 AM

@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)
   
Reply With Quote
  (#9 (permalink)) Old
reshma1 Offline
New Member
 
Posts: 1
Join Date: Mar 2008
Model: 8700
PIN: N/A
Carrier: vodafone
Default hi - 05-09-2008, 01:56 AM

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.
   
Reply With Quote
  (#10 (permalink)) Old
arunk Online
Thumbs Must Hurt
 
arunk's Avatar
 
Posts: 176
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Default 05-12-2008, 12:33 AM

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.
   
Reply With Quote
  (#11 (permalink)) Old
aux Offline
New Member
 
Posts: 7
Join Date: May 2008
Model: 8100
PIN: N/A
Carrier: mtel
Default I need your help!!! - 05-15-2008, 09:45 AM

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?
   
Reply With Quote
  (#12 (permalink)) Old
pa4o85 Offline
Thumbs Must Hurt
 
Posts: 133
Join Date: May 2007
Location: Bulgaria
Model: none
PIN: N/A
Carrier: Mtel
Default 05-15-2008, 10:17 AM

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 !
   
Reply With Quote
  (#13 (permalink)) Old
aux Offline
New Member
 
Posts: 7
Join Date: May 2008
Model: 8100
PIN: N/A
Carrier: mtel
Default ThanksHi, is you a genius!!! - 05-15-2008, 11:10 AM

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.
   
Reply With Quote
  (#14 (permalink)) Old
pa4o85 Offline
Thumbs Must Hurt
 
Posts: 133
Join Date: May 2007
Location: Bulgaria
Model: none
PIN: N/A
Carrier: Mtel
Default 05-16-2008, 01:56 AM

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 !
   
Reply With Quote
Reply


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-2008 BlackBerryNews.com, BlackBerryFAQ.com, BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of Research In Motion Limited.
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.1