Configuring the Web Browser and Proxy Settings
Running MIDP and CLDC Sample Projects
Viewing and Editing Project Properties
Running Projects in the Emulator
Searching the WURFL Device Database
Finding Files in the Multiple User Environment
CLDC Emulation on a Windows Mobile Device
Installing CLDC Emulation on a Windows Mobile Emulator (Windows Only)
JSR 82: Bluetooth and OBEX Support
JSR 135: Mobile Media API Support
JSR 177: Smart Card Security (SATSA)
JSR 205: Wireless Messaging API (WMA) Support
JSR 211: Content Handler API (CHAPI)
JSR 226: Scalable 2D Vector Graphics
JSR 238: Mobile Internationalization API (MIA)
JSR 256: Mobile Sensor API Support
This demo contains several MIDlets that highlight different MIDP features.
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.
To select a vertical bar to change, use the up navigation arrow to move to the color bars. Use the right navigation arrow to highlight a color bar. The large rectangle becomes the color of the selected bar.
Use the up or down selection arrows to choose the value to change (red, green, or blue). Use the left or right arrow keys to increase or decrease the selected value. The second menu item allows you to jump in increments of 4 (Fine) or 32 (coarse).
You can change the color on any or all of the vertical bars.
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“
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.
Right-click on Demos and select Properties.
Select the Running category.
Select Regular Execution.
Check Specify the Security Domain and select Maximum.
Click OK.
If you are using a proxy server, you must configure the emulator’s proxy server settings as described in Configuring the Web Browser and Proxy Settings. The HTTP version must be 1.1.
If you are running antivirus software, you might need to create a rule that allows this MIDlet to allow connections to and from a specific web site. See Troubleshooting.
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.
Choose 2 to GET information from the selected page.
Choose 3 to obtain the POST information from the selected page.
Choose 4 to display the HEAD attributes for the page.
Choose 5 to bring up the current list of web pages. You can chose a new page or add your own page to the list. To specify a new URL, choose the Add soft button, then select the Menu soft button and choose OK. The screen displays http://. Type in the rest of the URL, making sure to end with a slash (/). For example http://www.internetnews.com/. Press the OK soft button. The Http Test screen shows your new URL and prompts for an action.
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.
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.
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.
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.
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.
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.
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.
Choose the right control and press select.
Each click raises the value by 32.
The Chooser application uses a variety of controls to change text color, background color, and fonts.
Choose Menu > Text Color. Change the color as described for MiniColor and select the OK soft button.
Choose Menu > Background Color. Change the color as described for MiniColor and select the OK soft button.
Choose Menu > Fonts. You can change the font Face, Style, and Size.
Cursor up and down to highlight a property, then select. The left and right keys jump between lists. Up and down keys move item by item.
Click OK to continue.
This sample makes an HTTP communication. A popup confirms the transaction was successful.
This application displays a predefined URL. You can also enter a new URL.
Launch the HttpView application.
Select Menu > 2 to get the contents of the URL.
Select Menu > 6 to view application instructions.
This application simulates a feed. As soon as you connect, you receive and display a graphic. Select Done to continue.