BlackBerryForums.com : Your Number One BlackBerry Community      

»Sponsored Links




Reply
 
LinkBack Thread Tools
  (#1 (permalink)) Old
arunk Offline
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Posts: 222
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Question Configure Autostart at runtime? - 06-12-2008, 03:36 AM

is it possible to configure autostart at runtime?

At present Using JDE I am able to Autostart my application..

I want to give the user an option for autostart, with which he can make it true or false.. is it possible to do like this?
   
Reply With Quote
Sponsored Links
Please Login or Register to Remove these Advertisements!

  (#2 (permalink)) Old
simon.hain Offline
CrackBerry Addict
 
Posts: 761
Join Date: Apr 2005
Location: hamburg, germany
Model: 8700
Carrier: o2
Default 06-12-2008, 04:25 AM

have your autostart part check a persistant value


java developer, Devinto, hamburg/germany
   
Reply With Quote
  (#3 (permalink)) Old
arunk Offline
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Posts: 222
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Default 06-12-2008, 05:09 AM

Sorry..I didnt get what you mean?
   
Reply With Quote
  (#4 (permalink)) Old
simon.hain Offline
CrackBerry Addict
 
Posts: 761
Join Date: Apr 2005
Location: hamburg, germany
Model: 8700
Carrier: o2
Default 06-12-2008, 07:34 AM

your autostart part reads a persistant store. in the store you save a Boolean with the values autostart (true) or no autostart (false). if the value is set to false the autostart part terminates.
in the settings the user can save the persistant value.


java developer, Devinto, hamburg/germany
   
Reply With Quote
  (#5 (permalink)) Old
arunk Offline
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Posts: 222
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Question 06-12-2008, 07:41 AM

I have a field called Autostart (0/1);

In My application by default Autostart will be true (Through JDE settings)

But when I change and save the autostart field , The autostart flag of the application should change or reset..


And as you said the value of the autostart field will be stored in Persistence store....

Last edited by arunk : 06-25-2008 at 05:07 AM.
   
Reply With Quote
  (#6 (permalink)) Old
arunk Offline
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Posts: 222
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Question 06-25-2008, 07:59 AM

Help?
   
Reply With Quote
  (#7 (permalink)) Old
simon.hain Offline
CrackBerry Addict
 
Posts: 761
Join Date: Apr 2005
Location: hamburg, germany
Model: 8700
Carrier: o2
Default 06-25-2008, 08:20 AM

here is a simple construction using alternate entry points

Code:
if (args.length > 0 && "autostartup".equals(args[0])) {
//check persistant value, if true call constructor, otherwise do nothing
} else {
//normal startup -> user clicks icon
}


java developer, Devinto, hamburg/germany
   
Reply With Quote
  (#8 (permalink)) Old
Jayaseelan Offline
Thumbs Must Hurt
 
Posts: 50
Join Date: Jun 2008
Location: Chennai
Model: 8130
PIN: N/A
Carrier: AIRTEL
Default 06-25-2008, 08:26 AM

Quote:
Originally Posted by simon.hain View Post
here is a simple construction using alternate entry points

Code:
if (args.length > 0 && "autostartup".equals(args[0])) {
//check persistant value, if true call constructor, otherwise do nothing
} else {
//normal startup -> user clicks icon
}
Hi Simon,

Is it possible to start an application automatically each time the mobile is swithced On?

And i want to start the app automatically after Installation finished..

How to do both?


Jayaseelan.V
Mobile Application Developer
Chennai - INDIA.
   
Reply With Quote
  (#9 (permalink)) Old
shraddha294 Offline
Thumbs Must Hurt
 
shraddha294's Avatar
 
Posts: 78
Join Date: Oct 2007
Location: Hyderabad
Model: 8800
PIN: N/A
Carrier: TMobile
Exclamation 06-25-2008, 08:27 AM

Can something similar be done to integrate MIDlet and CLDC application...?

Say something like invoking CLDC application from a MIDlet? ???
   
Reply With Quote
  (#10 (permalink)) Old
arunk Offline
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Posts: 222
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Smile 06-25-2008, 10:50 AM

Ok.. simon.hain

Actually I am loading the persistent store value while loading the main screen

So I have to load it in the beginning and before calling the main screen I have to do this check.. right?
   
Reply With Quote
  (#11 (permalink)) Old
simon.hain Offline
CrackBerry Addict
 
Posts: 761
Join Date: Apr 2005
Location: hamburg, germany
Model: 8700
Carrier: o2
Default 06-25-2008, 11:37 AM

to answer the thread hijackers:
autostart midlet
autostart with JDE

yes, you should check the value before you call the constructor of your application


java developer, Devinto, hamburg/germany
   
Reply With Quote
  (#12 (permalink)) Old
arunk Offline
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Posts: 222
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Smile 06-26-2008, 12:47 AM

Thanks simon ....
   
Reply With Quote
  (#13 (permalink)) Old
arunk Offline
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Posts: 222
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Question 06-26-2008, 05:03 AM

I tried this method...

But the problem is I always get args.length as 0. But auto start is happening.

Is there any problem in handling the arguments in main method?

Code:
 public static void main(String[] args) {
           
            writeToLogFile("Args : "+args.length);            
            System.out.println("Args : "+args.length);
            
            if (args.length > 0 && "autostartup".equals(args[0])) {
                System.out.println(" Inside args");
                }
            }
 }
   
Reply With Quote
  (#14 (permalink)) Old
simon.hain Offline
CrackBerry Addict
 
Posts: 761
Join Date: Apr 2005
Location: hamburg, germany
Model: 8700
Carrier: o2
Default 06-26-2008, 05:30 AM

did you create the autorun project as an Alternate CLDC Application Entry Point?
did you put autostartup into the 'arguments passed to...' field in the project properties?

did you at least read the link i posted?


java developer, Devinto, hamburg/germany
   
Reply With Quote
  (#15 (permalink)) Old
arunk Offline
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Posts: 222
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Question 06-26-2008, 05:47 AM

I went through the link, but I didn't get properly.

I have MyApplication and MyAppAEP

MyAppAEP is the Alternate Entry point App.

in that I specified my application name and variable as "autostartup".



But MyAppAEP is just a project without any files..

is there any mistake here?
   
Reply With Quote
  (#16 (permalink)) Old
arunk Offline
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Posts: 222
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Smile 06-26-2008, 06:07 AM

Hi simon,

I was doing the same which you suggested... But there was a misunderstanding.

I thought this AEP will execute when the Application starts automatically...

But it gets executed when we invoke by clicking the icon....

Anyway its working fine now....

Thanks a lot for your support...
   
Reply With Quote
  (#17 (permalink)) Old
arunk Offline
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Posts: 222
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Question 06-26-2008, 10:28 AM

Now The problem is I am getting two Application icon While switching the application.....
   
Reply With Quote
  (#18 (permalink)) Old
simon.hain Offline
CrackBerry Addict
 
Posts: 761
Join Date: Apr 2005
Location: hamburg, germany
Model: 8700
Carrier: o2
Default 06-26-2008, 11:09 AM

your AEP application does not need an icon, you have to mark it as system module/autorun at startup. it calls the main method of your application.


java developer, Devinto, hamburg/germany
   
Reply With Quote
  (#19 (permalink)) Old
arunk Offline
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Posts: 222
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Question 06-27-2008, 01:47 AM

Still I am getting two icons. When I didnt give an icon for AEP it comes with a default black icon.

At startup the AEP will get executed. Whenever the user invoke the app with icone, it will invoke the main application.

My problem is two different instances are existing at the same time.

I have attached the properties settings along with this post.

is there any way by which we can make sure that only one instance will exist at a time?


AEP.JPG

Main.JPG
   
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