The latest version of Eclipse can be downloaded here: http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/R-3.2.1-200609210945/eclipse-SDK-3.2.1-win32.zip
Then download the latest SDK for Motorola OS phones from: http://developer.motorola.com/docstools/sdks/motorola63
Unzip the SDK and install from the windows installer. Keep the eclipseme zip fild handy for the next step.
Open Eclipse and choose Help...Software Updates...Find and Install
Choose "Search for new Features to Install"
Choose "New Acrhived Site" and point it to the eclipse me zip file from the sdk download. Make sure the checkbox is checked and finish installing the plugin.
Next, you'll need to point eclipse to the Motorola SDK. Go to Window...Preferences and select "Device Management" under J2ME. Click on "Import..." and browse to the directory where the SDK was installed ("C:\Program Files\Motorola\Motorola Java ME SDK v6.3 for Motorola OS Products\" if you chose the default installation). You can choose to just import the v3x emulator, or you can import them all to see how your application will look on different devices.
Make sure your device is in USB Modem Mode before continuing. Then go to Settings, Java Settings on your device and choose Java Application Loader. Once the phone says to plug it into your computer, do so. If your system prompts you for a driver, you can download the Motorola Windows USB Drivers here. Next, you'll need to find the COM port that your phone attached to. To do this, go to the Windows Device Manager and look under Modems for the Motorola USB Modem. Under Properties, Advanced there will be a button to see the COM port setting. Remember this (or better yet, write it down as it will be the same as long as you plug your phone into the same USB port). Then open the Motorola MIDway application and set the port number to the one you wrote down. In MIDway, choose your JAD file and download it to the phone. If all goes well, the application should install and you can run it on the device.
In order to debug your application on the device, keep MIDway running and click on the Debug tab. You'll be able to see your own println's as well as the printf's from the J2ME virtual machine. Note that if you print the stack trace of an exception, you'll only get the method name and exception type, but this is better than nothing.
The following are common permissions:
StringBuffer s = new StringBuffer();
HttpConnection c = (HttpConnection)Connector.open("http://web.mit.edu/index.html");
InputStream is = c.openInputStream();
byte b;
while ((b = (byte)is.read()) != -1) {
s.append((char)b);
}
is.close();
c.close();
Permissions needed: javax.microedition.io.Connector.http
FileConnection sc = (FileConnection)Connector.open("file:///c/mobile/picture/tmp.txt");
OutputStream os = sc.openOutputStream();
os.write(("text to go into the file").getBytes());
os.flush();
os.close();
Permissions needed: com.motorola.file.writeaccess and signing
FileConnection sc = (FileConnection)Connector.open("file:///c/mobile/picture/tmp.txt");
InputStream is = sc.openInputStream();
StringBuffer sofar = new StringBuffer();
byte c;
while ((c = (byte)is.read()) != -1){
sofar.append((char)c);
}
is.close();
Permissions needed: com.motorola.file.readaccess and signing
sender = (MessageConnection)Connector.open("sms://");
TextMessage t = (TextMessage)sender.newMessage(MessageConnection.TEXT_MESSAGE);
t.setPayloadText(message);
t.setAddress("sms://" + contactNumber);
sender.send(t);
Permissions needed: javax.wireless.messaging.sms.send
String cellID = System.getProperty("CellID");
String lac = System.getProperty("LocAreaCode");
String imsi = System.getProperty("IMSI");
String mcc = imsi.substring(0,3);
String mnc = imsi.substring(3,6);
Permissions needed: none, signing
Dialer dialer = Dialer.getDefaultDialer();
dialer.startCall("6172531000");
Permissions needed: com.motorola.phone, signing