Learn,create,game,application,your,cellphone
Quick Search for:  in language:    
Learn,create,game,application,your,cellphone
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Java/ Javascript Stats

 Code: 156,060 lines
 Jobs: 365 postings

 
Sponsored by:

 

You are in:

 
Login



Latest Code Ticker for Java/ Javascript.
Click here to see a screenshot of this code!Kohonen
By Marcelo Ivan Martin on 10/24

(Screen Shot)

Click here to see a screenshot of this code!New Ticker
By Aidan Dunbar on 10/24

(Screen Shot)

Click here to see a screenshot of this code!Click The ball game
By Sugi on 10/23

(Screen Shot)

Click here to see a screenshot of this code!Modified Horizontal Marqueue
By Sugi on 10/23

(Screen Shot)

Palindrome using linked stack and linked queue
By lostcauz on 10/23


Click here to see a screenshot of this code!A ( part2 ) Powerful Java Servlet & JDBC Code for Web Development
By James Smith Kelleher on 10/21

(Screen Shot)

Crack Javascript Source-Protecti on
By cool4best on 10/19


format date
By Sam Collett on 10/18


Click here to see a screenshot of this code!Applicant assessment
By SP Tang on 10/18

(Screen Shot)

Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

Creating a Cellphone Game/Application

Print
Email
 

Submitted on: 7/22/2002 11:19:39 AM
By: R. Kistner  
Level: Beginner
User Rating: By 10 Users
Compatibility:Java (JDK 1.2)

Users have accessed this article 1770 times.
 
(About the author)
 
     Learn how to create a game or application for your cellphone.


 
 
Terms of Agreement:   
By using this article, you agree to the following terms...   
1) You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.

Creating a Game or Application for your Cellphone

by Ralf Kistner

To create a game or application for your cellphone, you need the following:
  1. Jdk1.3 or higher
  2. J2ME Wireless Toolkit
  3. Any java or text editor
  4. A java-compatible cellphone (optional)

Creating a basic application that displays a string

Step 1: In J2ME Wireless Toolkit, create a new project. Give the project any name you want. Make the class name 'Main'. In the next screen, the only thing you need to change is the icon under the MIDlets tab. If you don't have a .png (Portable Network Graphics) icon, clear the icon field.

Step 2: Create [J2ME home dir]\apps\[project name]\src\main.java and place the following code in it:

import javax.microedition.midlet.MIDlet;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Canvas;

public class Main extends MIDlet {
 private Canvas display;

 public Main () {
  display = new Display ();
 }

 public void startApp () {
  Display.getDisplay (this).setCurrent (display);
 }

 public void destroyApp (boolean b) { }
 public void pauseApp () { }
}


Step 3: Create [J2ME home dir]\apps\[project name]\src\Picture.java and place the following code in it:

import javax.microedition.lcdui.*;

public class Display extends Canvas {
 Image img = Image.createImage (getWidth (), getHeight ());
 Graphics graphics = img.getGraphics ();

 public Display () {
  graphics.drawString ("Just a String", 0, 0, 0); //String,x,y,anchor
 }

 protected void paint (Graphics g) {
  g.drawImage (img, 0, 0, 0); //Image,x,y,anchor
 }
}


Step 4: In J2ME, build the project. If it doesn't give any errors, you can choose the device and run it. A frame with a cellphone in it should pop up. Click on the button under launch and you should see "Just a String".

Congratulations! You have just made your 1st cellphone application!

Step 5: To put it on your cellphone, you'll have to create a package (Project->Package->Create Package). See your cellphone's manual for futher instructions on how to put it on your cellphone.

In a later tutorial i'll explain how to use Forms. For further information, see J2ME's documentation.

If you read this tutorial, please support it by voting. It takes less than a minute of your time.


Other 2 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this article(in the Beginner category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
7/23/2002 7:22:41 AM:ElChico
I wanted to do something like this. Now I only need to get a cell phone that will support Java and Capunnn.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/23/2002 10:16:34 AM:Jose M Serrano
Excellent, now I will be able to learn wireless applications. Thanks for sharing it. 5 beans
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/31/2002 3:47:02 PM:Rafal Krolik
This is excellent tip. Any idea off the top which phones support Java?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/21/2002 11:27:50 AM:Tim McNally
In step 3, shouldn't Picture.java be named Display.java?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/6/2002 7:54:23 AM:
The new Nextel phones support Java.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/12/2002 3:16:14 PM:R Kistner
Sorry, it should be Display.java, not Picture.java.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this article has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular article, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | Java/ Javascript Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.