Download Print this page

Motorola A780 Manual To Getting Started

J2me
Hide thumbs Also See for A780:

Advertisement

Quick Links

Guide to getting started in J2ME for the
Motorola A780 phone
This guide will take you through setting up a build environment for J2ME in Windows
and in writing a few sample applications for the A780 phone. There are some notes at the
end if you are on another platform, but we strongly recommend using a Windows
environment so that you can make full use of the simulator and debug output.
1. Setting up Eclipse
We recommend using Eclipse for your Java editing. If you're not familiar with
Eclipse, you can get more information here: http://www.eclipse.org/
The latest version of Eclipse can be downloaded here:
http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/
R-3.1.1-200509290840/eclipse-SDK-3.1.1-win32.zip
2. Setting up the Motorola J2ME SDK
Next, you'll need to set up the Motorola SDK. You will need to create an account
on the Motocoder website:
https://www.motocoder.com/motorola/template.jsp;jsessionid=1efdf:43cd0cee:99
0f451891647ff?filename=center_registration.jsp
Then download the latest SDK from:
http://www.motocoder.com/motorola/download.jsp?FILENAME=downloads/files
/SDK542.zip
Install this SDK to your windows system in the default directory (makes later
steps much easier!)
3. Setting up EclipseME J2ME Plugin
Next, you need to set up the J2ME plugin that will tie the Motorola SDK into the
Eclipse environment.
Install EclipseME with these instructions:
http://eclipseme.org/docs/installEclipseME.html
Configure EclipseME with these instructions:
http://eclipseme.org/docs/configuring.html

Advertisement

loading

Summary of Contents for Motorola A780

  • Page 1 This guide will take you through setting up a build environment for J2ME in Windows and in writing a few sample applications for the A780 phone. There are some notes at the end if you are on another platform, but we strongly recommend using a Windows environment so that you can make full use of the simulator and debug output.
  • Page 2 Emulator to create a new configuration. The project name should be auto- populated with your current project. Under "Executable: Midlet" enter the name of your Midlet. 3. Under the emulation, platform definition tab, choose "Motorola SDK for J2ME MOJM3" 4. Click on Run to start the Midlet in the emulator.
  • Page 3: A Word About Permissions

    JAD file appropriately. You can do this by clicking on the JAD file in your main project (not the one in "deployed") and going to the "optional" tab. Under "Midlet Permissions:" add the appropriate permissions comma separated. The following are common permissions: javax.microedition.location.Location com.motorola.file.readaccess com.motorola.file.writeaccess javax.microedition.io.Connector.http com.motorola.phone javax.wireless.messaging.sms.send javax.wireless.messaging.sms.receive 8.
  • Page 4: Sending An Sms

    FileConnection sc = (FileConnection)Connector.open("file:///phone/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 2. Reading a file: FileConnection sc = (FileConnection)Connector.open("file:///phone/tmp.txt"); InputStream is = sc.openInputStream(); StringBuffer sofar = new StringBuffer(); byte c; while ((c = (byte)is.read()) != -1){ sofar.append((char)c);...
  • Page 5: Helper Classes

    While the Motorola emulator only runs on Windows, you should be able to code J2ME apps on other platforms. Soon, we will post the jar file for the a780 sdk that you can link into your project in eclipse on any platform.