Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


beginning with j2me

Posted on 2005-05-06
Medium Priority
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
  • 4
  • 4

Assisted Solution

OBCT earned 300 total points
ID: 13951376
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...

http://jcp.org/aboutJava/communityprocess/final/jsr118/index.html  This is for MIDP 2.0
http://jcp.org/aboutJava/communityprocess/final/jsr037/index.html  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 javax.microedition.io.Connector class to open a connection the obtain the IO streams.

Author Comment

ID: 13999359
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

Expert Comment

ID: 14000061
I'm not sure if I understand correctly.
Will the blackberry user be reading or writing the email?
Evaluating UTMs? Here's what you need to know!

Evaluating a UTM appliance and vendor can prove to be an overwhelming exercise.  How can you make sure that you're getting the security that your organization needs without breaking the bank? Check out our UTM Buyer's Guide for more information on what you should be looking for!


Author Comment

ID: 14009805
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

ID: 14021290
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/

Accepted Solution

OBCT earned 300 total points
ID: 14022609
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 = inReader.read()) != -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

ID: 14038399
thanks, im just going to have to figure out how to specify the file i want

Expert Comment

ID: 14038416

Your welcome :-)

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Coaxial cable bending There are several factors that govern the selection of coaxial cable for your Machine to Machine (M2M) application: the location of cable runs, either indoor or outdoor, inside or outside an enclosure, maximum bending and the…
Need WiFi? Often, there are perfectly good networks that don't have WiFi capability - and there's a need to add it.  - Perhaps you have an Ethernet port into a network but no WiFi nearby. - Perhaps you have a powerline extender and no WiFi at the…
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…

564 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