Results 1 to 14 of 14
  1. #1
    shamun is offline Member
    Join Date
    May 2010
    Posts
    6
    Rep Power
    0

    Question Midlet migration to JavaSe

    Hello,

    How to convert a midlet available microedition/UDPDatagramConnection for applet module? I get error that package does not exist, For example:


    import javax.swing.JApplet;
    import javax.microedition.io.*;
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;

    import java.io.*;
    import net.*;

    public class InviteMIDlet extends JApplet {

    private Display display;
    public Form form;
    private TextField To;
    private Command sendCmd;
    private Command exitCmd;
    private Command hangupCmd;

    private UDPDatagramConnection rtpCon = null;

    ....

    }

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,518
    Rep Power
    25

    Default

    I get error that package does not exist
    When getting errors, please post the full text of the error.

    You don't say what package is missing.

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    If a package is dose not means that you've not added relevant additional packages into your classpath, did you?

    Best way to find a solution for your question is, as Norm says, post your complete error message to the forum. It's helpful to others who are looking into your question.

  4. #4
    shamun is offline Member
    Join Date
    May 2010
    Posts
    6
    Rep Power
    0

    Default

    Please check the screen shot, it works in my Midlet project, But i am trying to move same concept to J2SE (applet based).

    screen: http://i.imgur.com/PuqMn.png

    1. J2SE have microedition?
    2. UDPDatagramConnection in J2SE is different?

    Thank you

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  6. #6
    shamun is offline Member
    Join Date
    May 2010
    Posts
    6
    Rep Power
    0

    Default

    @Eranga,
    screen shot: http://i.imgur.com/IJhok.png

    Mannually i didnt add anything, Which libraries i should add?

  7. #7
    shamun is offline Member
    Join Date
    May 2010
    Posts
    6
    Rep Power
    0

    Default

    @Eanga, others:

    1. Which package i should add for my classpth?
    2. I compile, this are the error: Bash | init: deps-clean: Updating p - Anonymous - TBvGthkY - Pastebin.com

  8. #8
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,518
    Rep Power
    25

    Default

    package javax.microedition.media does not exist
    Do you have a jar file with the above package in it?

  9. #9
    shamun is offline Member
    Join Date
    May 2010
    Posts
    6
    Rep Power
    0

    Default

    Screen shot: http://i.imgur.com/jqUUG.png

    1. Midlet working project i compiled and made a siptest.jar file in my path /home/sun/Download/siptest.jar
    2. J2SE > same code > properties > libraries added as siptest.jar

    Still i have same.

  10. #10
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,518
    Rep Power
    25

    Default

    I'm not sure what your response said.
    Do you have a jar file with the the javax.microedition.media classes in it? I imagine that you would have to download it from the SUN site.

    What is in the siptest.jar file?

  11. #11
    shamun is offline Member
    Join Date
    May 2010
    Posts
    6
    Rep Power
    0

    Default

    @Norm, @Eranga, others: I am translating following terms, i think i am getting fail because system is different:

    J2ME: does support
    ===========
    import javax.microedition.lcdui.*;
    import javax.microedition.lcdui.Form;

    import javax.microedition.media.*;
    import javax.microedition.media.Manager;
    import javax.microedition.media.control.*;

    import javax.microedition.io.*;
    import javax.microedition.midlet.*;


    J2SE:
    =====
    dont support them, none of those??????? How can i translate them, j2ME to >> j2SE!!!!!, I need atleast those alternatives.

    1. Network
    - socket = (UDPDatagramConnection) Connector.open("datagram://:" + localPort);
    - Datagram send = socket.newDatagram(result, result.length, destAddr);
    - Datagram receive = socket.newDatagram(socket.getMaximumLength());

    2. Audio capture
    - RecordControl rc;
    - p = Manager.createPlayer("capture://audio");

    3. Audio player
    - pnew = Manager.createPlayer(recordedInputStream, "audio/X-wav");
    - public class AudioPlayer extends Thread implements PlayerListener {
    - Player pnew = null;

  12. #12
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,518
    Rep Power
    25

    Default

    Here's all I can think of:
    To recode the program to use J2Se vs the ME
    remove all the import javax.microedition.... statements,
    compile the program, get the list of errors and then go into the J2SE API doc and find if there is a class that could work and add an import statement for the package it's in.

    No idea if the classes are compatible or if they'll need lots of recoding.

    Good luck.

  13. #13
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by Norm View Post
    Here's all I can think of:
    To recode the program to use J2Se vs the ME
    remove all the import javax.microedition.... statements,
    compile the program, get the list of errors and then go into the J2SE API doc and find if there is a class that could work and add an import statement for the package it's in.

    No idea if the classes are compatible or if they'll need lots of recoding.

    Good luck.
    Agreed. That is the easiest way to solve this, if you don't know the alternatives. Each technology has different approaches as well.

    Once you compile the code, as Norm says, you'll end up with list of errors. Try to solve those.

  14. #14
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by shamun View Post
    @Eranga,
    screen shot: http://i.imgur.com/IJhok.png

    Mannually i didnt add anything, Which libraries i should add?
    You already know that which package/library you want to use additionally. Are you using any IDE for coding in Java. Because most of the IDEs nowadays have an option to added external libraries to the project.

Similar Threads

  1. Apache / Tomcat and a separate JavaSE program
    By lambi in forum Networking
    Replies: 6
    Last Post: 03-30-2010, 09:00 AM
  2. Database JPA,JTA,Validator,etc. on JavaSE
    By jicxicmic in forum New To Java
    Replies: 0
    Last Post: 08-31-2009, 03:49 PM
  3. WAS migration from 5.1 to 6.0
    By sneha1234 in forum Other IDEs
    Replies: 0
    Last Post: 02-21-2009, 06:56 AM
  4. Using USB in JavaSE
    By hobbyist in forum New To Java
    Replies: 0
    Last Post: 01-26-2008, 12:31 PM
  5. IE7 Migration
    By Aneesha in forum Advanced Java
    Replies: 1
    Last Post: 12-04-2007, 03:58 PM

Tags for this Thread

Posting Permissions

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