Java
Java ME
Java Mobile
Start Learning
Run your App
![]() | JAVA MOBILE - START LEARNING | ![]() |
| ||
Click the run button. If you have any build errors, correct them. Eventually, your application appears in the emulator.![]() To change which emulator skin is used, Control-click on the project and choose Properties. Select Platform in the left pane. In the right pane, choose the emulator from the Device combo box. | ||
| ||
You can run your application on a real phone by transmitting the application archive file to the phone. MIDP applications consist of two files. The first is the application descriptor, a text file that contains information like the application's name, API dependencies, archive size, and more. The second is a JAR file that contains the classes and resources of the application. Devices typically examine the application's descriptor to help decide if they want to download the JAR file and install it. Applications are deployed on devices using one of the following four techniques:
The exact details of transferring files to a device vary widely, so you need to experiment a little to understand how it works for your device. The application archive lives in a subdirectory of your project directory. By default, the Java ME SDK places your projects in
Assuming you are able to transfer this file to your device, the device should recognize it and allow you to run it. Running the Application on a HTC Freestyle Using a Memory CardThis section describes transmitting the application to a HTC Freestyle from a Windows computer using a microSD memory card. This section describes the HTC Freestyle, but the actual UI or process is different from device to device. Begin by inserting the card into your computer. It shows up as an additional drive. Locate ![]() ![]() You will see a list of installed Java applications, which might be empty. Touch Menu, then Storage. ![]() The screen shows a list of all Java applications found on the device or memory card. Choose AwesomeApplication.jar and touch Install. Touch OK to confirm your intent. ![]() Finally, the HTC Freestyle gives you a chance to run the application. ![]() Adjusting the MIDP Version for Older DevicesFor older devices, you might need to tell the Java ME SDK to use MIDP 2.0 instead of MIDP 2.1 when compiling the application. Control-click on the project and choose Properties. In the properties window, select Platform in the left pane, then click on MIDP 2.0. ![]() Click OK, then rebuild the project by choosing Run > Build Main Project from the menu. Running the Application on a Nokia 6300 Using BluetoothThis section describes transmitting the application to a Nokia 6300 from an OS X computer using Bluetooth. You should have previously paired the device with your computer.To transfer the application JAR file, choose Send File... from the OS X Bluetooth menu, as shown here: ![]() Navigate to AwesomeApplication.jar in the project directory.![]() Now choose the destination device. ![]() As the file transmits, you see its progress. ![]() On the Nokia 6300, choose Menu > Apps. Navigate to AwesomeApplication and launch it: ![]() Some other deployment scenarios are described in the following documents.
In the video below, Jonathan Knudsen demonstrates how to install a MIDP application on an HTC mobile phone. | ||