Home J2me J2ME Tutorial
Questions:Ask|Latest

 
 

Share on Google+Share on Google+

J2ME Tutorial

Advertisement
Java ME was designed by Sun Microsystems and is a replacement for a similar technology

J2ME Tutorial

     

J2ME kxml

  1. Java Platform Micro Edition
    Java ME was designed by Sun Microsystems and is a replacement for a similar technology, Personal Java. Originally developed under the Java Community Process as JSR 68, the different flavors of Java ME have evolved in separate JSRs.
     

  2. MIDlet Lifecycle
    By default MIDlet is in the paused states. when the application is executed by default startApp() method will call and when close the application the destroyApp() method will be called.
     

  3. Source code of 'jad' and 'properties' file
    Java Application Descriptor
    (JAD) filename extension is .jad and media type is text/vnd.sun.j2me.app-descriptor, which developed by the Sun Microsystems, Inc.
     

  4. J2ME Hello World Example
    This is the simple hello world application. In this example we are creating a form name "Hello World" and creating a string message "Hello World!!!!!!!".
      

  5. Creating MIDlet Application For Login in J2ME
    This example show to create the MIDlet application for user login . All MIDlet applications for the MIDP ( Mobile Information Device Profile) derived from  MIDlet class and it play a role as a mediator between the application and the environment in which the application runs.
     
      

  6. Text Field MIDlet Example
    This example illustrates how to insert text field in your form. We are using here two TextField (name and company). We are taking both TextField variable in to the constructor (TextFieldExample) of the class.
     
     

  7. J2ME Contact List
    This example illustrates how to create your phone book. In this example we are taking three SCREEN button ("Next", "New", "Exit") and taking two TextBox ("name", "number").
      
     

  8. Date Field MIDlet Example
    This example illustrates how to insert date field in your form. We are using here two fields DateField (datein and dateout) and initialize a final static variable DATE which is 0.
     

  9. J2ME Button MIDlet
    This example illustrates how to create command button in your form. Command class build to bind only the semantic information of the command it means  command is not the actual action its contains only information about command.
     

  10. J2ME CheckBox ChoiceGroup MIDlet
    This example illustrates how to create check boxes in to your form. In this example we are creating a Form("Technologies") that is having four different choices, ChoiceGroup("JAVA", "J2ME", "J2EE", "JSF"). 
      

  11. A MIDlet Example to execute Alert Message with an Image
    In this "Alert Message" example, you will learn how to send an alert message to user whenever an action is called. The example have two different options 1. "ok" and option 2. "Cancel".
      

  12. J2ME Alert Example
    This example illustrates how to create  alert through sound. In this example we are using AlertType class for the different alert. 
      

  13. Radio Button in J2ME
    In this tutorial you will see the MIDlet Example that is going to demonstrate, how to create the radio button in J2ME using MIDlet. The radio button is use to choose only one option at a time.
      

  14. J2ME List Image
    This example illustrates how to create list with image symbol. In this example we are trying to create list using of List class.
      

  15. List in J2ME
    This example illustrates how to create a Exclusive List. The Exclusive List is used to select only one list element at a time.
      

  16. J2ME Canvas Example
    This example illustrates how to create a game using GameCanvas class. In this example we are extending GameCanvas class to draw the circle and rotate the circle continuously.
      

  17. Creating Canvas Form Example
    This example shows that how to use the Canvas Class in a Form. In this example we take two field in which integer number passed from the form and result will display on a Canvas circle.
      

  18. Creating Menu Using Canvas Class
    This example shows how to create the menu and call the canvas class to show the toggle message.
      

  19. Creating Multiple Type List
    This example is shows how to create the list which has multiple type choice option.
       

  20. J2ME Ticker Example
    This is the simple Ticker example which is used to auto scroll the data on the top of the form. It continuously scroll the data.
     

  21. J2ME Thread Processing Example
    In the given example, you will learn about the thread and how thread works in J2ME application. An application can run multiple activities simultaneously using thread. Here we have defined different states of thread...
      

  22. Draw Line in J2ME
    In this example we are going to show you how to draw a line using J2ME. Please go through the below given J2ME syntax that includes all the package, methods and class to draw a line. 
      

  23. Draw Rectangle in J2ME
    In this series of J2ME examples and tutorials, we have introduced you with it's various features with examples. Now in the given example, you will learn about creating rectangles in J2ME.
      

  24. Draw Font Using Canvas Example
    This example is used to draw the different types of font using Canvas class. The following line of code is used to show the different style, size and faces of font.
     

  25. Draw String Using Canvas
    This example is used to draw string on different location which is shown in figure. The given code is used to show, how to draw string at different locations.
      

  26. Interactive, Non-Interactive Gauge Example
    This example shows, how to create the Gauge class to draw the interactive and non-interactive gauge which is used to display the volume label.
     

  27. Creating Volume Bar Using Gauge Class
    This example is all about creating a volume bar using Gauge class. We are creating the object of Gauge class that contains the following parameters label, interactive, maxValue and initialValue and it has been set with the form.
     

  28. Image Item Using Canvas Example
    This example is will show you how to create the image at the top center of the screen.
      

  29. Image Icon Using Canvas Example
    This Example is going to draw a clip with SOLID line. In this picture only solid line show the clipping area.
     

  30. Draw Clip Area Using Canvas
    This Example is going to draw a clip with SOLID line. In this picture only solid line show the clipping area.
      

  31. Player Class in J2ME
    In J2ME, player class is used to play the .wav music, that is the only reason of using the class in our small application to create multimedia sounds.
      

  32. Draw arc in J2ME
    The given example is going to draw an arc using canvas class of J2ME. You can also set a color for it, as we did in our example.
      

  33. Building a J2ME sliding menu with text and images(part-1)
    This example will show, how to create an image icon to perform the next action or next image from the list every time it's been clicked. So if you want to go from one icon to another icon by the nice sliding effect, you have to run the given example.
      

  34. Building a J2ME sliding menu with text and images(part-2)
    In the given J2ME Menus example, we have explained to create two different buttons that is going to perform as a back and forward buttons.
      

  35. Video Player MIDlet Example
    This example is all about how to play the MPEG files on your mobile device. To play the video file we have to import the javax.microedition.media.control package and certain sub-package that are required for the application. 
     

  36. User Define Alert Example
    Creating a user defined alert message, In the given example we have created a image that can be fill with some colors and text. The following source code shows how to create the image, how to set the color and how to draw string.
      

  37. Ring Tones MIDlet Example
    In this example only two Ring Tones are created using Player class.
     

  38. Pointer Example
    This type of example is basically used in touch screen technology, here we are trying to create a pointer which location is based on the screen touch pointer.
      

  39. Media MIDlet Example
    Creating more then one player in a MIDlet, Here we have created an 'item' object for Hashtable and put all 'wav' file in this table with object 'key' and object 'value' which maps the keys to value. 
     

  40. Get Help MIDlet Example
    This example illustrates how to take help from any other text file which is stored in res folder in your MIDlet. In this example we are creating a form which name is "New Form".
      

  41. Different Size of Font MIDlet Example
    This example simply shows the different size of font.
      

  42. Audio MIDlet Example
    This example illustrates how to play audio songs in your mobile application by creating a MIDlet. In the application we have created a player for an audio song by using of javax.microedition.media API.
      

  43. Access URL
    This example is used to access the data from the specific url. The Stream Connection is used to connect the application to the specific url by Airtime (connect to the internet).
      

  44. Text MIDlet Example
    With the help of text MIDlet example, we are going to show text using canvas class at different locations on the screen.
      

  45. Arc MIDlet Example
    In the previous draw arc example, we have explained how to draw an arch on the screen. But in this example we are going to show how to draw arc at different locations.
     

  46. Simple Line Canvas Example
    This is a simple example of drawing lines using canvas class in J2ME. In this example we are creating three different lines at different locations and form.
     

  47. Graphics MIDlet Example
    This is the another graphic example, where we are going to draw a image that look and act like satellite and earth. For creating these types of graphics in J2ME we use MIDlet's.
     

  48. Rectangle Canvas MIDlet Example
    The example illustrates how to draw the different types of rectangle in J2ME. We have created CanvasRectangle class in this example that extends to the Canvas class to draw the given types of rectangle.
      

  49. J2ME Draw String
    In the previous examples, we learned about drawing different graphics on the screen. Here in this example, we are going to show the string in J2ME.
      

  50. Line Canvas MIDlet Example
    In this example, we are going to draw to different lines which cross to each other on the center of the mobile window using Canvas class. "CanvasCrossLine" class created by us extends the Canvas class to draw both the lines.
     

  51. Align Text MIDlet Example
    With the help of the canvas class, we can draw as many as graphics we want in our application. Similarly we can also set the different alignment to the text.
      

  52. Text Example in J2ME
    In J2ME programming language canvas class is used to paint and draw the diagrams. Using the same canvas class we are going to draw a box around the text in our show text MIDlet Example.
     

  53. J2ME Canvas KeyPressed
    This tutorial is going to show you how to handle keypressed event in J2ME using canvas class. After going through the given example, you will be able to show different output against different keypressed actions.
      

  54. Co-ordinates MIDlet Example
    In this example the CoordinatesCanvas class extends the Canvas class  to draw the image and fill color as given below in the figure. 
     

  55. J2ME Record Store MIDlet Example
    This is a simple program to record data and print it on the console.
     

  56. J2ME Animation using repaint( ) method
    In this part of J2ME Image Tutorial, we are going to show you how to create an Image with animation. Here we have create a class called ImageAanimation that extends MIDlet and implements the CommandListner class.
      

  57. Immutable Image MIDlet Example
    This is the immutable image example, which shows how to create a immutable image in MIDlet. In this example we are creating a image without using of canvas.
     

  58. Immutable Image using Canvas Class
    This is the immutable image example which shows how to create the immutable image using canvas. In this example ImageCanvas class extends the Canvas class to create the immutable image.
      

  59. Mutable Image
    This is the Mutable image example which shows how to create the mutable image using canvas class.
     

  60. J2ME Draw Triangle, Rectangle, Arc, Line Round Rectangle Example
    In this serious of J2ME tutorial, we are going to describe how to draw a triangle, rectangle, arc, line or a round rectangle in one small application. Although we have already explained you all these examples separately but in this section we are going to merge them in one.
      

  61. List in J2ME
    J2ME Canvas List Example will explain you, how to create list of items. In this example we are going to create a simple list of text, that will show the selected item on the same screen.
     

  62. J2ME Calendar Application
    Creating a calendar is a very basic example to learn any programming language. At our website (roseindia.net), you can find many examples on creating calendar in Java, JavaScript etc.
      

  63. J2ME Canvas Repaint
    In J2ME repaint is the method of the canvas class, and is used to repaint the entire canvas class. To define the repaint method in you midlet follow the given syntax.
     

  64. J2ME Crlf Example
    The given J2ME Midlet, discuss about how to show the messages in different line and row. In this example we have created an object called clrf that is further used to break line and row to show the message in correct readable format.
     

  65. J2ME Command Class
    In the given J2ME Command Class example, we have set the various commands namely, screen, back, cancel, ok, help, stop, exit and item to the Midlet.
     

  66. J2ME Record Store Example
    In this Midlet, we are going to read string data and write by using the RecordStore class. The package of the RecordStore class is the javax.microedition.rms.
     

  67. J2ME Form Class
    In this J2ME Extends Form example, we are going to discuss about form, extending form in our class and appending values to it.
      

  68. J2ME Current Date And Time
    This is a simple J2ME form example, that is going to show the current date and time on the screen. Like core Java J2ME too use the same  java.util package to show the current date as well as current time on the screen.
      

  69. J2ME Display Size Example
    In the given J2ME Midlet example, we are going to display the size of the screen. Like a below given image 1, the midlet will print few items on the screen and the screen size will be displayed at the command prompt (image 2).
     

  70. J2ME Enumeration Example
    Enumeration is an Interface that comes with the java.util package that can be implement by an object. After going through the example you will be able to run a video file using interface enumeration in J2ME.
      

  71. Appending string in J2ME Form
    In the previous example, you learned about how to add items in to the form. In this example we are going to add string into the form. Both examples are almost same but the only difference is that this time we are using append string instead of append item.
     

  72. J2ME Draw Triangle
    As you already aware of the canvas class and it's use in J2ME application, we are using canvas class to draw the triangle on the screen. In this example you will learn how to draw a triangle and filling it with particular color
      

  73. J2ME Convert Date To String
    As in the previous example, you have learned about how to print the current date on the screen. But in this example we are going to convert the date into string.
     

  74. Appending Image into the J2ME Form
    After adding item and string, now we are going to add image into the J2ME Form.
     

  75. Custom Item in J2ME
    In J2ME applications, Custom Items can be created by programmers and they can also set their look and feel as these custom item have their own method called paint().
      

  76. J2ME Timer MIDlet Example
    This Example shows how to use of timer class. In this example we are using the Timer class to create the time of execution  of application and the TimerTask class is used to create the counter of timer which is executed after 5000 ms
      

  77. J2ME RMS Sorting Example
    This example simply shows how to use of RMS package. In this example we are going to sort the specified string by the implementing of RecordComparator interface
     

  78. J2ME Read File
    In this J2ME application, we are going to read the specified file.
      

  79. J2ME Random Number
    In this application we are going to generate the random number using Random class. The Random class within the java.util package and we can use it by importing the java.util.Random package. 
      

  80. J2ME Label Example
    This is the simple create label example in which we create an StringItem to display the "UserId" as a label text. In the given application we are using setLabel to set the new label to the ItemString.
      

  81. J2ME KeyEvent Example
    This application illustrates to find the key code of each key with its value.
      

  82. J2ME Key Codes Example
    This application illustrates how to print the key value with the current key pressed on the canvas.
     

  83. J2ME Item State Listener Example
    In this application we are going to shows how to implement the ItemStateListener interface in the j2me midlet.
     

  84. J2ME Image Example
    In this application we are going to simply create an image using canvas class. In this class we are creating the image and a thread to run the image.
      

  85. J2ME Image Item Example
    This application illustrates how to create the image and imageItem using Image and ImageItem class respectively. In this example we are going to create an image using Image Class and imageItem using ImageItem class.
     

  86. J2ME Icon MIDlet Example
    In this example we are going to create icon list of different sizes. We are creating here a IconList class, in this class we inherited the property of List class.
     

  87. J2ME HashTable Example
    To use the HashTable, java.util.Hashtable package must be imported into the application. Generally HashTable are used to map the keys to values and these keys or values could be any null object. 
      

  88. J2ME Event Handling Example
    In J2ME programming language, Event Handling are used to handle certain type of events that are generated at the time of loading MIDlet on the mobile screen.
     

  89. J2ME Video Control Example
    This Application explain the use of Video Control. The work of video control is used to controls the display of video.
      

  90. J2ME Vector Example
    This application illustrates how we can use Vector class. In this example we are using  the vector class in the canvas form.
     

  91. J2ME Timer Animation
    This application illustrates how to use the Timer class and implement it in the canvas class. In this Tutorial we have given you a good example, which helps you to understand using of timer class for drawing the canvas.
      

  92. J2ME Text Box Example
    This application illustrates how to create the text box using TextBox class. The TextBox class is a Screen that allows the user to enter and edit text.
      

  93. J2ME Record Listener
    This application illustrates to implement the RecordListener interface with the RecordStore class for receiving Record Changed, Added, Deleted events from a record store.
     

  94. J2ME Audio Record
    This example is used to record the audio sound  and play the recorded sound.
     

  95. J2ME Record Data Base
    This Application is used to explain how to store data in the database. In this example we are going to import the javax.microedition.rms package to access the RecordStore class.
      

  96. J2ME RMS Read Write
    This Application specially tries to explain how to read and write the data using RecordStore class.
     

  97. J2ME Frame Animation 
    This application shows to set the Frame Animation and implement it in the canvas class. In this example we are creating a frame using Gauge class.
     

  98. J2ME Frame Animation2
    This example illustrates same as in the previous example, but here we are creating four blocks and set five frame manually. The whole example shows you to create the frame and blocks.
      

  99. J2ME Cookies Example
    This Application is used to find the cookies value of the servlet. In this example we are creating a MIDlet (CookieMIDlet) for access the servlet.
     

  100. J2ME Servlet Example
    This is the simple servlet tutorial. In this tutorial we shows you, how to create the servlet and implement it with the midlet.

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: December 18, 2008

Related Tutorials

Ask Questions?    Discuss: J2ME Tutorial   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
ka.Motlagh
April 8, 2011
Receive SMS , Save and Peoccess it by J2ME

hi please, send a example than it can Receive SMS , Save and process it by J2ME. tanx
Martin
April 10, 2011
Contact details

Code for displaying saved contacts AND SAVE CONTACTS
JOSBON
May 31, 2011
Need to learn J2ME

i TS MY FIRST TIME TO LEARN J2ME AND AM VERY MUCH INTERESTED TO START DEVELOPING WHAT CAN I DO,AM NEW HERE
partha
June 17, 2011
j2me

can any one say me how to write code of an alert (that is displaying a text msg) in net beans6.5 & where (actual position)u should write it ...???
Vishal Dave
June 19, 2011
Thank-you ROSEINDIA

Hey Thank-you for providing these many helpful tutorials for learning the basics in J2ME.... I appreciate ur work.... Thank-you once again....
Leke Ekundayo
June 20, 2011
J2ME

How do I read a portion of a .txt file in the res folder into a string item or a form Thanks
kalpaketan panda
June 23, 2011
j2me

it is a good process of sunmicrowsystem to obten our problems to easily solveable, i am very much satisfy to find this tutorial . thanks
Robert
July 11, 2011
Cool J2ME Midlets!

I like the examples! They are cool. I compiled them in my IDE.
atul
August 18, 2011
android

where to learn android
Jerry
June 15, 2013
loNZcRjxWikznl

You got to push it-this essneital info that is!
Noki
October 12, 2011
Thanks

I Like This
priya
October 28, 2011
feed

your site is very very hard for understanding ..
Nirzari Bhayani
November 4, 2011
J2ME

Very much helpful website. Thnx
Kanmani Karthikeyan.S
November 29, 2011
Thank you

Thanks for your services ... Please provide options for download the entire content for Offline users(developers).. Again i thank for your services.... Continue that ...
jagadeesh
March 1, 2013
i want lernt it now

i want to learn it now.
shelu
December 9, 2011
Best

Very useful
Srijita Neogy
December 27, 2011
How to write into a file using j2me

please leave a comment
ali
January 15, 2012
java 2me

programing
Rahul Kumar
January 23, 2012
j2me

how to make the text Field on the canvas class and also show the small-2 image on the canvas together like as Touch Screen phone keyboard.
Wafaa
January 19, 2013
ChtgOASGWX

Molly G. - Hey! I wanted to let you know that your video has made a slpash in Tenerife! Some of my friends own a photography shop, and when I posted the link to this video (I saw it on my dad's wall, Clark Gilman) my photography friends here in Tenerife told me they had already seen and were in love with your video!!Thanks for sharing your amazing footage,Molly
indra
February 24, 2012
binary message

Can you give an example of sending and receiving binary sms?
sumit
April 19, 2012
writing xml file in append mode

how can i create Xml file in append mode using kxml in j2me
halo
April 30, 2012
help me

Hellow .... I need to create mobile Dictionary by J2ME .
Muhammad Bilal
June 14, 2012
J2ME

there are very nice tutorials. I like it. Please upload more tutorials about the j2me servelet
aravindan
July 12, 2012
comment

very good website,nice work.......
bramhananda reddy
July 25, 2012
j2me

notes
godfrey marwa
September 13, 2012
j2me

I like it very much, but i dont knw how to deploy it. how can i deploy my appliaction? pls help me
saeed soleimanifar
September 29, 2012
More Example

It could be better if you insert some examples about send text messages in mobile application (SMS,MMS)
sachin
October 1, 2012
query

sir, i am a student of final year so,i request to you how to add a vieos player into a simple programme...
buet_baba
November 27, 2012
feedback

thanx a lot!
Siddhesh Pange
December 1, 2012
Java J2ME tutorial

I like this tutorials .... I found this is THE simplest and fastest tutorial for j2me. It help me to understand and get good start in j2me. Thanks to 'Rose India' and creator of the tutorial .... :)
Bui Cuong
June 24, 2013
Create GameCanvas

Oh, I had understood lessones... but I need to know about creating a GameCanvas
Tuan
July 9, 2013
SO helpfull

this website so helpfull with me, it is easy to understand. Thank you very much.
Bui Cuong
July 3, 2013
Swing

I don't understand swing. Does it use in j2me? And I can see code the calculator... Thank you
nouran mahmoud
October 5, 2013
push registry example

I appreciate your great effort in all these tutorials but I was searching for any example about push registry or how to make my application process in the background ... so please from your gentleness, add a tutorial or examples about this topics thanks :)
DMCA.com