Using platformRequest in MIDP 2.0

I'm trying to use the platformRequest() method in MIDP 2.0 but when I test it on an emulator (on Wireless Toolkit or Jbuilder) I get a message that it is not configured. Do you know what's all about?
Thanks,
Marius

Hello and thanks for answering me.
The problem is that I need the emulator's AMS to load a MIDlet when the URL refers to a .jad file. So I need to configure it somhow to do the OTA Provisioning, not to display in a browser. Do you know how could I configure the plaformRequest() method to install the refered MIDlet?

Similar Messages

  • Help need on using platformRequest()?

    hi,
    any one can help me,how to use platformRequest()
    and open public url in mobile broser.
    what libries need for javax.microedition.midlet.MIDlet.platformRequest
    for this.
    please send simple code how to call public url in mobile ?
    thanks
    siva

    hi all
    i already solve this .
    siva

  • Opening a HTML file using platformRequest

    Hi all,
    I am able to open a URL using the platformRequest() method.
    However, is it possible to open a HTML file which is stored in the file system? I tried the code given below, but it didn't work.
    platformRequest("file:///root1/Temp.html");Is this possible?
    Thanks,
    Venkat

    Hey Venkat,
    From what I understand, this HTML file is not inside your JAR -it is in the file system of the phone. In MIDP 2.0, for accessing the file system of the mobile, there are optional APIs that a MIDP device needs to support. This code will not work for MIDP 2.0

  • How to use buttons in MIDP

    Hi all,
    I m currently building a calculator in MIDP and as there is no Button class so would like to know how to make some custom buttons ?
    Thanks in advance.
    - Tanveer

    Hi Friend,
    You can do these with the use of keyPressed(keyCode) event of the canvas and String or StringItem class. You just cast that keyCode in the char and assign it to the string you.
    e.g.
    String temp;
    public void keyPressed(keyCode)
    if(keyCode >=48 || keyCode <= 57)
    temp = temp + char(keyCode);
    so you can only get the keyStroks between 0 to 9.
    feel free to comunicate with me. [email protected]
    Regards,
    Himanshu

  • Difficulties for launching process execution with platformRequest(String)

    Hello,
    by April, 10, I have posted a message concerning how to lauch a process by means of a midlet. I have got a response from your part to proposing to use:
    platformRequest(String).
    I have tested this command successfully for lauching webpages.
    But It did not work for lauching programs such as "java myprog"
    It seems that the platformRequest(String) cannot lauch the dos prompt
    and therefore the process hangs. The displayed message is: Performing platformRequest for URL: java myprog
    I wonder if someone can provide an example of a midlet that lauches the execution of a program.
    Thanks for your help
    wahab

    a mobile device is not a personal computer...
    could you please re-read this:
    platformRequest
    public final boolean platformRequest(String URL)
                                  throws ConnectionNotFoundException
        Requests that the device handle (for example, display or install) the indicated URL.
        If the platform has the appropriate capabilities and resources available, it SHOULD
    bring the appropriate application to the foreground and let the user interact with the
    content, while keeping the MIDlet suite running in the background. If the platform does not
    have appropriate capabilities or resources available, it MAY wait to handle the URL
    request until after the MIDlet suite exits. In this case, when the requesting MIDlet suite
    exits, the platform MUST then bring the appropriate application (if one exists) to the
    foreground to let the user interact with the content.
    This is a non-blocking method. In addition, this method does NOT queue multiple
    requests. On platforms where the MIDlet suite must exit before the request is handled, the
    platform MUST handle only the last request made. On platforms where the MIDlet suite
    and the request can be handled concurrently, each request that the MIDlet suite makes
    MUST be passed to the platform software for handling in a timely fashion.
    If the URL specified refers to a MIDlet suite (either an Application Descriptor or a JAR file),
    the application handling the request MUST interpret it as a request to install the named
    package. In this case, the platform's normal MIDlet suite installation process SHOULD be
    used, and the user MUST be allowed to control the process (including cancelling the
    download and/or installation). If the MIDlet suite being installed is an update of the
    currently running MIDlet suite, the platform MUST first stop the currently running MIDlet
    suite before performing the update. On some platforms, the currently running MIDlet suite
    MAY need to be stopped before any installations can occur.
      If the URL specified is of the form tel:<number>, as specified in RFC2806, then the
    platform MUST interpret this as a request to initiate a voice call. The request MUST be
    passed to the "phone" application to handle if one is present in the platform. The "phone"
    application, if present, MUST be able to set up local and global phone calls and also
    perform DTMF post dialing. Not all elements of RFC2806 need be implemented,
    especially the area-specifier or any other requirement on the terminal to know its context.
    The isdn-subaddress, service-provider and future-extension may also be ignored. Pauses
    during dialing are not relevant in some telephony services.
      Devices MAY choose to support additional URL schemes beyond the requirements listed
    above.
        Many of the ways this method will be used could have a financial impact to the user
    (e.g. transferring data through a wireless network, or initiating a voice call). Therefore the
    platform MUST ask the user to explicitly acknowlege each request before the action is
    taken. Implementation freedoms are possible so that a pleasant user experience is
    retained. For example, some platforms may put up a dialog for each request asking the
    user for permission, while other platforms may launch the appropriate application and
    populate the URL or phone number fields, but not take the action until the user explicitly
    clicks the load or dial buttons.
        Parameters:
            URL - The URL for the platform to load. An empty string (not null) cancels any pending requests.
        Returns:
            true if the MIDlet suite MUST first exit before the content can be fetched.
        Throws:
            ConnectionNotFoundException - if the platform cannot handle the URL requested.
        Since:
            MIDP 2.0use PushRegistry if you wanna call different MIDlets
    or try C and C++ or SAVAJE mobile os
    and you said that you have ever posted something but there's only one message registered
    with your new OP's name...
    edited by
    supareno

  • PlatformRequest() doesn't accept "&"

    I want to open an URL , and i use platformRequest()
    for example platformRequest("http://www.google.co.th/search?hl=th&q=platformRequest&meta=");
    It open a web browser on my computer but it just connect to "http://www.google.co.th/search?hl=th" Which mean that it doesn't count "&" and the rest address after "&". Could anybody help me about this. Doesn't platformRequest() accept "&" ? thank a lot

    Looks like you're using WTK 2.2 or earlier.
    Download and install WTK 2.5.
    WTK2.5 - http://java.sun.com/products/sjwtoolkit/download-2_5.html
    If you're using NetBeans, for instructions on how to integrate the WTK 2.5, see
    http://www.netbeans.org/kb/55/quickstart-mobility.html --> it's about halfway down the page. Add WTK 2.5 platform.
    Cheers, Darryl

  • Using a relational database

    i want to develop a dictionary midlet. i have to use a database, since there will be about 70000 entries. is there any free or open-source database i can use with CLDC-MIDP-1.0?
    how about if I use RMS? How will be the performance with so many entries; especially searching and sorting??

    Performance would suck big time with RMS (RMS is one of the slowest things in MIDP). And I don't know how many entries you'll be able to put in there (unless you're target device is a high end phone with a lot of RMS memory). I think you should use a remote database and connect via the network to look up words...

  • Socket in midp

    I wont to use socket connection in my midlet. I couldn't find the way to do this. I tryed to open ContentConnection or Stream connection but than i couldn't open inputstream nor datainputstream. On sun.com i found this code:
    package com.sun.midp.io.j2me.socket;
    import com.sun.cldc.io.ConnectionBase;
    import javax.microedition.io.Connection;
    import javax.microedition.io.StreamConnection;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.io.DataInputStream;
    import java.io.DataOutputStream;
    import com.sun.cldc.io.j2me.socket.Protocol;
    public class Protocol extends com.sun.cldc.io.j2me.socket.Protocol
    public Connection c;
    public Protocol()
    super();
    System.out.println("Protocol.ConnectionBase() called");
    public void open(String uri, int mode, boolean to) throws IOExcepti
    c = super.openPrim(uri, 0, false);
    System.out.println("openPrim() called");
    public InputStream openInputStream() throws IOException {
    return super.openInputStream();
    public DataInputStream openDataInputStream() throws IOException {
    return super.openDataInputStream();
    public OutputStream openOutputStream() throws IOException {
    return super.openOutputStream();
    public DataOutputStream openDataOutputStream() throws IOException {
    return super.openDataOutputStream();
    i used this but there always comes an exception:
    Protocol.ConnectionBase() called
    java.lang.IllegalArgumentException
         at com.sun.cldc.io.j2me.socket.Protocol.openPrim(+7)
         at com.sun.midp.io.InternalConnector.openPrim(+231)
         at com.sun.midp.io.InternalConnector.open(+9)
         at javax.microedition.io.Connector.open(+6)
         at javax.microedition.io.Connector.open(+6)
         at javax.microedition.io.Connector.open(+5)
         at KConnection.KConnector.open(+6)
         at KConnection.KConnector.connect(+6)
         at SerwisMain.getK(+18)
         at SerwisMain.startApp(+348)
         at javax.microedition.midlet.MIDletProxy.startApp(+7)
         at com.sun.midp.midlet.Scheduler.schedule(+225)
         at com.sun.midp.dev.DevMIDletSuiteImpl.schedule(+7)
         at com.sun.midp.Main.runLocalClass(+20)
         at com.sun.midp.Main.main(+68)
    can anybodey tell me how can i open input and output stream and write and read from them as iwont and how long i wont?
    Please help

    First: what MIDP Version do you want to use? In MIDP 1.0 there are no sockets available, only HttpConnection and DatagramConnection. For socket use you have to deal with the MIDP 2.0
    And in MIDP 2.0 you have a javax.microedition.io.SocketConnection which you can use for that.
    // copied from the MIDP 2.0 Javadoc (javax.microedition.io.SocketConnection)
       SocketConnection sc = (SocketConnection)Connector.open("socket://host.com:79");
       sc.setSocketOption(SocketConnection.LINGER, 5);
       InputStream is  = sc.openInputStream();
       OutputStream os = sc.openOutputStream();
       os.write("\r\n".getBytes());
       int ch = 0;
       while(ch != -1) {
           ch = is.read();
       is.close();
       os.close();
       sc.close();you dont have to deal with com.sun.anything packages or classes unless you want to change the implemenation-details of the protocols.
    hth
    Kay

  • Error when trying first test "midp HelloMidp"

    Hello,
    I'm a newbie with j2me I have a small problem to create my first application.
    I'm tried an example I read in a book.
    Here is the code of my class:
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    public class HelloMidp extends MIDlet {
    public void startApp() {
    Form form = new Form("HelloMidp");
    Display.getDisplay (this).setCurrent (form);
    public void pauseApp(){
    public void destroyApp(boolean unconditional){
    I have defined some environment variables under WinXP:
    MIDP_BCP=C:\j2me\midp2.0fcs\classes
    MIDP_HOME=C:\j2me\midp2.0fcs
    I can compile my class with
    javac -bootclasspath %MIDP_BCP% HelloMidp.java
    There is no error.
    I can preverify with
    preverify -classpath .;%MIDP_BCP% HelloMidp
    There is no error.
    But when I want to test it with midp.exe
    I use "cd output", "midp HelloMidp"
    I receive the error "java.lang.ClassNotFoundException: HelloMidp"
    I don't understand where is the problem.
    Thanks in advance.
    Alain.

    hmm...
    in general it should work, if you are in the ouput dir (as you said), use the "-cp ." for classpath definition to the local directory and name the class (as you did).
    try this "midp -cp . HelloMidp" from the directory, where the class is located. (you may add more paths seperated with ; to the cp (abbr. for classpath, should work also).
    Well, and with the WTK, simply create a new project, put the HelloMidp in the src dir, specify it as MIDlet or Application and (build and) run it. I dont understand, why this should not work. Strange...
    hth
    Kay

  • Initiative message sending from server to MIDP client.

    Hi, guys,
    I wanna build a c/s application using CLDC and MIDP, the problem is the expected system should have a capability of making server and client could communicate in demand, i.e. let either server or client send initiative messages to the opposite side.
    But currently, HTTP support couldn't match such requirement, so anybody could raise a good idea?
    Thanks a lot!

    [xiaxing],
    You might find this feature that you are looking for in the next MIDP 2.0 specification when it supports "Push Architecture". This feature allows the MIDlet to request the handset to listen for certain data or connections and launch the MIDlet or give it connection when listener receives the correct data or connection.
    You can access the details of the JSR for the MIDP 2.0 specification from:
    http://jcp.org/jsr/detail/118.jsp
    HTH.
    Rgds,
    Allen Lai
    Developer Technical Support
    Sun Microsystems
    http://access1.sun.com

  • JTextPane in MIDP

    Hi, I'm trying to develop text editor for MIDP2.0, can I use jTextPane in MIDP...??
    Thank You.

    You mean a Swing component? No.

  • Is MIDP 2.0 and CLDC  inluded in Sun Java Wireless Toolkit 2.5 for CLDC?

    I downloaded the "Sun Java Wireless Toolkit 2.5 for CLDC" and "Sun Java Toolkit 1.0 for CDC" and I have JDK 6.
    do I need to download anything else or is this all I need to make applications for cdc and cldc devices??
    please help.
    thank you.

    Most devices used today support MIDP 2.0, but not all of them support CLDC 1.1. If you can do without floats, it's better to restrict yourself to CLDC 1.0 & MIDP 2.0. Devices which only support MIDP 1.0 aren't suitable for today's game development anyway (performance, resolution...) so personally I'd suggest not bothering with them if you don't have to.
    Here are some lists you can use to help you decide what to use, based on how many devices you want to target:
    http://www.j2mepolish.org/devices/platform.html
    These lists aren't complete, so please let me know if you find better ones.

  • Timers in MIDP 2.0 question

    elo! i have a question regarding using timers in midp 2.0.. i have a series of frames for my player in order to show its "walking effect" on the screen. i used timer.shedule(TimerTask, long, long) and it showed the "walking effect" almost perfect. now, i have series of frames for my attack sequence (a player holding a sword for example).. is it possible to use different time delays between my frames? for example, i have 4 frames for my attack sequence, first frame for .5ms, second frame for 1ms, third frame for .7ms and so on..?
    i really am wondering..

    TimerTasks are not a very good way to control animations in MIDP. You should learn how to use a thread to run a game loop, and control the animation from there. For example:
    class MyCanvas extends Canvas implements Runnable {
      boolean running, paused;
      void start() {
        running = true;
        paused = false;
        (new Thread(this)).start();
      void pause(boolean pause) {
        paused = pause;
      void stop() {
        running = false;
      public void run() {
        long lastTime = System.currentTimeMillis(), time, deltaTime;
        while (running) {
          time = System.currentTimeMillis();
          deltaTime = lastTime - time;
          // update all your variables. deltaTime is the time since the last update, so this way you can control
          // everything timed whatever way you want
          update(deltaTime);
          repaint();
          serviceRepaints();
          lastTime = time;
          Thread.yield(); // let other threads run so the app is not unresponsive
    }But in general, having frames taking different amounts of time is not a very good idea. It will complicate the code too much. Instead have a frame sequence where if one frame has to take longer, you just repeat it. So if your walking animation has 4 frames that need to be displayed for 20 ms each, and your attack frame has one frame that needs to be displayed for 15 ms, a second frame for 30 ms, and a third frame that needs to be displayed for 35 ms - you can time your frames for each 5 ms. and have the following frame sequences:
    walking: {1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4}
    attaking: {1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,3}
    Every 5 ms you update the screen and look into the frame sequence array to decide which frame to draw. Check out the Sprite class' documentation (javax.microedition.lcdui.game.Sprite), as it has a good explanation of this technique.
    (btw, unless the game is very very simple, one frame every 5 ms is not a very realistic figure on real phones)
    shmoove

  • J2ME and MIDP beginner questions

    Can anyone recommend editor/IDE, toolkit etc. for coding, building and testing MIDP2.0 apps/games?
    Until now I've coded a game using J2SE. I used Forte 3.0 for coding and compiling, and IE5.5 for testing.
    Now I want to code mobile games/apps using J2ME and MIDP 2.0. What software do I need? I downloaded Sun ONE studio 4 ME and wireless toolkit 2.0, but are kind of struggeling with it :)
    Regards
    Hallvard

    Ok, I found out that the toolkit compiled the .java files and could bulid the .jar and .jad files, and then test the MIDLet on the emulator.
    But what about a good editor/IDE for MIDLets? In Sun ONE studio ME i finally managed to create a HelloWorld Midlet (with new project wizard), and build and run it in the toolkit.
    I also heard that Borland JBuilder Mobile Edition was a nice IDE for J2ME/MIDLets.
    Hallvard

  • How to use native html render

    Hi people.
    I'm making a project in java (JavaME) to smarphones very similar to a web browser. I want to do an application that can be able to open web pages.
    By doing some search, I "saw" that the html controls that exists, don't work well because don't support javascript.
    I try to found html renders, but with no sucess.
    I found that a way to make this happen is to use platformRequest class (this class invoke any service on the mobile device), and invoke the browser in the mobile device.
    But this way opens the browser, and I want to open the web pages in my application.
    There is any way to open the web browser inside a form created by me?
    Or, its possible to use the native html render? If yes, how can I use this?
    I appreciate any help.
    Thanks.

    ----- BEGIN CANNED RESPONSE -----
    Download and read Sheng Liang's book, ftp://ftp.javasoft.com/books/specs/jni.pdf
    Read the JNI specs on java.sun.com site ( http://java.sun.com/j2se/1.4.2/docs/guide/jni/index.html )
    Beware with the JNI tutorial on the java.sun.com site - it is slightly outdated, and the samples need modifications to compile
    ----- END CANNED RESPONSE -----

Maybe you are looking for

  • Sql tunning in oracle

    Hi all, DB- ORACLE 9.2.0.4 I am facing problem in one query it is taking more than one hour, so i have traced the query and aslo after 15 min i ahve to cancel the query.... select  MRH_MRN,DECODE(MRH_SEX,'M','MALE','FEMALE') AS SEX, trim((mrh_sur_nam

  • Duplicate photos in different folders

    I have duplicat photos in some different folders. How do I tell which folder, from within Aperture  the photo was uploaded from so I can delete duplicates.

  • How to make the size of VI and controls unchanged irrespecti​ve of the resolution​?

    Hi All, I have made the exe of my labview application and when i was trying to run it on the users PC the window was almost distorted in the sense the multicolumn list box on the front panel was alligned only to a portion of the screen instead of the

  • Clock in /Clock out automation and Tracking LCC.

    Hello All Experts, To keep better control over login/licence usage and to track the LCC we are planning to implement badge readers... The isea is to send data to MES throgh batch reader when user is loging in and loging out... the same time should be

  • 'User defined exception error in package OE_SCHEDULE_UTIL' in Sales Order

    Dear Contributors, I am getting the following error while trying to enter line items in the Sales order form. Please provide your valuable suggestion on how to fix this... User defined exception error in package OE_SCHEDULE_UTIL Procedure Insert_Into