Setup: Difference between revisions

From Mobile Application Design
Jump to navigationJump to search
No edit summary
 
No edit summary
Line 57: Line 57:
<h3>Eclipse</h3>
<h3>Eclipse</h3>


[http://eclipse.org Eclipse] is a fantastic open source Java Integrated Development Environment (IDE) which has a few sweet J2ME plugins. The one I use the most is called [http://eclipseme.org EclipseME].  
[http://eclipse.org Eclipse] is a fantastic open source Java Integrated Development Environment (IDE) which has a few sweet J2ME plugins. The one I use the most is called [http://eclipseme.org EclipseME]. Although Eclipse is cross-platform, EclipseME doesn't work very well on OS X.  


#Download Eclipse from http://www.eclipse.org/downloads/. Install it somewhere easy - like C:\eclipse
#Download Eclipse from http://www.eclipse.org/downloads/. Install it somewhere easy - like C:\eclipse

Revision as of 14:37, 9 September 2006

Setting up your environment

Having a good environment setup is essential for everything you will be doing with Java ME - writing, compiling, packaging, debugging, obfuscating, tearing your hair out etc etc. Use the instructions here to setup your environment on Windows or OS X (currently experimental).

Java + Wireless Toolkit

  1. Java Standard Edition Development Kit (JDK) - you need to have some version of Java installed on your machine. Try to get version 1.4.2 (or later). This is essential for development. NOTE: You MUST have the JDK installed before you install the Java Wireless Toolkit as you will need the tools it contains (such as javac) to compile and run your MIDlets.
  2. Download it here: http://java.sun.com/j2se/downloads/index.html. Get the version without any other bundled software. It should be called something like JDK 5.0 Update 8.
  3. Java ME, Wireless Toolkit (WTK). This contains the essential tools that we need to build, package and install mobile applications. Download it here: http://java.sun.com/products/j2mewtoolkit/. Get the [J2ME Wireless Toolkit 2.2 http://java.sun.com/products/sjwtoolkit/download-2_2.html], or if you feel living on the bleeding edge - grab the Sun [Java Wireless Toolkit 2.5 for CLDC, Beta http://java.sun.com/products/sjwtoolkit/download-2_5.html](the toolkit formerly known as J2ME Wireless Toolkit). Careful, you may cut yourself.
  4. I'm going to assume that you will install this into the
    C:\WTK\
    directory - if you install it somewhere else, just modify the paths accordingly.

Paths

To play nicely with the grown-ups, Java needs to know where all your files are, so we need to add the location of the Java binaries to the system path.

Windows 95/98

Go to Start->Run. Type in command. Then type

SET PATH=%PATH%;C:\WTK\bin

You should also edit your C:\autoexec.bat file to include this line, so you don't have to enter it every single time you restart your computer. After you've done this, you should be able to run the tools included in the Java Wireless Toolkit from any directory on your system.

Windows 2000/XP

  1. Go to Control Panel -> System.
  2. Click on the Advanced Tab
  3. Click on the Environment Variables button
  4. Double-click the PATH variable in the System variables box
  5. At the end of the Variable value field, add the path to your J2ME WTK installation - for me this is something like ;C:\WTK
  6. If you had to install the J2SE SDK too, it's a good idea to add the paths for that as well - for me this was C:\j2sdk1.4.2_03;C:\j2sdk1.4.2_03\bin.

A good way to test if this worked is to type the preverify command without any arguments in the command line. You should see something like this on your screen.

C:\> preverify<br />
Usage: PREVERIFY.EXE [options] classnames|dirnames ...<br />
<br />
where options include:<br />
   -classpath <directories separated by ';'><br />
                  Directories in which to look for classes<br />
   -d <directory> Directory in which output is written <br />
   @<filename>    Read command line arguments from a text file.<br /> 

Emulators

Windows

Depending on your target device, you should download and install the SDK for that particular handset or family of handsets from the manufacturer's site. Since this course is based around the Nokia Series 60 handsets, we're going to grab the Nokia Series 60 2nd Edition SDK, Feature Pack 2 and 3 as well as the Nokia Series 60 3rd Edition SDK (for the N80). You'll also need to get serial numbers for these SDKs, so don't forget to request those as well. Download them from here:

Series 60 SDKs

Mac OS X

None of the manufacturers have bothered to port their SDKs for the Mac, and neither has Sun, but there is a way to develop MIDP 1.0 and 2.0 applications using Michael Power's Mpowerplayer SDK and J2ME Polish. Get them while they're hot:

MPowerplayer SDK

J2ME Polish

IDE's

Eclipse

Eclipse is a fantastic open source Java Integrated Development Environment (IDE) which has a few sweet J2ME plugins. The one I use the most is called EclipseME. Although Eclipse is cross-platform, EclipseME doesn't work very well on OS X.

  1. Download Eclipse from http://www.eclipse.org/downloads/. Install it somewhere easy - like C:\eclipse
  2. Configuring and install EclipseME using the excellent installation and configuration instructions here to guide you through this process.
  3. Once you're done - we're ready to start coding! Yeah!

Netbeans

Download Netbeans from Sun here - http://www.netbeans.org/. I don't use it much, but I've heard good things. Let me know how it treats you.

Mobile.Processing

Mobile.Processing is an open source programming environment for people who want to design and prototype software for mobile phones. It is based on and shares the same design goals as the open source Processing project. Sketches programmed using Mobile Processing run on Java Powered mobile devices. Mobile.Processing is extremely easy to get up and running with, but has some drawbacks which will prevent us from using it.

Mobile.Processing is available for both Windows and Mac OS X. Download it here.