Exit Print View

Java Platform Micro Edition Software Development Kit Version 3.0

Get PDF Book Print View

Document Information

Getting Started

Java ME Platform SDK Features

Using Sample Projects

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

Monitoring Network Traffic

Lightweight UI Toolkit

Security and MIDlet Signing

BD-J Support

CLDC Emulation on a Windows Mobile Device

Installing CLDC Emulation on a Windows Mobile Emulator

On-device Debugging

Command Line Reference


JSR Support

JSR 75: PDA Optional Packages

FileConnection API


Running PDAPDemo

Browsing Files


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

JSRs 184, 226, and 239: Graphics Capabilities

JSR 205: Wireless Messaging API (WMA) Support

JSR 211: Content Handler API (CHAPI)

JSR 238: Mobile Internationalization API (MIA)

JSR 229: Payment API Support

JSR 256: Mobile Sensor API Support


FileConnection API

On a real device, the FileConnection API typically provides access to files stored in the device’s memory or on a memory card.

In the Java ME Platform SDK emulator, the FileConnection API enables MIDlets to access files stored on your computer’s hard disk.

The files that can be accessed using FileConnection are stored in subdirectories of USER_HOME/javame-sdk/3.0/work/emulator-instance/appdb/filesystem. For example, the DefaultCldcPhone1 emulator skin comes with a root directory installed called root1, which contains a Readme file and an empty directory named photos. The full path of the file is: USER_HOME/javame-sdk/3.0/work/emulator-instance/appdb/filesystem\root1\photos.

Note - If multiple instances of the same emulator skin run simultaneously, the Java ME Platform SDK generates unique file paths for each one. For instance, the first directory is named DefaultCldcPhone1 and the second instance is named DefaultCldcPhone2.

Each subdirectory of filesystem is called a root. The Java ME Platform SDK provides a mechanism for managing roots. While the emulator is running, choose View > External Events Generator from the emulator window’s menu. A utility window opens. Click the File Connection tab.

External event generator window with File Connection tab selected

In the File Connection panel you can mount, unmount, or delete filesystem roots. Mounted roots are displayed in the top list, and unmounted roots are moved to the bottom list. Mounted root directories and their subdirectories are available to applications using the FileConnection API. Unmounted roots can be remounted in the future.