×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Mar 2006
    Posts
    3

    Passing parameters to MIDlets?

    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?

  2. #2
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: Passing parameters to MIDlets?

    You can use JAD file attributes to achive somewhat similar effect. You can use the MIDlet.getAppProperty() for retrieving those values.

    Hartti

  3. #3
    Registered User
    Join Date
    Mar 2006
    Posts
    3

    Re: Passing parameters to MIDlets?

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

  4. #4
    Super Contributor
    Join Date
    Dec 2005
    Location
    Europe/Poland/Warsaw
    Posts
    1,697

    Re: Passing parameters to MIDlets?

    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

  5. #5
    Registered User
    Join Date
    Mar 2006
    Posts
    3

    Re: Passing parameters to MIDlets?

    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!

Similar Threads

  1. Passing runtime parameters to CLDC HI under Symbian 8.0
    By tal.elad in forum Mobile Java General
    Replies: 0
    Last Post: 2005-04-13, 11:10
  2. passing command line parameters?
    By prbhat in forum Symbian User Interface
    Replies: 2
    Last Post: 2004-04-23, 04:32
  3. Unable install midlets larger then 10kb into the 6310i
    By Arturas in forum Mobile Java General
    Replies: 1
    Last Post: 2002-12-03, 10:06

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×