×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Nov 2009
    Posts
    10

    comunication among more midlets in one jar

    Hi,

    I have several MIDlets, which I would like to use in one application. I would like to have one main midlet, which would create and call instances of those MIDlets. However, when I tried in "main" MIDlet to create an instance of other MIDlet, I got an "Unhandled security exception". I tried to find some info about that and found that I can't execute two MIDlets at the same time.
    What's the best way for me in this case? I could put the whole code into one MIDlet, but that's not nice programming solution..

    Pedro

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: comunication among more midlets in one jar

    If you want to use the code as one application, create only one MIDlet class. MIDlet = application. You don't have to put all your code in the MIDlet class, any more than you have to put all your code in the main() method of a J2SE app. The MIDlet is just the entry point. Create as many classes as you need, but only one MIDlet.

    Graham.

  3. #3
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: comunication among more midlets in one jar

    Quote Originally Posted by pedron4 View Post
    Hi,

    1. I have several MIDlets, which I would like to use in one application. I would like to have one main midlet, which would create and call instances of those MIDlets. However, when I tried in "main" MIDlet to create an instance of other MIDlet, I got an "Unhandled security exception". I tried to find some info about that and found that I can't execute two MIDlets at the same time.


    2. What's the best way for me in this case? I could put the whole code into one MIDlet, but that's not nice programming solution..

    Pedro
    1. Why you need these many midlets in your app?
    Rather you should create the single midlet in your app and from this you can enter in the application and then you can go ahead with the other UI classes like the canvas, forms.

    Since the MIDlet class is the Abstract class and An abstract class cannot be instantiated. It can only be used as a superclass for other classes that extend the abstract class.Thats why that exception was thrown.

    2. The best for any general application can be like this,
    Midlet->Displayable(Like canvas/forms) and then you can create the as many displayable as you think can be good for your app. That depends that whether you wanna use the Canvas or the Form as the displayable,

    You can share mush more information about the app and we can provide much more details.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  4. #4
    Nokia Developer Champion
    Join Date
    Apr 2007
    Posts
    2,708

    Re: comunication among more midlets in one jar

    you're gonna love Android :P
    btw that inter-meidlet communication is one of the new featrues of MIDP 3.0 If it ever comes out that is, it's a pretty shy platform :P

  5. #5
    Registered User
    Join Date
    Nov 2009
    Posts
    10

    Re: comunication among more midlets in one jar

    Thank you both for the advices, they were very helpful! After your posts I tried to do what you suggested, and it solved the problem.

    Thanks a lot!

    Pedro

Similar Threads

  1. Error loading connection when obfuscation high?
    By ejakkk in forum Mobile Java General
    Replies: 8
    Last Post: 2009-06-26, 12:54
  2. Extracting contents of a jar file onto disk
    By surenc in forum Mobile Java General
    Replies: 2
    Last Post: 2009-03-10, 13:11
  3. Signing MIDlet's JAR in N95
    By alluoshi in forum General Development Questions
    Replies: 2
    Last Post: 2007-11-14, 02:03
  4. Providing RMS with MIDlets (JAR files)- is this possible?
    By WhiteWereWolf in forum Mobile Java General
    Replies: 1
    Last Post: 2003-03-16, 06:09

Posting Permissions

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