[java] Mobile phone games

Started by
2 comments, last by Zahlman 19 years, 7 months ago
Hi, i'm interested in writing java games for mobile phones, but dont know where to start. I have experiance with &#106avascript as well as other programming languages including (C++ and some forms of basic) I have written 2d games before for PC and even once for the Playstation2, so I dont need much help in the programming area it's self. The main things I would like to know are: 1) How do i get my games onto mobile phones once i've made them? 2) Do I need to use a special form of &#106avascript? 3) what methord is used to interperate user inputs? 4) anything else you think might be useful, tutorials would be nice. Thanks in advance.
Advertisement
Java is NOT like &#106avascript. Java is more like C#.<br><br>Here are tutorials for Java: <a href="http://java.sun.com/">http://java.sun.com/</a>.<br>And you use <a href="http://google.com/search?q=MIDP">MIDP(2)</a> to program games.<br><br>You'll need the J2SE SDK and the J2ME-thing for mobile programming.<br><br><br>
Have you seen this?

shmoove
First, try the "Consoles, PDAs, and Cell Phones" forum.

Quote:Original post by Monsi
1) How do i get my games onto mobile phones once i've made them?


Typically via an IR or Bluetooth connection. With some phones you might be lucky enough to be able to get a USB data cable that lets you plug the phone directly into your computer. However, cell phone manufacturers tend not to like to make things that easy, because of concerns about piracy. If your phone is "locked" by some service provider, you might be completely SOL.

A J2ME game consists of two files: a .jar file (Java ARchive; normal J2SE applications are often distributed like this, too) and a .jad file (Java Application Descriptor, I think). The jar file is typically limited in size to either 64K or "nothing really official, but you should probably keep it under 180K or so". This depends on what model of phone you have. The jad file
is a much smaller file (a couple hundred bytes) which contains a bit of information about the jar (what size it's supposed to be, who made it, etc.)

Quote:
2) Do I need to use a special form of &#106avascript?


As others mentioned, &#106avascript has absolutely nothing to do with java; the naming was a dumb marketing trick by Netscape to cash in &#111;n Java's popularity at the time, and frankly I hope Sun sued them for it (although I don't really know the history).<br><br><!--QUOTE--><BLOCKQUOTE><span class="smallfont">Quote:</span><table border=0 cellpadding=4 cellspacing=0 width="95%"><tr><td class=quote><!--/QUOTE--><!--STARTQUOTE--><br>3) what methord is used to interperate user inputs?<!--QUOTE--></td></tr></table></BLOCKQUOTE><!--/QUOTE--><!--ENDQUOTE--><br><br>Standard input doesn't really exist &#111;n cell phones; standard output and the standard error stream do (or at least, J2SE provides support for them), but you won't likely be able to see their contents. (You *can* see them &#111;n phone emulators that run &#111;n your PC, so it is still useful for debugging.)<br><br>The J2SE system therefore provides an event-oriented framework: it sets up a few internal threads that do things like watching the keypad for input, and then you implement callbacks in your code to deal with the events. Actually, this is &#111;ne place where &#106avascript knowledge may help you out: this way of programming things should be second nature to you since you're used to writing "onClick" etc. stuff, while it's a bit foreign to some programmers.<br><br>Typically, you will extend a "Canvas" class (there are other UI classes, but they're intended more for general application development than for games), and implement methods with names like "paint(Graphics)", "keyPressed(int)" and so &#111;n. The Graphics object passed to your paint method represents the screen; you can call methods &#111;n it in order to draw stuff. The integer value passed to keyPressed tells you what key was pressed. Stuff like that.<br><br><!--QUOTE--><BLOCKQUOTE><span class="smallfont">Quote:</span><table border=0 cellpadding=4 cellspacing=0 width="95%"><tr><td class=quote><!--/QUOTE--><!--STARTQUOTE-->4) anything else you think might be useful, tutorials would be nice.<!--QUOTE--></td></tr></table></BLOCKQUOTE><!--/QUOTE--><!--ENDQUOTE--><br><br>The aforementioned forum.<br>Oh, and the Sun website. Anything you can learn about ordinary Java (except for the UI API stuff - i.e. using Swing) will be useful to some extent for J2SE; you can also look up javadoc for the platform, and get at some other useful resources.

This topic is closed to new replies.

Advertisement