I'm trying to pass some command line arguments to a MIDlet, but I don't know where to look for the args within the MIDlet code (no obvious main(argv, argc) method). Any ideas? Is it possible?
I'm trying to pass some command line arguments to a MIDlet, but I don't know where to look for the args within the MIDlet code (no obvious main(argv, argc) method). Any ideas? Is it possible?
You can use JAD file attributes to achive somewhat similar effect. You can use the MIDlet.getAppProperty() for retrieving those values.
Hartti
Thanks for the response!
Is it possible to use that technique for arguments that change, though? I'd like to call the same MIDlet with an abitrary string (a URL, for example).
hi clawer,
you cannot modify jad on device, so you cannot change params,
just idea, but probably you can register your midlet to listen for incoming data using push registry:
http://developers.sun.com/techtopics...icles/pushreg/
then any application on phone could invoke that midlet via local socket/tcp connection or via sms and pass new data to midlet,
btw: how do you planned to pass args to midlet form other application?
regards,
Peter
The idea is to start the MIDlet with some args so it can change its execution based on why it was called, etc (we have an idle screen S60 application that may need to launch the various applications on the phone, including some MIDlets). I have accomplished that idea through the use of an interim file, but it seems a bit "hacky". Thanks for your suggestion!