beginning with j2me

Posted on 2005-05-06
Last Modified: 2012-06-27
I am trying to build an application for a blackberry.  Can someone explain to me where to begin...I downloaded everything i need like de, cldc, midp....and i got the emulator to run.  I am just not sure how j2me differs from regular java.  I am not sure even what classes i can use.  The main part right now is that I need to read a text file (like maybe from an email being composed) in and then i will need to manipulate that.  Can someone help me out in where i should begin in creating this application?
Question by:melissa555
    LVL 9

    Assisted Solution

    Well my first most important recommendation would be to make sure you know Java well and understand OOP.

    >and i got the emulator to run

    Personally I think that the Wireless Toolkit from Sun is the best emulator for J2ME, so if this isn't the emulator you already have, then check out this link...

    > I am just not sure how j2me differs from regular java

    The biggest difference would be that your obviosly targeting a platform that has far less resources than your regular java application. A standard java app will allow you to use around 50mg of memory.
    Depending on which device your using, you may only be aloud to use a few tens of kilobytes of dynamic memory.

    > I am not sure even what classes i can use.

    First of all, you can't use the standard J2SE classes.
    Although J2ME may have a String class, Random class and other classes very similar to J2SE, they are not always the same as the J2SE implementations.
    To find exactly which classes you can use, check out this link...  This is for MIDP 2.0  This is for MIDP 1.0

    >The main part right now is that I need to read a text file (like maybe from an email being composed) in and then i will need to manipulate that.
    To find out which phone uses which version of MIDP, you'll need to check with the vendor.

    For this, we'll need to know a bit more information. For example, where is the file comming from? A server?
    If this is the case, you can use the class to open a connection the obtain the IO streams.

    Author Comment

    thanks, sorry it took so long to get back to you.
    That all helped lots.
    For the last part, I will be needing to get the text that is being composed in an email.  If a person is using a blackberry and typing an email, I need them to be able to select an item from the menu (which i already figured out how to do) and then the function related to the menu item is going to need all of the stuff that they wrote in the email.  So is there a way to get all of the email text? or can you point me in the right direction? thanks
    LVL 9

    Expert Comment

    I'm not sure if I understand correctly.
    Will the blackberry user be reading or writing the email?

    Author Comment

    the blackberry user will be writing the email. the menu will have a function that will need the text from the email that the user is writing.

    Author Comment

    actually i got that to work. i need to now read in a file, like a notepad document.  i need my application to get the words that are in a saved notepad document. do you know how to do this/
    LVL 9

    Accepted Solution

    I'm not fimilar with the Blackberry file system however if you can manage to get an InputStream from the text file on the operating system, wrap an InputStreamReader around it and use a StringBuffer to append each character.


    InputStreamReader inReader = new InputStreamReader(inputStream);
    StringBuffer buffer = new StringBuffer();
    int c = 0;

    while ((c = != -1)
      buffer.append((char) c);

    Just be careful as to how much data you read because wireless devices usually have very limited memory.

    Author Comment

    thanks, im just going to have to figure out how to specify the file i want
    LVL 9

    Expert Comment


    Your welcome :-)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    New! My Passport Wireless Pro Wi-Fi Mobile Storage

    Portable wireless storage to offload, edit, and stream anywhere.

    High-capacity, wireless mobile storage designed to accompany professional photographers and videographers in the field to easily offload, edit and stream captured photos and high-definition videos.

    Suggested Solutions

    Title # Comments Views Activity
    Data MTU adjustment on Cisco 5760 WLC 3 38
    Access points and IPs 9 45
    Window 2012R2 RADIUS 3 35
    Brother MFC-J6720DW Scan to Email 5 53
    For Sennheiser, comfort, quality and security are high priority areas. This paper addresses the security of Bluetooth technology and the supplementary security that Sennheiser’s Contact Center and Office (CC&O) headsets provide.  
    This paper addresses the security of Sennheiser DECT Contact Center and Office (CC&O) headsets. It describes the DECT security chain comprised of “Pairing”, “Per Call Authentication” and “Encryption”, which are all part of the standard DECT protocol.
    This Micro Tutorial will show you how to maximize your wireless card to its maximum capability. This will be demonstrated using Intel(R) Centrino(R) Wireless-N 2230 wireless card on Windows 8 operating system.
    Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now