File picker sample app
The file picker sample application demonstrates how to create a UI component that presents a list of folders and files from which a user can select a file. The sample application also demonstrates how to specify the default search location for folders and how to filter files by file extension (for example, how to display only .mp3 files).
|
File name |
Description |
|---|---|
|
FilePickerDemo.java |
|
This sample features the following classes:
net.rim.device.api.ui.picker.FilePicker
This class provides methods to access the user interface for file selection. You can use these methods to display the file selection screen, specify the default folder path, and filter files by file name extensions.
The sample application uses the setPath() method to specify a start path location from which the user can select files. The sample application also uses thesetFilter() method to present files that have a specific file name extension.
Install the sample app
Visit www.blackberry.com/go/filepickersample to download the sample application.
Extract the filepickerdemo.zip file.
On the taskbar, click Start > Programs > Research In Motion > BlackBerry JDE 5.0 > JDE.
Open the workspace that you want to add the sample application to.
In the workspace tree, right-click the project that you want to add the sample application to.
Click Add project to <workspace directory>.
In the Add project to <workspace> dialog box, browse to the folder where you extracted the sample application.
Click the FilePickerDemo.jdp file.
Click Open.
The sample app is also available in github.
Run the sample app
In the workspace where you added the filepickerdemo project, right-click filepickerdemo.
Click Build project.
On the taskbar, click Start > Applications > Research in Motion > BlackBerry JDE 5.0 > Device Simulator.
On the Home screen of the BlackBerry Smartphone Simulator, click the Downloads folder.
Click the File Picker Demo icon.