Java and J2ME Tips and Tricks

Java and J2ME Tips and Tricks

I found a tutorial website for Java and J2ME. Here is the site:
If you have any coding tips and tricks, please share them here.


26 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Quoting - southsidesmoka
Can anybody whose travelled down this under-development road before me kindly share whether or notone needs to target MID-spec Java apps at a Java ME CLDC/MIDP profile or simply import the Intel SDK classes like the SDK Samples do? Thank you for any advice.


I am going to answer my own question; in the event it is asked again by another individual searching for knowledge, the knowledge will be there. The Intel Mobile SDK 1.3 supports Java ME, SE and EE runtime environments. I find a best practice is to target the JVM installed on the device(s) for which you are developing, i.e. most smart-phones implement Java ME, so you would target your application at an appropriate Java ME Profile and import the Intel Mobile SDK classes. A Mobile Internet Device, on the other hand, is typically going to have a full Java implementation via Java SE or possibly even Java EE, so one would not need to target the application at any Profile (Profiles are only available in Java ME, anyway). So, a developer need only import the required Intel Mobile SDK classes in the case of developing applications for devices with a Standard or Enterprise Java Virtual Machine installed. I hope others find this useful.


Quoting - kremsoft

I'm a java developer for a large software outsourcing firm. We have been getting more and more requests for mobile apps using J2ME. I have played around a little before and it doesn't seem so different, just a smaller API.

Can anyone recommend some good books or courses to make the jump?



i like "Core J2ME Technology", wishing it could help u 8 )

do right thing right

Quoting - poce
I recently downloaded the Intel Mobile Platform SDK for Linux.
I'm trying to access an RFID reader from a java application.
The reader is a skyetek M9 (Development Kit).
My problem is that I cannot find the class RfidReaderClass from the library.
I'm using Netbeans and I configured the project to access all the libraries available through the Intel Mobile Platform SDK.
If I want to access the BatteryClass, for example, the IDE suggests the import of the, but for the RfidReaderClass I cannot find any library.
Am I missing somethiing?
It's like the class for Rfid readers is missing...
Any help is much appreciated.



Try importing the package and creating a class, like below.


public class RfidReaderClass extends ClassObject

Hope this helps.


Hi kremsoft,

If i can advise i will strongly advise you to also branch into other programming languages. I don't know how vast you are in Java, but i know that maybe another prog lang ( like C/C++) might solve the problem.


Why not try www.sun.comi have some JME downloads there.

For questions on Java, I recommend the following site:



To reduce the amount of data, it could be compressed on the server and uncompressed using gZip library at the mobile device.

Is it possible to filter the incoming messages coming from a particular number and save it into a different folder other than inbox through J2ME?

and also is it possible to filter the incoming calls too in J2ME?

Although not recommended to use repeatedly, sometimes it is quite useful to force a garbage collection in situations such as your game is going to the next level where you use all new graphics and old objects are deleted.



In general, producing a vibration in J2ME requires the usage of


But for Nokia phones you can use the package

and use the function DeviceControl.startVibra(freq, duration);

Note that the duration is specified in milliseconds and frequency in hertz.

Anyone who is a bit interested in electronics and hobby circuit assembling would have came across the readily available Bluetooth miniature modules which could be interfaced to a PIC microcontroller circuit and create devices that could communicate with any other Bluetooth enabled devices. This could be interfaced to our Mobile Phone applications in any platform that supports Bluetooth interfacing and create a wide variety of applications like Bluetooth controlled toy car (this project details are already available freely). You can find a lot more of applications for this mobile circuit combination, both useful and amazing.

I think I read elsewhere that you could make a call to platformRequest in your MIDlet and pass the URI with the rtsp scheme.

Of course, the URI endpoint will probably need to end in rm...

Something like: platformRequest("rtsp://someserverfile.rm")

hyperlink to the following ll be very helpfull

Good luck

Can anybody whose travelled down this under-development road before me kindly share whether or notone needs to target MID-spec Java apps at a Java ME CLDC/MIDP profile or simply import the Intel SDK classes like the SDK Samples do? Thank you for any advice.


I agree...Garbage Collection can be quite useful. It's a great way to reduce your apps memory footprint and use less power (using less memory uses less power) - an awesome dirty trick for power optimization. Timing is critical because you use that energy running the Garbage Collection cycle. Tools and testing are an absolute MUST for this method! But, it DOES work.


Thanks to all who posts URLs of tutorials. Its really interesting to share the knowledge.

Even though J2ME development is still Java, there are a number of
differences between doing mobile development and doing J2SE or J2EE

Thank you for the link mentioned above.. it was really helpful to me..

Java is a object oriented programming laguage and Java is more secure from other programming language. you want to get more knowledge about java than click on


Really very nice and great concept on your website really too much information about vibration in j2mee

GReat tutorilas..... I found these tutorials very useful. Thanks... if you have more then please share with us. :)

Hi all

thanks for the share, i have searching all the forum for it and now i found it. thanks !

I would like to recommend you a few great books to start learning Java programming.
Not in particular order.
1.Bruce Eckel "Thinking in Java"
2.Cay R. Horstmann Gary Cornell "Core Java"

For more comprehensive list please follow this link:


Despite of developping mobile application with the J2ME platform is "deprecated", it is considered as one of the appropriate platformes specially for the limited devices (such as PDA, VCR player....).

You can start by understanding the hierarchy of a J2ME application:

Every J2ME application contains a midlet class, which is our execution point:

- It contains 3 methods :

1- public void startApp() : Executed when the application loads.

2- public void pauseApp() : Executed when the application is in pause (when we receive a call for example)

3- public void destroyApp(boolean unconditional) : Reserved, generally, to disconnect from the ressources (exp: DataBase)

Good luck!

JAVA is an object-oriented encoding language. It can be applied in several computing programs, you can see it almost everywhere today, from embedded devices and mobile phones to enterprise servers and supercomputers. Thanks for sharing such valuable information with tutorials which can be helpful those who wants to develop website in JAVA.

Ok, every comment is interesting. But why nobody mentions Oracle's support? Isn't it a prefered place to go, especially if you are a partner of Oracle?

Leave a Comment

Please sign in to add a comment. Not a member? Join today