Print in MIDP ...

How to print some text to a printer connectting with the PALM ?
tks.

[jun_w],
If you are referring to printing from a Palm OS device using MIDP, I am afraid you are out of luck as the MIDP specification does not make provision for any print APIs in MIDP, at least for the current MIDP 1.0 specifications.
HTH.
Allen Lai
Developer Technical Support
SUN Microsystems
http://www.sun.com/developers/support/

Similar Messages

  • Need help! Please view...

    Hello. I need help with another programming project that I want to write. What it should do at the very least would be to actually print the contents of a TextBox on a PC Printer, with the phone connected to the PC via Com Port(s) with cables. The MIDlet is currently written with MIDP 1.
    I'am aware that J2sdk SE has PrintJob and Book objects that actually simplify printing, but MIDP 1 has nothing of the sort.
    1.) what would you guys suggest? Is there a way for me to create a printer program in MIDP or do I have to create it with J2sdk SE?
    2.) if ever that the printer program would have to be written with j2sdk SE, how would I go about passing the actual data from the MIDlet to the program? Is it possible, and if it is, is there any way I could synchronize both?
    Thanks a lot.

    depends on what kind of communication you can establish over the serial cable. If you have the possibility to communicate using TCP/IP & HTTP i would use a servlet on the server side, send the data to the servlet, let the servlet do the whole template/layout und pre-print job and the print it from the servlet.
    This would give you a quite powerfull solution, since you may do a lot of work on the server side (like additional db operations, queueing print jobs, ...) and you could then connect to your little 'print server' via HTTP, means, no matter if the request comes via serial cable, internet, bluetooth....

  • MIDP 1.0: Image to byte[] or serializing...

    I would like to extract pixels from a MIDP 1.0 "Image" object through any means possible. I am currently under the impression that "Image.toString()" would just do something lame, like giving me a string like "Image@1234" that identifies the class and the instance -- which could in principle be used for mere instance comparison. Anyhow, if I could serialize an Image object to a file, and then read back the file in to a byte array, then I would be delighted. I want to stress that I don't care how convoluted the approach may be, as long as it is in plain-vanilla J2ME Java code for MIDP 1.0 and is capable of working on an actual device (as opposed to an emulator). Can I cast the Image to Object, and then somehow convert to byte[]? I don't care if I have to get down and dirty, hacking the platform-specific bytes of the full Object manifestation of the Image. Anyhow, I want to make it clear that any hard core hack, doing all kinds of things that would break on different VMs, etc, is totally fine. Messy is fine. I just want access to the binary data of the entire Image object, or, even better (but only icing on the proverbial cake), access to pixel data. If I can get the byte[] representation of Image, then I can hack the rest myself.

    My goal was do a capture of the way things actually rendered on a device, kind of like a "screen capture", only a little more indirect (since I don't think there is a way to get access to the pixels of the LCD). What I have to do is render to an off-screen Image object and then retrieve pixel data from it using the platform-dependent getPixels() supplied by Motorola. You're going to think I'm crazy, but I send this image data to a web server via POSTs, which get collected and stored as a single file on my web server. Voila! A screen capture of how things actually render to an Image object on an actual device.
    Everything works, except...
    I can't get the Motorola "getPixels()" method to work in their emulator, so I'm worried
    that it won't work on my Motorola T720 (something I haven't actually tried, though).
    I get a "Uncaught Exception: java/lang/Error" message from the T720 emulator
    when I run one of the Motorola demos (built using their scripts) when I add the
    following code to the Canvas paint() method:
    if (0 == iDidThis) {  iDidThis = 1;
    try
    {  javax.microedition.lcdui.Image   temp = Image.createImage( 120, 160 );
    int [] rgbData = new int [120*160];
    com.motorola.game.ImageUtil.getPixels ( temp, 0, 0, 1, 1, rgbData );
    System.out.println("Captured Data");
    catch( java.lang.ArrayIndexOutOfBoundsException e )
    {  e.printStackTrace();   } }
    This code runs only once, when the paint() method of the Canvas object is called for
    the first time. Okay, I get the error message, but the "Bounce" demo (to which I added
    the code block above) goes on to run just fine. (NOTE: The message "Captured Data"
    is NOT printed in this scenario.)
    I don't understand why the public static "com.motorola.game.ImageUtil.getPixels()"
    method causes the "java/lang/Error" exception. (By the way, if I comment out the
    call to this method, the code totally works without error, and I see the printed
    statement "Captured Data" in the command window associated with the emulator.)
    If my getPixels() call resulted in bad array access, then I would get the
    java.lang.ArrayIndexOutOfBoundsException exception. But apparently this is
    not what is going on.
    I am really rusty with J2ME, so I don't even know the meaning of "java/lang/Error".
    I assume it is different from a "class not found" exception, but I suspect that my
    problem has to do with a fault in the emulator trying to execute the code for the
    "com.motorola.game.ImageUtil.getPixels()" method.
    My Motorola emulator (v7.5) is from around December, 2002, so it may be really old, and
    maybe this was a known issue at that time that has since been resolved. I'm just never
    tried to use platform-specific J2ME APIs before, so I don't know if what I am observing
    is my fault, or is an emulator issue.
    I'd be grateful for any ideas about what might be going wrong and for ideas about
    possible solutions.

  • Settings in MIDP

    Hello
    I'm trying to build a settings class for mobile devices, but the problem is that I found only one possibillity to save settings, and that's record stores. Record store's draw back is that I shall read my settings with record's associated id, so I must remember the id for every settings. I dont understand how can i do this, anyone can help? thanks :)

    you think that it is urgent but it is not so urgent !!
    you are not the only one...
    so, create a custom class Settings
    * Exemple to show that it s possible to store all the parameters settings
    * in a java class called <code>Settings</code>. This class contains
    * the login, the password, the host ...
    * @author <your_name>
    public class Settings{
      // contains all the stuff needed for your connexion
      private String login;
      private String ...
      public Settings(...){
        // fillin the class
    }and in your MIDlet..
    RecordStore rs = null;
    Settings settings=null;
    try {
      rs = RecordStore.openRecordStore( rsName, false );
      treateRS(rs);// treate the RecordStore
    } catch( RecordStoreException e ){
      // print the exception
    } finally {
      try {
        rs.closeRecordStore();
      } catch( RecordStoreException e ){
        // Ignore this exception
    public void treateRS(RecordStore record){
      // get the Settings object, analyse it,etc ...
    }is it clearer?
    check these links for more infos on RecordStore...
    http://developers.sun.com/techtopics/mobility/midp/articles/databaserms/
    http://developers.sun.com/techtopics/mobility/midp/articles/databasemap/
    (links come from http://developers.sun.com/techtopics/mobility/allarticles/#databases)

  • Need HELP for MIDP application.

    i was having problems in row 45-70 and from row 88-105 which im not so sure weither i write it correctly or not.
    i wanted to do an application using MIDP where user can view question and chose the answer using List.
    The question can be get from database and the answer chose are needed to be written in text file.
    ======================================================import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    public class NotSoSimpleFace extends MIDlet implements CommandListener
      private Display display;
      private Command exit;
      private Command next;
      private Command finish;
      private List list;
      private int QNo=1;
      public NotSoSimpleFace()
        display = Display.getDisplay(this);
      public void startApp()
          Question(QNo);
      public void pauseApp()
      public void destroyApp(boolean unconditional)
         notifyDestroyed();
      public void commandAction(Command command, Displayable Displayable)
        if (command == next)
         boolean choice[] = new boolean[list.size()];
         list.getSelectedFlags(choice);
         for (int x = 0; x < 4; x++)
                 if (choice[x])
                   System.out.println(list.getString(x));
                //Write to Text File in Append Mode
                //..."//root1/answer.txt;append=true", Connector.WRITE
                 OutputConnection connection = (OutputConnection)                    
                 Connector.open("file:///root1/answer.txt; append=true" Connector.WRITE );
                 OutputStream out = connection.openOutputStream();
                 PrintStream output = new PrintStream( out );
                 output.println( "Answer 1 is:" + list.append(x));
                 output.println( "Answer 2 is:" + list.append(x));
                 output.println( "Answer 3 is:" + list.append(x));
                 output.println( "Answer 4 is:" + list.append(x));
                 out.close();
                 connection.close();
                   Alert alert = new Alert("Completed", "Data Written", null, null);
                 alert.setTimeout(Alert.FOREVER);
                 alert.setType(AlertType.ERROR);
                 display.setCurrent(alert);
         QNo+=1;
         if (QNo <= 4) {
              Question(QNo);
         } else {
               destroyApp(true);
        else if (command == exit)
          destroyApp(true);
      private void Question(int no)
                String url = "jdbc:odbc:MyODBC";
             Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
             Connection c = DriverManager.getConnection(url,"","");
             Statement s = c.createStatement();
             ResultSet rs = s.executeQuery ("select Question from Question");
             while (rs.next())
              FileOutputStream fout =  new FileOutputStream("sample.txt");
             PrintStream myOutput = new PrintStream(fout);
        list = new List( myOutput.print(rs.getString(1) + "\t") + no, List.MULTIPLE);
        list.append("A", null);
        list.append("B", null);
        list.append("C", null); 
        list.append("D", null); 
        exit = new Command("Exit", Command.EXIT, 1);
        if (no == 4) {
          next = new Command("Finish", Command.EXIT, 2);
        } else {
          next = new Command("Next", Command.EXIT, 2);
        list.addCommand(exit);
        list.addCommand(next);
        list.setCommandListener(this);  
        display.setCurrent(list);
    }

    Ok, I haven't really worked much with files in J2ME and I haven't worked with MIDP 2.0 at all, but I'm fairly certain that there is no JDBC available in CLDC. If you're programming for a mobile phone then you can't use SQL. It's only available for CDC
    You're on the right track with the Connector; explore that further.
    But not every phone has a filesystem; keep that in mind. Some only expose an RMS for data storage to MIDlets.
    Message was edited by:
    nogoodatcoding

  • 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

  • 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

  • Can our hp laserjet enterprise 500 color printer m551use 67lb card stock?

    The printer specifications list card stock but no weights. 
    This question was solved.
    View Solution.

    Hello,
    the required media weight is not supported by the printer.
    As you may find listed within the Media Weight specification below, the printer support up to 58 lb media.
    Media weight:
    Tray 1: 16 to 58 lb (plain); 28 to 58 lb (glossy);
    Tray 2: 16 to 43 lb (plain paper); 28 to 58 lb (glossy paper)
     You may find the product specification below:
    http://h10010.www1.hp.com/wwpc/us/en/sm/WF06b/18972-18972-3328060-15077-236268-4184772-4184773-41847...
    Regards,
    Shlomi
    Say thanks by clicking the Kudos thumb up in the post.
    If my post resolve your problem please mark it as an Accepted Solution

  • Print Quote Report

    Hi All,
    I have a requirement to develop the custom print Quote Report. When i review the standard pring quote report ,I found a call like <?call-template:TermsTemplate?>.
    This statment itself is getting all the Terms and Conditions for that report. when i looked in the ASOPRTXSL.xsl, I see the below statement
    <xsl:template name="TermsTemplate">
    <xsl:call-template name="PrintContractTerms"/>
    </xsl:template>
    I am pretty new to XSL, dont know what's happening here. Please help me ASAP
    I have also posted this question in BI Publisher but did not get any respose . Please Help
    Thanks

    If you want to create a custom report using concurrent program then refer:
    http://apps2fusion.com/apps/apps/63-xml-publisher-concurrent-program-xmlp
    If you want to create a custom report using OAF page then refer:
    http://apps2fusion.com/at/51-ps/260-integrating-xml-publisher-and-oa-framework
    -Anand

  • HELP to Open and Print automatic a REPORT

    Hello, I'm a Portuguese Developer, and i've a challenge, that is, i want to open REPORT by FORMS in RDF format and i want to open and print automatic way, i do not want to open, and then have to go print button to pint them.
    I want to open by FORM way and print automatic and close imediatly.
    HEP ME PLEASE!
    Thank you

    Aslam o Alikum (Hi)
    Ofcourse you can do this by specifing system parameters like DESTYPE=Printer and DESNAME=PrinterName
    Replace PrinterName with you printer name
    See System Parameters in Reports Under Data Model

  • Queation Regaring Print Quote Report

    Hi All,
    I have a requirement to develop the custom print Quote Report. When i review the standard pring quote report ,I found a call like <?call-template:TermsTemplate?>.
    This statment itself is getting all the Terms and Conditions for that report. when i looked in the ASOPRTXSL.xsl, I see the below statement
    <xsl:template name="TermsTemplate">
    <xsl:call-template name="PrintContractTerms"/>
    </xsl:template>
    I am pretty new to XSL, dont know what's happening here. Please help me ASAP
    Thanks

    Can anyone answer this please. This is urgent . Thanks

  • Questions on Print Quote report

    Hi,
    I'm fairly new to Oracle Quoting and trying to get familiar with it. I have a few questions and would appreciate if anyone answers them
    1) We have a requirement to customize the Print Quote report. I searched these forums and found that this report can be defined either as a XML Publisher report or an Oracle Reports report depending on a profile option. Can you please let me know what the name of the profile option is?
    2) When I select the 'Print Quote' option from the Actions drop down in the quoting page and click Submit I get the report printed and see the following URL in my browser.
    http://<host>:<port>/dev60cgi/rwcgi60?PROJ03_APPS+report=/proj3/app/appltop/aso/11.5.0/reports/US/ASOPQTEL.rdf+DESTYPE=CACHE+P_TCK_ID=23731428+P_EXECUTABLE=N+P_SHOW_CHARGES=N+P_SHOW_CATG_TOT=N+P_SHOW_PRICE_ADJ=Y+P_SESSION_ID=c-RAuP8LOvdnv30grRzKqUQs:S+P_SHOW_HDR_ATTACH=N+P_SHOW_LINE_ATTACH=N+P_SHOW_HDR_SALESUPP=N+P_SHOW_LN_SALESUPP=N+TOLERANCE=0+DESFORMAT=RTF+DESNAME=Quote.rtf
    Does it mean that the profile in our case is set to call the rdf since it has reference to ASOPQTEL.rdf in the above url?
    3) When you click on submit button do we have something like this in the jsp code: On click call ASOPQTEL.rdf. Is the report called using a concurrent program? I want to know how the report is getting invoked?
    4) If we want to customize the jsp pages can you please let me know the steps involved in making the customizations and testing them.
    Thanks and Appreciate your patience
    -PC

    1) We have a requirement to customize the Print Quote report. I searched these forums and found that this report can be defined either as a XML Publisher report or an Oracle Reports report depending on a profile option. Can you please let me know what the name of the profile option is?
    I think I posted it in one of the threads2) When I select the 'Print Quote' option from the Actions drop down in the quoting page and click Submit I get the report printed and see the following URL in my browser.
    http://<host>:<port>/dev60cgi/rwcgi60?PROJ03_APPS+report=/proj3/app/appltop/aso/11.5.0/reports/US/ASOPQTEL.rdf+DESTYPE=CACHE+P_TCK_ID=23731428+P_EXECUTABLE=N+P_SHOW_CHARGES=N+P_SHOW_CATG_TOT=N+P_SHOW_PRICE_ADJ=Y+P_SESSION_ID=c-RAuP8LOvdnv30grRzKqUQs:S+P_SHOW_HDR_ATTACH=N+P_SHOW_LINE_ATTACH=N+P_SHOW_HDR_SALESUPP=N+P_SHOW_LN_SALESUPP=N+TOLERANCE=0+DESFORMAT=RTF+DESNAME=Quote.rtf
    Does it mean that the profile in our case is set to call the rdf since it has reference to ASOPQTEL.rdf in the above url?
    Yes, your understanding is correct.3) When you click on submit button do we have something like this in the jsp code: On click call ASOPQTEL.rdf. Is the report called using a concurrent program? I want to know how the report is getting invoked?
    No, there is no conc program getting called, you can directly call a report in a browser window, Oracle reports server will execute the report and send the HTTP response to the browser.4) If we want to customize the jsp pages can you please let me know the steps involved in making the customizations and testing them.
    This is detailed in many threads.Thanks
    Tapash

  • Printing list view in ical

    I use mail and ical for everything now. Everything is fine except When I want to print the "list view" which shows my “to dos”. It displays the URL the “do to” is attached to in mail. I use notes often in mail and enter to dos in the notes so they will have URL links. The link only becomes a nuisance when I want to print, otherwise it’s very useful.
    Why would the long URL paths display when in print view???!!!!! It doesn’t make any sense.
    Is there anything I can do?
    Thank you

    ecernek,
    There is no event list option on iCal like the one on the iPhone.
    That number means that you have an event invitation. Use iCal>View>Show Notifications to choose what to do with the notification.

  • How can I print just the year view in iCal?

    Just trying to print the year view.

    If you choose the "list" option in View on the print dialog box and uncheck everything at the bottom except "To do items" you may be able to get what you're looking for.  It appears that the list includes all todos including those without due dates, so you might have to do something to assign due dates to all your todos and in iCal preferences restrict the visibility of todos outside of a certain date range.  Unfortunately, you can't save any of this work into a standard report (at least not that I know of) - the print dialog in iCal starts from scratch every time you invoke it.  Hope that helps at least some.

  • How to print monthly view in ical

    I have the most current version of ical.  It wont let us print a monthly view.  It only lets us select fro day or list.  I am sure i am doing someething wrong, but I dont know what.  Running MAC OS X 10.5.8. 
    Ical version 3.0.8. 

    earlnkids,
    The text size selection should be available in the first page of the iCal print options:

Maybe you are looking for