Exit Print View

Java Platform Micro Edition Software Development Kit Version 3.0, Mac OS

Get PDF Book Print View
 

Document Information

Getting Started

Features

Using Sample Projects

Running a Project

Troubleshooting

Sample Project Overview

Configuring the Web Browser and Proxy Settings

Resolving Reference Problems

Running MIDP and CLDC Sample Projects

Running the Demos Sample Project

Running FPDemo

Running Games

Running Network Demo

Running PhotoAlbum

Running UIDemo

Creating and Editing Projects

Viewing and Editing Project Properties

Running Projects in the Emulator

Searching the WURFL Device Database

Finding Files in the Multiple User Environment

Profiling Applications

Network Monitoring

Lightweight UI Toolkit

Security and MIDlet Signing

CLDC Emulation on a Windows Mobile Device

Installing CLDC Emulation on a Windows Mobile Emulator (Windows Only)

On-device Debugging

Command Line Reference

Logs

JSR Support

JSR 75: PDA Optional Packages

JSR 82: Bluetooth and OBEX Support

JSR 135: Mobile Media API Support

JSR 172: Web Services Support

JSR 177: Smart Card Security (SATSA)

JSR 179: Location API Support

JSR 180: SIP Communications

JSR 184: Mobile 3D Graphics

JSR 205: Wireless Messaging API (WMA) Support

JSR 211: Content Handler API (CHAPI)

JSR 226: Scalable 2D Vector Graphics

JSR 229: Payment API Support

JSR 238: Mobile Internationalization API (MIA)

JSR 256: Mobile Sensor API Support

Index


Running the Demos Sample Project

This demo contains several MIDlets that highlight different MIDP features.

Colors

This application displays a large horizontal rectangle that runs the width of the screen. Below, ten small vertical rectangles span the screen. Finally, three horizontal color bars indicate values for blue, green, and red (RGB). Values are expressed as decimal (0-255) or hexadecimal (00-ff) based on the first menu selection.

Properties

This MIDlet displays your system property values. The output is similar to the following values:

Free Memory = 2333444
Total Memory = 4194304
microedition.configuration = “CLDC-1.1“
microedition.profiles = “MIDP-2.1“
microedition.platform = “j2me“
microedition.platform = “en-US“
microedition.platform = “IS08859_1“
Http

This test application uses an HTTP connection to request a web page. The request is issued with HTTP protocol GET or POST methods. If the HEAD method is used, the head properties are read from the request.

Preparing to Run the Demo

Before beginning, examine your settings as follows.

Running the Demo

Launch the Http MIDlet. To test, choose the Menu soft key and choose Get, Post, or Head to test the selected URL.

Http Test returns the information it is able to obtain. If the information fills the screen use the down arrow to scroll to the end. The amount of information depends on the type of request and on the amount of META information the page provides. To provide body information or content, the page must declare CONTENT-LENGTH as described in RFC 2616.

Using Menu Options

Use the Menu soft key for the following actions.

FontTestlet

This MIDlet shows the various fonts available: Proportional, Regular, Regular Italic, Bold Plain, and Bold Italic. Choose 1 or 2 from the menu to toggle between the system font (sans serif) and the monospace font.

Stock

Like the Http demonstration, This sample uses an HTTP connection to obtain information. Use the same preparation steps as Http.

Run the Demos project and launch the Stock MIDlet.

By default, the screen displays an empty ticker bar at the top. Below the ticker, the menu list shows four applications: Stock Tracker, What If? Alerts, and Settings. You must add stock symbols before you can use the first three applications.

Add Stock Symbols to the Ticker

To add a stock symbol to the ticker, use the navigation arrows to select Settings.

Select Add Stock.

The display prompts you to enter a stock symbol. Type JAVA and select the Done soft key. The stock you added and its current value is now displayed in the ticker. Add a few more stock symbols, such as IBM and HPQ.

Change the Update Interval

By default the update interval is 15 minutes. Select Updates to change the interval. Use the navigation arrows to select one of Continuous, 15 minutes, 30 minutes, one hour, or three hours. Select the Done soft key.

Remove a Stock

Select Remove a Stock. You see a list of the stocks you have added. Use the navigation keys to select one or more stocks to remove. Choose the Done soft key.

Stock Tracker

Stock Tracker displays a list of the stocks you added and their current values. Stock tracker displays additional information about the selected stock, for example, the last trade and the high and low values.

Choose a stock and press Select.

What If?

What If? is an application that asks for the original purchase price and the number of shares you own. It calculates your profit or loss based on the current price.

Select a stock symbol.

Enter the purchase price and the number of shares, then press Calc.

Alerts

This application sends you a notification when the price changes to a value you specify.

From the main menu, select Alerts.

Select Add.

Choose a Stock. The screen prompts, “Alert me when a stock reaches”. Enter an integer.

The alert is placed on the Current Alerts list. To remove an alert, press Remove and select the alert. Choose the Done soft key.

When the value is reached you will hear a ring and receive a message. For example, Symbol has reached your price point of $value and is currently trading at $current_value. Once the alert is triggered it disappears from the Current Alerts list.

Tickets

This demonstrates how an online ticket auction application might behave. The home screen displays a ticket ticker across the top. The Choose a Band field displays Alanis Morrisette by default.

To select a band, highlight the band name and press Select. Use the down arrow to highlight a different band, moby, for example, then press Select. The available auction appears.

To make a bid, select the Menu soft key and choose 2. Use the arrow keys to move from field to field. Fill out each field. Select the Next soft key. The application asks you to confirm your bid. Use the arrow keys to highlight Submit then press Select. You receive a Confirmation number. Click Bands to return to the welcome page.

To set an alert, select the Menu soft key and choose 3. Use the navigation arrows to move to the field and type in a value higher than the current bid. Select the Save soft key. You are returned to the welcome page. You can trigger the alert by making a bid that exceeds your alert value. Your settings determine how often the application checks for changes, so the alert may not sound for a few minutes.

To add a band, select the Menu soft key and choose 4. Type in a band name or a comma‐separated list of names. Choose the Save soft key. After confirmation you are returned to the welcome page. The added band(s) are displayed in the Choose a Band drop‐down menu.

Note, this is only a demonstration. To fully describe the band you must edit the following file:

Mac OS

installdir/apps/Demos/src/example/auction/NewTicketAuction.java

Windows

installdir\apps\Demos\src\example\auction\NewTicketAuction.java.

To remove a band, select the Menu soft key and choose 5. Navigate to a band then choose Select to mark the check box. You can select multiple bands. Choose the Save soft key.

To display the current settings for ticker display, updates, alert volume, and date, select the Menu soft key and choose 6. If desired, use the arrow keys and the select key to change these values. Choose the Save soft key.

ManyBalls

This MIDlet starts with one ball traveling the screen. Use the up and down arrows to accelerate or decelerate the ball speed (fps). Use the right or left arrows to increase or decrease the number of balls.

MiniColor

This MIDlet sets an RGB value. Use navigation keys to change color values.

Keyboard controls work as you would expect. First cursor up or down to highlight a color, and then use left and right keys to lower and raise the value of the selected color.

The virtual keyboard requires an extra step to select each control before you can change its value. In virtual mode, use the navigation keys to highlight a virtual control, then press select to activate the control.

  1. Click the Virtual soft key.

    The application displays a 4-way control.

    The up and down keys select a color. The left and right keys lower and raise the value of the selected color.

    Use keyboard navigation keys to choose a control on the display, then press Select.

  2. Select the first bar (blue).

    A white box surrounds the selected color.

    Blue and has a value of 0 so you don’t see any blue yet.

  3. Choose the right control and press select.

    Each click raises the value by 32.

Chooser

The Chooser application uses a variety of controls to change text color, background color, and fonts.

HttpExample

This sample makes an HTTP communication. A popup confirms the transaction was successful.

HttpView

This application displays a predefined URL. You can also enter a new URL.

PushExample

This application simulates a feed. As soon as you connect, you receive and display a graphic. Select Done to continue.