BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 06-12-2008, 02:36 AM   #1
arunk
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Question Configure Autostart at runtime?

Please Login to Remove!

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?
Offline  
Old 06-12-2008, 03:25 AM   #2
simon.hain
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Default

have your autostart part check a persistant value
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 06-12-2008, 04:09 AM   #3
arunk
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Default

Sorry..I didnt get what you mean?
Offline  
Old 06-12-2008, 06:34 AM   #4
simon.hain
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Default

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
Offline  
Old 06-12-2008, 06:41 AM   #5
arunk
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Question

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 04:07 AM..
Offline  
Old 06-25-2008, 06:59 AM   #6
arunk
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Question

Help?
Offline  
Old 06-25-2008, 07:20 AM   #7
simon.hain
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Default

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
Offline  
Old 06-25-2008, 07:26 AM   #8
Jayaseelan
Thumbs Must Hurt
 
Join Date: Jun 2008
Location: Chennai
Model: 8130
PIN: N/A
Carrier: AIRTEL
Posts: 51
Default

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
INDIA.
Offline  
Old 06-25-2008, 07:27 AM   #9
shraddha294
Thumbs Must Hurt
 
shraddha294's Avatar
 
Join Date: Oct 2007
Location: Hyderabad
Model: 8800
PIN: N/A
Carrier: TMobile
Posts: 111
Exclamation

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

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

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?
Offline  
Old 06-25-2008, 10:37 AM   #11
simon.hain
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Default

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
Offline  
Old 06-25-2008, 11:47 PM   #12
arunk
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Smile

Thanks simon ....
Offline  
Old 06-26-2008, 04:03 AM   #13
arunk
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Question

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");
                }
            }
 }
Offline  
Old 06-26-2008, 04:30 AM   #14
simon.hain
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Default

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
Offline  
Old 06-26-2008, 04:47 AM   #15
arunk
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Question

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?
Offline  
Old 06-26-2008, 05:07 AM   #16
arunk
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Smile

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...
Offline  
Old 06-26-2008, 09:28 AM   #17
arunk
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Question

Now The problem is I am getting two Application icon While switching the application.....
Offline  
Old 06-26-2008, 10:09 AM   #18
simon.hain
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Default

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
Offline  
Old 06-27-2008, 12:47 AM   #19
arunk
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Question

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
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

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

Forum Jump


A54MA55B and BC186A413G52 frequency converters A500/F540 series 55KW drive board picture

A54MA55B and BC186A413G52 frequency converters A500/F540 series 55KW drive board

$350.00



New Greaseweazle V4.1 USB Floppy Adapter Flux Reader Writer Amiga PC Case 1598 picture

New Greaseweazle V4.1 USB Floppy Adapter Flux Reader Writer Amiga PC Case 1598

$36.05



Dentistry Replacement NSK TiMAX NL95M/ A500/ A500L/ AK500L/ AS500L /AW500L NEW picture

Dentistry Replacement NSK TiMAX NL95M/ A500/ A500L/ AK500L/ AS500L /AW500L NEW

$79.95



1PC USED A54MA55B BC186A413G52 Mitsubishi A500/F540 Series 55KW Drive Board #CZ picture

1PC USED A54MA55B BC186A413G52 Mitsubishi A500/F540 Series 55KW Drive Board #CZ

$317.00



MITSUBISHI A500 / FR-A540-5.5K-NA INVERTER 3PH  picture

MITSUBISHI A500 / FR-A540-5.5K-NA INVERTER 3PH

$108.00



MITSUBISHI FR-A820 1.5K TFA INVERTER A500 240 V #L-220 picture

MITSUBISHI FR-A820 1.5K TFA INVERTER A500 240 V #L-220

$684.00







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