Storing infor in a MIDlet

I am developing an MIDlet and I want to record a users mobile phone in it. As far as I know I can't read the users phone number from the SIM card so I use a text field for the users to enter in their phone number. Is there any way I can store the number entered so that the next time they open the MIDlet it is already entered into the text field or is this impossible?
Thanks,
Wallace

Yes. Check the javax.microedition.rms.* package.
shmoove

Similar Messages

  • How to modify the contents of a text file stored along with a midlet

    Hi,
    I have been developing a application in j2me wherein i need to first read the contents of the text file stored along with the midlet and later erase the existing content and update it with some text.
    I was able to read the file in the following manner
    InputStream is = getClass().getResourceAsStream("myfile.txt");
    Now i need to erase the contents and then update it the new content, how do i do it. Kinldy please help me out. It is very urgent.
    Thanks

    Didn't you hear me the first time?
    http://forum.java.sun.com/thread.jspa?threadID=701360&messageID=4068435#4068435

  • I have J2ME application classes and jar at server, but ............

    Hi All,
    My application is such that some J2ME Applications are loaded in a webserver. Upon the request J2ME should show how many applications are available in webserver and what are they.
    Up to this part i am able to do. I can read the .class or .jar file from my webserver. But my doubt is how i can execute that J2ME application at runtime.
    Thanx in Advance.
    Amarnath Revuri

    Hi john wen,
    1)I am using Wireless Tool Kit 1.0.4 on WinNT
    I have downloaded the midp1.0.3 as u suggested and i read the running.html.
    midp -transient <descriptor URL> [<MIDlet name>]
    this above command you have given is used to run the remote MIDlet at command prompt. But my requirements is i have an J2ME MIDlet already running. In that application there is a situation that i need to get remote application(MIDlet/CAnvas/Form/List etc) stored in my existing MIDlet suite and run it without killing my application that is currently running. Can you pls tell me if you have any idea about this.
    2) Can you tell me how i can access/modify/create a text file in my WinNT system where my MIDlet application is running.
    Amarnath Revuri

  • Downloading files through a MIDlet

    Hi there, I am new to the J2ME network connections API, especially for downloading data through a MIDlet. I have a small question I hope you could provide some assistance on.
    I was wondering if there was a way to download data (ie: a text file) from a website or server. I know that there is a class called "FileConnection" that may do this, but I was wondering how to use it to do that. Also, is there a way to do it without the FileConnection API for phones that do not support it? And as for when the data is downloaded, where exactly on the phone is it stored? In the RMS? Is there a way to download the data into the "/res" folder directly?
    Any help would be appreciated,
    thanks,
    take care

    You can do it by a thread, sample run function is given below
    public void run() {
            HttpConnection c = null;
            DataInputStream is = null;
            DataOutputStream os = null;      
            try
                String downloadURL = "yourdownloadurl";
                c = (HttpConnection) Connector.open(downloadURL);   
                c.setRequestMethod(HttpConnection.GET);
                int resCode = c.getResponseCode();   
                is = new DataInputStream(c.openInputStream());
                ByteArrayOutputStream baos = new ByteArrayOutputStream();                       
                os = new DataOutputStream(baos);                     
                int v;
                byte []data = new byte[2048];
                while ((v = is.read(data)) >0 && downloading) 
                    os.write(data,0,v);
                os.flush();
                is.close();
                os.close();
                baos.close();
                c.close();
                System.out.println("The file is "+baos.toString());
            catch (Exception e)
    }Edited by: Shimul on Oct 7, 2007 3:32 AM

  • Updating the MIDlet application for all the PDA at once.

    Good day...
    I would like to develop the MIDlet application for my company and i faced the problem as below:
    There will be more than ten PDA will be used in our system. The PDA will place on the Ethernet cradle and this cradle will link to the web server to exchanged information. The MIDlet application will install on all the PDA in the first initial stage. How about if i want to change some coding or recompile my MIDlet application, how i can distribute all this updated MIDlet application to every PDA on the network in the efficient way. This is because i cannot install each one by one since this is waste time.
    Have anyone can suggest the better idea to me how to solved this problem. Beside that, how i can check on my MIDlet on each PDA is outofdate from the one on the server?? And any opinion on the Ethernet cradle I am using in this case?
    At last, if there is possible to update my MIDlet application from time to time, is it this will affect my data stored on the PDA?
    Please advice and kindly reply.
    Thank in advance...
    SL

    Not sure on the PDA but on the Siemens Sl45i that I have, you can upgrade the midlet by pressing a button -- provided that the MIDlet URL is set to where the device can download the updated suite. I have not tried it yet, though.

  • How to display data in canvas which is fetched from servlet to midlet.

    I am able to display data from database using servlet.
    I am using MySQL as database.
    But i want to display it more nicely using canvas. Right now i just print all the data's , it doent look professional.
    I want to know how to show those data's nicely. How to use canvas? where i can use canvas? Is there any other way to display data/records so that it looks more professional.
    Need help as soon as possible.
    Thanks in advance.

    hey listen i created midlet and servlet. I can see the record which is on my database but as i have just printed using servlet on the mobile screen. Now i want to display those records nore nicely that is . say for example
    i am showing personal profile of a user.
    I am just displaying like ---"Name:" Abc,
    Age: 27 etc
    now i wnat to bold "Name" , "Age" stuff like that.
    I want to use color etc but i dont know how to do that. How can i my records look good?
    I have stored all the record in resultset and have passed it to midlet not i want display it more nicely. How to do that?

  • Problem With Midlet Database Connectivity

    Hi, I am into an application which reures database connectivity.I want to connect to Ms Access as backend with JDBC support.Ive searched a lot but found RMS as the only answer.I will be very thankful if some one can send me a code snippet or some link to an article which shows the trail to my problem.

    You can't have an MS Access database on the phone itself. And even if you can (on an MS SmartPhone maybe?), MIDP has no way to connect to it.
    But if you need to connect to a database that's hosted on a server, then what you have to do is set up a regular web server (using ASP, Servlets, PHP, whatever you fancy), and communicate with this server using the General Connection Framework (that's the javax.microedition.io.* classes). The web server, instead of outputting data in HTML format, can output the data in a format you design and know how to read and parse on your MIDlet (for example, for a simple application a comma separated string will do, for something more complicated maybe you want to use XML, or even develop your own binary format).
    If you want the data to be stored on the client then I'm afraid you're stuck with the RMS.
    shmoove

  • Storing PL/SQL code in a table

    Can PL/SQL procedure be stored in a table and used or executed in a VB application by selecting that column in the VB? Thanks

    Thanks to all for your valuable time.
    I am developing a genric tool in VB, will be storing the straight forward select statement queries in the columns, if i am making use of PL/SQL just need to know is it possible to store the same in columns which can be used in VB.
    The queries and the PL/SQL (procedures) are already exisiting in MS-Access, and they are stored in columns and it works, I am not sure how it works, so just trying to get infor is it possible to do the similar one in Oracle

  • Problem in executing MIDlet on Actual Device

    Below is the program i got from net, this is executing fine in the emulator but when I ported the application to actual device i.e. Nokia 7610, data was not fetched from the given URL, neither i got any exception nor error.
    I have WAP connection enabled on my mobile and also I was able to browse the same URL from the default browser that was there in the mobile.
    J2ME: The Complete Reference
    James Keogh
    Publisher: McGraw-Hill
    ISBN 0072227109
    // jad file (Please verify the jar size first)
    MIDlet-Name: httpconnection
    MIDlet-Version: 1.0
    MIDlet-Vendor: MyCompany
    MIDlet-Jar-URL: httpconnection.jar
    MIDlet-1: httpconnection, , httpconnection
    MicroEdition-Configuration: CLDC-1.0
    MicroEdition-Profile: MIDP-1.0
    MIDlet-JAR-SIZE: 100
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    import javax.microedition.io.*;
    import java.io.*;
    public class httpconnection extends MIDlet implements CommandListener {
    private Command exit, start;
    private Display display;
    private Form form;
    public httpconnection ()
    display = Display.getDisplay(this);
    exit = new Command("Exit", Command.EXIT, 1);
    start = new Command("Start", Command.OK, 1);
    form = new Form("Http Con");
    form.addCommand(exit);
    form.addCommand(start);
    form.setCommandListener(this);
    public void startApp()
    display.setCurrent(form);
    public void pauseApp()
    public void destroyApp(boolean unconditional)
    public void commandAction(Command command, Displayable displayable)
    if (command == exit)
    form=null;
    display.setCurrent(null);
    display=null;
    destroyApp(false);
    else if (command == start)
    HttpConnection connection = null;
    InputStream inputstream = null;
    try
    connection = (HttpConnection) Connector.open("http://www.someURL.com");
    //HTTP Request
    connection.setRequestMethod(HttpConnection.GET);
    connection.setRequestProperty("Content-Type","//text plain");
    connection.setRequestProperty("Connection", "close");
    // HTTP Response
    System.out.println("Status Line Code: " + connection.getResponseCode());
    System.out.println("Status Line Message: " + connection.getResponseMessage());
    if (connection.getResponseCode() == HttpConnection.HTTP_OK)
    System.out.println(
    connection.getHeaderField(0)+ " " + connection.getHeaderFieldKey(0));
    System.out.println(
    "Header Field Date: " + connection.getHeaderField("date"));
    String str;
    inputstream = connection.openInputStream();
    int length = (int) connection.getLength();
    if (length != -1)
    byte incomingData[] = new byte[length];
    inputstream.read(incomingData);
    str = new String(incomingData);
    else
    ByteArrayOutputStream bytestream =
    new ByteArrayOutputStream();
    int ch;
    while ((ch = inputstream.read()) != -1)
    bytestream.write(ch);
    str = new String(bytestream.toByteArray());
    bytestream.close();
    form.append(str);
    System.out.println(str);
    connection.close();
    catch(IOException error)
    System.out.println("Caught IOException: " + error.toString());
    finally
    if (inputstream!= null)
    try
    inputstream.close();
    catch( Exception error)
    /*log error*/ }
    if (connection != null)
    try
    connection.close();
    catch( Exception error)
    /*log error*/
    Please help me out what are the things I have to do to run this MIDlet on my Nokia 7610.
    Thanks in advance.

    You ever find an answer? I have an LG VX5200 phone which is supposed to support Java. But aside from downloading Java apps from other sites I'm trying to figure out which folder on the phone's filesystem you place the file. With BitPIM and QPST you can view the phone's filesystem. But as yet to find either a folder that works or combination of settings to get it to show up on the phone list of apps.
    I had hoped that maybe someone had downloaded a game from a site and then looked at the phone to see where and how it's stored. I can't from where I'm at.
    Michael

  • My MIDlet cant accept SVG image Created with Inkscape and Adope Illustrator

    Hi I am a kenyan Mobile application developer, I have made acouple of Midlets that call SVG images that I developed ysing inkscape 0.45 and finished in Adope illustrator. What can be the matter? or what SVG creator should I use? Pliz help.
    Thanx

    if your target device(s) support [JSR 226 J2ME SVG|http://www.jcp.org/en/jsr/detail?id=226|specification here] API, then it should be capable to +"...load and render external 2D vector images, stored in the *W3C SVG Tiny* format..."+

  • How to open phone's Inbox inside a MIDlet?

    Dear all,
    I'm doing a project to let users(clients) selecting some files for download in their mobile phone and once their selection is received, the file will be pushed from the laptop (acts as the server) to the mobile phone via Bluetooth, and it will be stored in the phone's Mesage Box. And the user can open the files received in the Message Box.
    Now my application works but has one disadvantage, i.e. the user should close his Java MIDlet application in his phone so as to access the Message Box, and it's very inconvenient since each time he should close the MIDlet, view the file in Message Box, and then re-launch the MIDlet, do the service discovery in Bluetooth again and then request another files to be received...
    So are there any means for me to link to the Message Box in the Java MIDlet? In my case I'm using Nokia 6600 for testing, but I can't figure out how to link to it. Or should I use pauseApp() to handle it? Can anyone suggest some way to solve it?
    Thanks so much!
    gary

    I figured it out myself. I added an s:Hgroup around my label and set width="100%" and horizontalAlign="right" you need to set the width to 100% otherwise you're just right aligning within the actual width of the component (which is pretty useless eh?).
    I hope this helps someone else too.
    Regards,
    Mark.

  • HT203167 Had to replace my hard drive. Now I can't get into i-tunes to enjoy my list (about 98 songs). Is my music stored in my old hsrd drive? Sorry guys I'm not real good with this comp. stuff. Just want my music back

    Had to replace my hard drive. Now I can't get into i-tunes to enjoy or purchase new music.Are my i-tunes stored in my old hard drive ? Do I have to take my old hard drive to a computer store and have them placed on something called a flash drive ? I'm having the same trouble retrieving my Ancestry.com infor.

    Yes, all you iTunes data are on the old drive. Get an external enclosure in which you may install the old drive in order to connect it to your computer and copy your iTunes data to your new drive.
    Everything is on your old drive unless you copied it to the new drive.

  • Running midlet on actual device

    I am just beginning to learn Java WTK. Can anyone give me steps by steps instruction on how to port a midlet (a simple 'Hello World' midlet) fully workable on the emulator onto the actual device? I am using a LG G7100 although I am also interested in Nokia.

    You ever find an answer? I have an LG VX5200 phone which is supposed to support Java. But aside from downloading Java apps from other sites I'm trying to figure out which folder on the phone's filesystem you place the file. With BitPIM and QPST you can view the phone's filesystem. But as yet to find either a folder that works or combination of settings to get it to show up on the phone list of apps.
    I had hoped that maybe someone had downloaded a game from a site and then looked at the phone to see where and how it's stored. I can't from where I'm at.
    Michael

  • Download MIDlet to a phone

    Hi all,
    I developed my J2ME application that will connect to a remote server using GPRS on the J2ME Wireless Toolkit.
    Can someone please give me some tips on how download the MIDlet onto a phone. Do I need to download both .JAD & .JAR files?
    How do I create the .JAR file using the toolkit?
    Its an MIDP1.0 application, which type of phone do people recommend I use?
    Any tips would be much appriciated!
    Thanks
    Glenman

    To make a jar file with the wireless tool kit
    Click on project and then click on package/create package. never forget that size is crucial so you should use an obfuscutator with it. If your jar file is above 64 KB , then use an obfuscator (retroguard, proguard, etc.).
    Normaly both Yourapplication.jar and Yourapplication.jad will be stored into
    the_path_to_wireless_tookit/apps/your_project/bin/
    You need both jar and jad file to be OTA compatible.
    the JAD file contains several meta-data (including an URL pointing to the JAR file: MIDLET-URL or something)
    To install your application on a mobile phone you need two things:
    - A java/wap enabled mobile phone
    - and a configured web server.
    for the web server your need to add two new MIME types:
    for JAD and JAR.
    You should find this information over the web, I don't have it here.
    Once you have proplerly configured your web server (if you didn't the jad file will be downloaded like a text file and nothing will happen). Simply use your wap browser and type the URL of the JAD file:
    http://www.myserver.com/applications/MyApplication.jad
    Your mobile phone should download and install your application.
    It always better to test first your application with the constructor SDK. There are some problems that could occur during the "make package" process. (mainly related to the JAR properpties, NOKIA for example is more touchy about this than sonyericsson phones). Don't expect a lot of feeback from your mobile phone,for any errors you will receive "INVALID file". SDK will give you more valuable logs.
    Hope this help
    Olivier

  • ClassNotFoundException problem executing midlet

    Hello,
    I use Forte For Java and J2ME (midp,cldc).
    I have those files in my package c:/ProjetJ2ME/src/HelloMIDlet :
    HelloMIDlet.java
    HelloMIDlet.class
    HelloMIDlet.jar
    HelloMIDlet.jad
    // I declare the package in my java file : package HelloMIDlet
    When I execute HelloMIDlet.jad (under Forte), the Gray phone appears and we can read the file name (HelloMIDlet) on the screen (Emulating).
    But when I launch the program, a ClassNotFoundException appears :
    Unable to create MIDlet HelloMIDlet.HelloMIDlet
    java.lang.ClassNotFoundException: HelloMIDlet.HelloMIDlet
    at com.sun.midp.midlet.Selector.commandAction(+47)
    at javax.microedition.lcdui.Display$DisplayAccessor.commandAction(+152)
    at com.sun.kvem.midp.lcdui.EmulEventHandler$EventLoop.run(+427)
    I think it comes from my pathes :
    //autoexec.bat
    PATH=C:\jdk1.3.1_02\bin;C:\jdk1.3.1_02\lib;
    PATH=%PATH%;c:\j2me\midp1.0.3fcs\bin;c:\j2me\j2me_cldc\bin;
    SET CLASSPATH=.;C:\j2me\midp1.0.3fcs\classes;
    I tried to precise my jar file in the classpath :
    SET CLASSPATH=.;C:\j2me\midp1.0.3fcs\classes;
    SET CLASSPATH=%CLASSPATH%;C:\ProjetJ2ME\src\HelloMIDlet\HelloMIDlet.jar
    But I always have my error !
    Can it be a package problem, a classpath problem ... ?????
    Thank you
    (Excuse my english)

    Actually, the problem is that way the .JAR is organized.
    If you drop the package statement, everything will work.
    If you insist on having the package specified, you need to have your files stored under the "HelloMIDlet" directory within the .JAR.
    Jouster

Maybe you are looking for

  • Firefox 3.6.8 causes problem in Microsoft Outlook

    I updated Firefox to version 3.6.8 a few days ago. Since then, when I start Microsoft Outlook (version 10), it aks if I want to open or save an html page file (a different one each time; these pages are always empty when I save or open one), prior th

  • Color problems when dvd is burned

    it sounds strange but after my movie is exported from final cut using compressor it's god and it's good also when it's imported in DVD studio preview is ok but when i finally burn the dvd i can't undesrstand why but it changes colors risulting in a m

  • Slow upload/Removing Interleaving

    Hi, I have just (15-12-10) gone back to employee BB and am assuming that the 10 day stabilisation period will have expired by now. I was with O2 BB for ages as BT did not have ADSL2+ enabled at my local exchange (Chandlers Ford) and got consistent 9+

  • When i connect  my ipad2 to sync, error message says ipad itunes version needs updated

    when I connect my ipad 2 to my mac to sync an error message says my ipad doesn't have the latest version of itunes.  When i try to update my ipad, i can't....help

  • HOW TO TURN OFF NAP TO ELIMINATE WHITE NOISE?

    RE: HOW TO TURN OFF NAP TO ELIMINATE WHITE NOISE Ive discovered that when ever I attempt to record audio in Logic pro 8 I get a constant white noise in the back ground. I've seen proevious posts regarding this and have downloaded the xcode developer