IR Printing in J2ME

Hi
does MIDP(any version) Supports package for printing from IR Enabled mobile phone(Eg: Ericsson K300i) to IR enabled Printer(supports IrLPT Protocol).
CommConnection doesn't seems to be work...if anybody has solution please let me know.
Thanks
Regards
Praveena

Hi I am wondering if you have found a way to send your print job to a portable mobile printer from mobile device using infra red. Any luck with it?
Robin

Similar Messages

  • Javax.print. in j2me??

    hi
    i retrieve stored rms data in string and i want to print the data in that string through print using j2me.

    explain yourself better please.

  • Connect Mobile to Bluetooth Printer in j2me

    Am not getting how to establish connection between mobile and bluetooth printer.Please if antbody knows about this help me.

    I find this hard to understand. My 6210 Navigator can receive cellular signals without an external antenna. It can communicate via bluetooth without an external antenna. It can pick up signals from GPS satellites, for heavens sake, without an external antenna. How can it be so hard to pick up an FM signal ?
    Anyway, Nokia have been selling Bluetooth phones for ages, and bluetooth headsets. Hasn't it occured to someone somewhere that some of us might want to listen to FM on a Bluetooth headset ...

  • Printing via bluetooth

    I need to create an application in which i need to send a file from a bluetooth enabled pc to another bluetooth enabled pc and got to print it there on a normal printer using java
    How do i go about this ??
    Firstly is it possible ??
    Do i require RMI ??
    Could anyone help with the code or useful links or anything
    currently using javax.bluetooth and javax.microedition.io package
    Thnx in advance

    you want to send from
    bluetooth enabled pc to another bluetooth enabled pcor you want to send it from J2ME application on device? and you are using
    javax.bluetooth and javax.microedition.io packageIf you want to print from J2ME application, it is possible. for that you need bluetooth enabled printer too.
    As far I know, using bluetooth you don't need to use RMI.
    This may be useful
    http://www.hcilab.org/resources/tutorials.htm
    http://www.webpronews.com/topnews/2004/12/13/introduction-to-bluetooth-and-jme
    http://developers.sun.com/techtopics/mobility/midp/articles/bluetooth2/
    Check these links for basic J2ME - Bluetooth connectivity
    Rohan Chandane

  • How to print directly to printer using USB and Bluetooth from Java (J2ME) app.

    I write mobile phone apps in Java (J2ME). I want to print directly to a printer via USB and via Bluetooth. I cannot use a print job with the Java available to me. Once upon a time you could just send text and print control characters to a printer. I would like to be able to do that again. Alternatively could you provide a 'skeleton' data stream into which I could insert my code to produce what is sent to the printer when a print job is used with Java on a laptop or PC. I just want to sent simple text with a little formatting. 

    Hi,
    As far as printing to devices not all devices support Bluetooth. Many devices support Bonjour protocal, IPP. The main print port is 9100. Additionally you can see what IO protocols are supported on a product by looking at the EWS (Embedded WebServer) there should be a networking page with that information.  Port 9100 is your basic print port and different devices will support different formats (PDF, JPEG, PCL5, PCL6). If there is an API you can find (i am not familiar with J2ME availible calls, then you can use those and send the data to port 9100. Again that is the basic path most printers will accept. not all devices support bonjour not all device support bluetooth etc... Hope that helps and good luck.
    I am an HP Employee.

  • J2me sdk 3.0  problems in System.out.print

    Hi
    I can not use println to print Chinese .
    First I just use System.out.print("test") to print some debug information , and I surprised to find it print nothing.
    Then I try System.out.println("test") and it worked well. But there still problem when print Chinese,
    like System.out.println("测试") and it just print a mistake string as "??" !
    Can some tell me how to solved it, thanks .

    Note: This thread was originally posted in the [Sun Java Wireless Toolkit|http://forums.sun.com/forum.jspa?forumID=82] forum, but moved to this forum for closer topic alignment.

  • Direct Print smartform to printer via  JOB_OPEN function and using SUBMIT

    Hello,
    I can not able to printout from forms . I can able to get spool number but it is not printing directly to printer (printer Output should come automatic). I am getting error message in SP02 as Status ->Waiting    when i check is showing as "Frontend unavailable".
    please find sample code below to test same:
    REPORT  ZTEST_1                                  .
    constants : wc_x type c value 'X'.
    DATA: wv_val(1) TYPE c,
          wv_pripar TYPE pri_params,
          wv_arcpar TYPE arc_params,
          wv_lay   TYPE pri_params-paart value 'DINA4',
          wv_lines TYPE pri_params-linct,
          wv_rows  TYPE pri_params-linsz.
    data: wv_jobname like tbtcjob-jobname.
    data: wv_jobcount like tbtcjob-jobcount,
          wv_host like msxxlist-host.
    data: begin of ws_starttime.
            include structure tbtcstrt.
    data: end of ws_starttime.
    data: wv_starttimeimmediate like btch0000-char1 value 'X',
          wv_flag(1),
          WV_DO_PRINT type i.
    concatenate sy-tcode+0(4) ' ' 'sample test - print'
    into wv_jobname.
    *Job open
      call function 'JOB_OPEN'
           exporting
                delanfrep        = 'X'
                jobname          = wv_jobname
                sdlstrtdt        = sy-datum
                sdlstrttm        = sy-uzeit
           importing
                jobcount         = wv_jobcount
      if sy-subrc eq 0.
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
           EXPORTING
                in_archive_parameters  = wv_arcpar
                in_parameters          = wv_pripar
                LIST_NAME           = 'JOB NAME'
                LIST_TEXT             = 'test_text'
                RECEIVER             = sy-uname
                IMMEDIATELY           = wc_x
                RELEASE               = wc_x
                USER                 = sy-uname
                layout                 = wv_lay
                no_dialog              = wc_x
           IMPORTING
                out_archive_parameters = wv_arcpar
                out_parameters         = wv_pripar
                valid                  = wv_val
    break-point.
    wv_pripar-PRSAP = space.
    wv_pripar-PRIOT = 1.
    wv_pripar-prrec = sy-uname.
    if not wv_val is initial.
    *call external program and pass data
    submit SF_EXAMPLE_01
          USER sy-uname
         via job wv_jobname
         number wv_jobcount
      TO SAP-SPOOL
    SPOOL PARAMETERS wv_pripar
    ARCHIVE PARAMETERS wv_arcpar
    WITHOUT SPOOL DYNPRO
    AND RETURN.
    endif.
    *Close job
      ws_starttime-sdlstrtdt = sy-datum .
      ws_starttime-sdlstrttm = sy-UZEIT.
        ws_starttime-IMSTRTPOS = WC_X .
      call function 'JOB_CLOSE'
           exporting
                event_id             = ws_starttime-eventid
                event_param          = ws_starttime-eventparm
                EVENT_PERIODIC       = space
                jobcount             = wv_jobcount
                jobname              = wv_jobname
                laststrtdt           = ws_starttime-laststrtdt
                laststrttm           = ws_starttime-laststrttm
                prddays              = 0                       "set to 0 not repeat
                prdhours             = 0
                prdmins              = 0
                prdmonths            = 0
                prdweeks             = 0
                sdlstrtdt            = ws_starttime-sdlstrtdt
                sdlstrttm            = ws_starttime-sdlstrttm
                strtimmed            = wv_starttimeimmediate
      endif.

    Hi,
    As far as printing to devices not all devices support Bluetooth. Many devices support Bonjour protocal, IPP. The main print port is 9100. Additionally you can see what IO protocols are supported on a product by looking at the EWS (Embedded WebServer) there should be a networking page with that information.  Port 9100 is your basic print port and different devices will support different formats (PDF, JPEG, PCL5, PCL6). If there is an API you can find (i am not familiar with J2ME availible calls, then you can use those and send the data to port 9100. Again that is the basic path most printers will accept. not all devices support bonjour not all device support bluetooth etc... Hope that helps and good luck.
    I am an HP Employee.

  • Send email from j2me through servlet

    Hi people,
    i hope you can help me because i am new in network programming.
    I am trying to send email from j2me to googlemail account I have 2 classes EmailMidlet (which has been tested with wireless Toolkit 2.5.2 and it works) and the second class is the servlet-class named EmailServlet:
    when i call the EmailServlet, i get on the console:
    Server: 220 mx.google.com ESMTP g28sm19313024fkg.21
    Server: 250 mx.google.com at your service
    this is the code of my EmailServlet
    import java.io.*;
    import java.net.Socket;
    import java.net.UnknownHostException;
    import java.text.*;
    import java.util.Date;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class EmailServlet extends HttpServlet {
       public void doPost(HttpServletRequest request, HttpServletResponse response)
             throws IOException, ServletException {
          System.out.println("____emailservlet.doPost");
          response.setContentType("text/plain");
          PrintWriter out = response.getWriter();
          System.out.println("______________________________");
          out.println();
          String to = request.getParameter("to");
          System.out.println("____________________________to" + to);
          String subject = request.getParameter("subject");
          String msg = request.getParameter("msg");
          // construct an instance of EmailSender
          System.out.println("servlet_to" + to);
          send("[email protected]", to, subject, msg);
          out.println("mail sent....");
       public void send(String from, String to, String subject, String msg) {
          Socket smtpSocket = null;
          DataOutputStream os = null;
          DataInputStream is = null;
          try {
             smtpSocket = new Socket("smtp.googlemail.com", 25);
             os = new DataOutputStream(smtpSocket.getOutputStream());
             is = new DataInputStream(smtpSocket.getInputStream());
          } catch (UnknownHostException e) {
             System.err.println("Don't know about host: hostname");
          } catch (IOException e) {
             System.err
                   .println("Couldn't get I/O for the connection to: hostname");
          if (smtpSocket != null && os != null && is != null) {
             try {
                os.writeBytes("HELO there" + "\r\n");
                os.writeBytes("MAIL FROM: " + from + "\r\n");
                os.writeBytes("RCPT TO: " + to + "\r\n");
                os.writeBytes("DATA\r\n");
                os.writeBytes("Date: " + new Date() + "\r\n"); // stamp the msg
                                                    // with date
                os.writeBytes("From: " + from + "\r\n");
                os.writeBytes("To: " + to + "\r\n");
                os.writeBytes("Subject: " + subject + "\r\n");
                os.writeBytes(msg + "\r\n"); // message body
                os.writeBytes(".\r\n");
                os.writeBytes("QUIT\r\n");
                // debugging
                String responseLine;
                while ((responseLine = is.readLine()) != null) {
                   System.out.println("Server: " + responseLine);
                   if (responseLine.indexOf("delivery") != -1) {
                      break;
                os.close();
                is.close();
                smtpSocket.close();
             } catch (UnknownHostException e) {
                System.err.println("Trying to connect to unknown host: " + e);
             } catch (IOException e) {
                System.err.println("IOException: " + e);
       } 1.when i print "to" in EmailServlet also:
      String to = request.getParameter("to");
          System.out.println("____________________________to" + to);  it show null on the console :confused:
    2. ist this right in case of googlemail.com?
      smtpSocket = new Socket("smtp.googlemail.com", 25);  I would be very grateful if somebody can help me.

    jackofall
    Please don't post in old threads that are long dead. When you have a question, please start a topic of your own. Feel free to provide a link to an old thread if relevant.
    I'm locking this thread now.
    db

  • How to print a formatted page in java?

    hi all
    i've made my simple application that writes and retrieves information to/from a database, and organizes them in reports
    now, i got to print these reports in formatted pages like, for example:
    title centered and bold
    first db record
    second db record
    eccc
    i followed the http://java.sun.com/products/java-media/2D/forDevelopers/sdk12print.html documentation and wrote this class
    import java.awt.print.*;
    import java.awt.*;
    import java.text.*;
    import java.awt.geom.*;
    import java.awt.font.*;
    public class print implements Printable
    //the "\n" token doesn't allow me to do a new line, as i want!!
        String mText="The JavaTM Print Service \n is a new Java Print API that allows printing on all Java platforms, including platforms requiring a small footprint, such as a J2ME profile, but still supports the current Java 2 Print API. Thie Java Print Service API includes an extensible print attribute set based on the standard attributes specified in the Internet Printing Protocol (IPP) 1.1 from the IETF. With the attributes, client and server applications can discover and select printers that have the capabilities specified by the attributes. In addition to the included StreamPrintService, which allows applications to transcode data to different formats, a third party can dynamically install their own print services through the Service Provider Interface ";
        AttributedString mStyledText=new AttributedString(mText);
        static public void main (String args[])
            PrinterJob printerJob=PrinterJob.getPrinterJob();
            PageFormat format=new PageFormat();
            format=printerJob.pageDialog(format);
            Book book=new Book();
            book.append(new print(),format);
            printerJob.setPageable(book);
            boolean doPrint=printerJob.printDialog();
            if(doPrint)
                try
                    printerJob.print();
                catch(PrinterException ex)
                    ex.printStackTrace();
        public int print(java.awt.Graphics g, java.awt.print.PageFormat format, int param) throws java.awt.print.PrinterException
            Graphics2D g2d=(Graphics2D)g;
            g2d.translate(format.getImageableX(), format.getImageableY());
            g2d.setPaint(Color.black);
            g2d.setFont(new Font("Serif",Font.PLAIN,5));  //this doesn't work!!!
            Point2D.Float pen=new Point2D.Float();
            AttributedCharacterIterator charIterator=mStyledText.getIterator();
            LineBreakMeasurer measurer=new LineBreakMeasurer(charIterator,g2d.getFontRenderContext());
            float wrappingWidth=(float) format.getImageableWidth();
            while(measurer.getPosition()<charIterator.getEndIndex())
                TextLayout layout=measurer.nextLayout(wrappingWidth);
                pen.y +=layout.getAscent();
                float dx=layout.isLeftToRight()?0:(wrappingWidth-layout.getAdvance());
                layout.draw(g2d,pen.x+dx, pen.y);
                pen.y+=layout.getDescent()+layout.getLeading();
            return Printable.PAGE_EXISTS;
    }this works, and is great the dialog to choose the paper orientation and the printer, but i'm still not able to do the simplest things: like
    - change the font of my text (as you can see in the print() method)
    - do a new line in my text (as you can see in the beginning of the code)
    so, now that i'm able to print some text, i'd like to be able to change the format of my printable page
    any advice?
    i didn't find any tutorial really complete! anyone can suggest me any?
    thanx a lot in advance
    sandro

    I'm not sure if you still need this, but try \n\r instead of simply \n.
    \n is a new line, but \r signifies the carriage return, back to the left. I'm not sure if it's always necessary, but it was in my case.

  • Creating a .jpg image from with in the J2ME app

    Hi,
    I want to send a document to the printer over bluetooth to print.
    For that I searched on net, but couldn't find any APIs supported by J2ME to print it. I also found a link http://www.hcilab.org/documents/tutorials/Brother/ where I found that I can send the data by creating an image and then writing data (text or image ) in to it, and then sending that image to print.
    Image img = Image.createImage(816, 40);
    Graphics g = img.getGraphics();
    g.setColor(0, 0, 0);
    g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD,Font.SIZE_LARGE));
    g.drawString("Printing test from "
                             + System.getProperty("microedition.platform") + " on "
                             + new Date(), 10, 10, 0);
    driver.print(img, btAddr);This code is working fine on this printer.
    I am using HP 460cb printer, and I tried the same thing, but am not getting any results. Can any one of you tell me what mistake am I making.
                    Image blankImage = Image.createImage(SpotBilling.MAX_IMG_WIDTH, SpotBilling.MAX_IMG_HEIGHT);
                    Graphics g = blankImage.getGraphics();
                    g.setColor(0,0,0);
                    g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_PLAIN, Font.SIZE_SMALL));
                    g.drawString("Printing test on Wednesday - 18th Jan, 2006", 10, 50, Graphics.TOP|Graphics.LEFT);
                    g.drawImage(imgTest, 60, 150, Graphics.HCENTER | Graphics.VCENTER);
                    int width = blankImage.getWidth();
                    int height = blankImage.getHeight();
                    int y = 0;
                    os.write(CMD_UNIVERSAL_EXIT);
                    for(int i = 1; i<=height; i++){
                             blankImage.getRGB(temp, 0, width, 0, y, width, 1);
                             byte[] pixels = new byte[width];
                             for (int x = 0; x < temp.length; x++) {
                                  pixels[x] = (byte) ((((temp[x] & 0x00FF0000) >> 16)
                                       + ((temp[x] & 0x0000FF00) >> 8) + (temp[x] & 0x000000FF)) / 3);
                             // Transfer Raster Graphics
                             os.write(TRANSFER_RASTER_DATA);
                             byte[] len = numToDecimal(pixels.length);
                             os.write(len);
                             os.write(DATA);
                             os.write(pixels);
                             y++;
                        }I have another query, if I can not do this. Is there any way I can create a .jpg image from with in the J2ME application.
    I have some text and an image that I get by invoking camera from the code and then capturing a picture. I need to combine them both, and then send it to the printer.
    If there is any way, I can convert this blankImage mentioned above (containing both text and Image), please provide me the solution.
    Any document or any source code is appreciated.
    regards,
    Ashish

    I have succeeded in creating a mutable image that contains text and image (.png), through
                         Image img;
                         img = Image.createImage(50, 60);
         protected void paint(Graphics g){
              g.drawImage(img, getWidth()/2, getHeight()/2, Graphics.HCENTER | Graphics.VCENTER);
              Graphics graph = img.getGraphics();
              graph.setColor(0, 0, 0);
              graph.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD,
                             Font.SIZE_LARGE));
              graph.drawString("Printing test from "
                                       + System.getProperty("microedition.platform") + " on ", 10, 10, 0);
              graph.drawImage(image, img.getWidth()/2, img.getHeight()/2,Graphics.HCENTER|Graphics.VCENTER);
              graph.fillArc(0,0,10,10,0, 360);
         }Now I want to create a .jpg image of this img image(Mutable image).
    What I am doing is that,
    1. I am converting this image in to int array, using getRGB() method.
    2. Then I am converting int array in to byte array.
    3. And then I am opening a file(extension is .jpg)
    4. Then I am sending this byte array in to the file which is .jpg
    The .jpg file is getting created, but the data in it is very absurd, like yyyyyyyyyyyyyyyyyyyyyyyy.
    Please help me in this matter.
    Regards,
    Ashish

  • Read a text file(database) from a servlet for j2me..?

    Anyone know how to read data from a text file as a database using a servlet for j2me..?
    How to do it..?
    Thanks in advance.

    i tried something like that but there is a NullPointerException... Is what i'm doing correct..?
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class LoginServlet extends HttpServlet {
      private static final String db_server = "localhost/";
      private Connection con = null;
      private String content="";
    public void doPost(HttpServletRequest  request,
                         HttpServletResponse response)
        throws ServletException, IOException
        response.setContentType("text/plain");
        PrintWriter out = response.getWriter();
        String strUserid = request.getParameter("userid");
        String strPassword = request.getParameter("password");
        System.out.println("userid received: " + strUserid);
        System.out.println("password received: " + strPassword);
         try{
                   System.out.println("opening the file....");
                   //String url = "file://"+dbServer+"test.txt";
                   //String uri = "file://localhost/test.txt";
                   String uri = "file://Program Files\Apache Group\Tomcat 4.1\webapps\Project\WEB-INF\classes\trial\test.txt";
                   //String uri = "file:/database/res/test.txt";
                   System.out.println( uri );
                   InputConnection conn = (InputConnection) Connector.open( uri,Connector.READ );
                   System.out.println("connection established");
                   InputStream in = conn.openInputStream();
                   int ch;
                   conn.close(); // doesn't close input stream!
                   System.out.println( "Contents of [" + uri +"]" );
                   while( ( ch = in.read() ) != -1 ){
                   System.out.print( (char) ch );
                   in.close();
                   catch( ConnectionNotFoundException e ){
                  System.out.println( e.toString()+"File could not be found!" );
                  System.out.println( "File could not be found!" );
                   catch( IOException e ){
                       System.out.println( e.toString() );
                   catch( Exception e ){
                       System.out.println( e.toString() );
          out.close();
        } // End try
        catch (Exception e) {
          System.out.println("Exception in doPost(): " + e.getMessage() );
      } // End doPost
    } // End loginServlet

  • J2ME -Servlet communication

    Below is my code i have got some error while running the program...
    plzzzzzzzzzzz....help me out ...it's urgent.
    program having no compiler error but still it is running
    J2ME code:
    package hello;
    public class salesmanlogiin1 extends MIDlet implements CommandListener {
    private Display display=null;
    private TextField userName=null, password=null;
    private Form form=null, form1=null;
    String url = "http://localhost:8080/ServletPrograms/loginservlet2";
    private Command login, cancel;
    String unm=null, pwd=null;
    private StringItem messageLabel;
    public salesmanlogiin1()
    public void startApp()throws MIDletStateChangeException
    display = Display.getDisplay(this);
    messageLabel = new StringItem(null, "Connecting...Please wait.");
    userName = new TextField("LoginID:", userName.getString(), 30, TextField.ANY);
    password = new TextField("Password:",password.getString(), 30, TextField.PASSWORD);
    cancel = new Command("Cancel", Command.CANCEL, 2);
    login = new Command("Login", Command.OK, 2);
    form.append(userName);
    form.append(password);
    form.addCommand(cancel);
    form.addCommand(login);
    form1.append(messageLabel);
    form.setCommandListener(this);
    form1.setCommandListener(this);
    mainMenu();
    public void pauseApp()
    public void destroyApp(boolean unconditional)
    notifyDestroyed();
    void mainMenu()
    {display.setCurrent(form); }
    public void commandAction(Command c, Displayable d) {
    String label = c.getLabel();
    if (label.equals("Cancel"))
    destroyApp(true);
    } else if (label.equals("Login"))
    Thread t = new Thread()
    {       public void run()
    try
    invokeServlet(url);
    catch (IOException e)
    e.printStackTrace();
    t.start(); }
    void invokeServlet(String url) throws IOException {
    HttpConnection c = null;
    InputStream is = null;
    OutputStream os = null;
    StringBuffer b = new StringBuffer();
    unm = userName.getString();
    pwd = password.getString();
    String msg=null;
    TextBox t1=null;
    try {
    url = url + "?username=" + unm + "&password=" + pwd;
    c = (HttpConnection) Connector.open(url);
    c.setRequestMethod(HttpConnection.POST);
    c.setRequestProperty("User-Agent", "Profile/MIDP-2.1 Configuration/CLDC-1.1");
    c.setRequestProperty("Content-Language", "en-CA");
    os = c.openOutputStream();
    String str = unm;
    byte postmsg[] = str.getBytes();
    for (int i = 0; i < postmsg.length; i++) {
    os.write(postmsg);
    os.flush();
    String str1 = pwd;
    byte postmsg2[] = str1.getBytes();
    for (int i = 0; i < postmsg2.length; i++)
    os.write(postmsg2[i]);
    os.flush();
    is = c.openDataInputStream();
    int ch;
    while ((ch = is.read()) != -1)
    b.append((char) ch));
    t1 = new TextBox("Second Servlet", b.toString(), 1024, 0);
    t1.setCommandListener(this);
    } catch (Exception e)
    e.printStackTrace();
    finally
    {if (is != null)  {  is.close();}
    if (os != null){os.close();}
    if (c != null){c.close();}
    display.setCurrent(t1);
    Servlet Code:
    package ServletDemo;     
    import java.sql.*;
    public class loginservlet2 extends HttpServlet {
    BufferedReader br;
    String buf="";
    boolean flg=false;
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    response.setContentType("text;charset=UTF-8");
    PrintWriter out = response.getWriter();
    String username = request.getParameter("unm");
    String password = request.getParameter("pwd");
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:sdb");
    Statement s = con.createStatement();
    ResultSet rs = s.executeQuery("select * from login");
    while(rs.next())
    if(rs.getString(1).equals(username)&&rs.getString(2).equals(password))
    flg=true;
    if(flg==false){
    out.print("Failed");
    s.close();
    con.close();
    }else{
    out.print("valid user");
    s.close();
    con.close();
    }catch(Exception e){
    out.println(e);
    out.flush();
    out.close();
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    processRequest(request, response);
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    processRequest(request, response);
    public String getServletInfo() {
    return "Short description";
    Warnings while running the program
    TRACE: <at java.lang.NullPointerException: 0>, startApp threw an Exception
    java.lang.NullPointerException: 0
    javacall_lifecycle_state_changed() lifecycle: event is JAVACALL_LIFECYCLE_MIDLET_SHUTDOWNstatus is JAVACALL_OK

    First of all, when you post code, please, use the "code" tags.
    I can't test your code but I start to analyse the method startApp() and there is:
    userName = new TextField("LoginID:", userName.getString(), 30, TextField.ANY);The object userName is null so
    userName.getString()throws a NullPointerException for sure!
    Hope this helps.

  • J2ME - Tomcat Server

    Hello,
    I am using a Tomcat Server for a J2ME app that sends an HTTP Post request to the Tomcat Server. The Tomcat Server does some back end-processing and prints a response to the J2ME app.
    However, occaisionally on my phone I get an error message: Error 500 with the following details:
    HTTP Status 500
    Exception Report Message Description
    The server encountered an internal error that prevented it from fulfilling this reqest.
    Exception: java.io.EOFException
    java.io.DataInputStream.readUnsignedShort(DataInputStream.java:400)
    java.io.DataInputStream.readUTF(DataInputStream.java:633)
    java.io.DataInputStream.readUTF(DataInputStream.java:610)
    trans.doPost(trans.java:85)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    filters.ExampleFilter.doFilter(ExampleFilter.java:101)
    Any help on this will be most appreciated.

    I got it working. The inputstream on midlet was not closed causing the problem.

  • Problems downloading j2me

    Hi,
    I have just downloaded j2se 1.4.1_02 and studio one mobile. I am now trying to download the j2me toolkit, but an error message is consistenly printed out midway into the installation. The message says that "cannot find main class. Program will exit".
    Please help

    hard to guess what's wrong. are you sure downloads went fine? i suggest using dedicated download managers instead of built in mozilla/ie/netscape download mechanism. check file sizes and be sure they're correct.

  • How do you send an email from a J2ME application

    I am writing apps in J2ME and would like to generate emails in my apps, and send them to a printer, as a means of getting printed output from my apps.  Can anyone tell me how to do this please?

    You may get lucky here, but I think you'd be much better served asking your question in a developer's forum...if you google "J2ME developers forum" or similar (or even "generate emails from J2ME programs" you should be able to get to what you need.  
    Good luck, sounds like an interesting approach. 
    I am an HP employee.

Maybe you are looking for

  • Color Correcting Multicam Clip

    I have a two camera project.  I am color correcting the project.  I can see where doing the color work in the timeline would be very ineffective.  The Angle Editor would be a much more efficient way to go.  My problem is that once I open the Angle Ed

  • Zero value shopping carts

    Could someone advise me what is the process to have the functionality within SRM 5.0 of creating shopping carts for a zero value (free of charge). Background, we have implemented a extended classic scenario.

  • I've disconnected iPhoto from my main photo collection

    While poking around on an external hard drive, I came across an old folder of photos. I click to open it and iPhoto said I had to update the folder with iPhoto in order to view it, which I did. The folder contained just a few old photos. But now, I o

  • Problem with iMovie 6?

    I loaded iLife 6 a few months ago and have done 2 iMovie projects with it and with both these projects the video freezes while the audio still plays. I never had this problem with my previous iMovie version. I've put it to sleep for 10 seconds & done

  • Exception Aggregation on a Formula Variable?

    I need to create an exception aggregation on a formula variable, but the properties dialog box of the calculated key figure doesn't have the options of exception aggregation. Only field available is "Time of aggregation" and I don't want to use that