ImageAlbum

所属分类:J2ME
开发工具:Java
文件大小:166KB
下载次数:186
上传日期:2006-04-27 21:04:02
上 传 者jlflying
说明:  相册是J2me MIDLet 的一个demo程序,可以使用户查阅图片在J2me支持的手持设备上。 文件夹与文件 +ImageAlbum -ImageAlbum.mcp -ImageAlbum_ReadMe.txt - debug_out - release_out - resources - 1.png - 2.png - 3.png - 4.png - 5.png + sources - DownloadFromURLForm.java - HelpDisplayForm.java - HttpDownloader.java - ImageAlbum.java - MainMenu.java - MyTimerTask.java - OptionsInputForm.java - PhotoCanvas.java - RMSOperations.java - StringByteOperations.java String data
(J2me MIDLet albums is a demo procedures, users can access images in J2me support handheld devices. Folders and documents ImageAlbum- ImageAlbum.mcp- ImageAlb um_ReadMe.txt- debug_out- release_out- RESO ;- 1.png- NumberMunchersScreenshot.jpg-edit-info-5 stars sourc es-DownloadFromURLForm.java- HelpDisplayF orm.java- HttpDownloader.java- ImageAlbum. java-MainMenu.java- MyTimerTask.java- Opti onsInputForm.java- PhotoCanvas.java- RMSOp erations.java- StringByteOperations.java S tring data)

文件列表:
debug_out (0, 2003-03-11)
debug_out\ImageAlbum.jad (370, 2003-03-11)
debug_out\ImageAlbum.jar (64619, 2003-03-11)
ImageAlbum.mcp (59313, 2003-03-11)
ImageAlbum_Data (0, 2003-03-11)
ImageAlbum_Data\CWSettingsWindows.stg (3586, 2003-03-11)
ImageAlbum_Data\Java_MIDlet_Debug (0, 2003-03-11)
ImageAlbum_Data\Java_MIDlet_Debug\cw.jrf (294, 2003-03-11)
ImageAlbum_Data\Java_MIDlet_Debug\lif (1, 2003-03-11)
ImageAlbum_Data\Java_MIDlet_Debug\TargetDataWindows.tdt (98624, 2003-03-11)
ImageAlbum_Data\Java_MIDlet_Release (0, 2003-03-11)
ImageAlbum_Data\Java_MIDlet_Release\cw.jrf (298, 2003-03-11)
ImageAlbum_Data\Java_MIDlet_Release\lif (1, 2003-03-11)
ImageAlbum_Data\Java_MIDlet_Release\TargetDataWindows.tdt (33167, 2003-03-11)
release_out (0, 2003-03-11)
resources (0, 2003-03-11)
resources\1.png (15234, 2003-03-11)
resources\2.png (4645, 2003-01-09)
resources\3.png (4199, 2003-01-09)
resources\4.png (6504, 2003-01-09)
resources\5.png (11298, 2003-01-09)
sources (0, 2003-03-11)
sources\DownloadFromURLForm.java (10204, 2003-01-09)
sources\HelpDisplayForm.java (5729, 2003-01-09)
sources\HttpDownloader.java (2519, 2003-01-09)
sources\ImageAlbum.java (25475, 2003-03-11)
sources\MainMenu.java (8438, 2003-01-09)
sources\MyTimerTask.java (1619, 2003-01-09)
sources\OptionsInputForm.java (2772, 2003-01-09)
sources\PhotoCanvas.java (9610, 2003-03-11)
sources\RMSOperations.java (8504, 2003-03-11)
sources\StringByteOperations.java (2698, 2003-01-09)

ImageAlbum_ReadMe.txt - for Image Album demo 2.0 Date: 27th September, 2002 Author: Edmund Wong, Metrowerks Corp. ~~~~~~~~~~~~~~~~ COPYRIGHT NOTICE ~~~~~~~~~~~~~~~~ /* * (c) Copyright. 2002. Metrowerks Corp. ALL RIGHTS RESERVED. * This code is provided "AS IS" without warranty of any kind * and subject to Metrowerks Sample Application End User License * Agreement. * NO EXTERNAL DISTRIBUTION OR COMMERCIALIZATION OF THE SOFTWARE * IS PERMITTED EXCEPT BY WRITTEN AGREEMENT OF METROWERKS. */ ~~~~~~~~~~~~~~~ ABOUT THIS CODE ~~~~~~~~~~~~~~~ Image Album is a J2ME MIDlet demo program that allows users to view images on J2ME enabled handsets. Users can download PNG format images from a Web server over-the-air (OTA), and add their own descriptions to these images. Users can also add their own PNG image files to the album by just including them in the ImageAlbum.jar file without changing the source code. ~~~~~~~~~~~~~~~~~ FOLDERS AND FILES ~~~~~~~~~~~~~~~~~ + ImageAlbum - ImageAlbum.mcp // The CodeWarrior project for this example. - ImageAlbum_ReadMe.txt // The Read Me file for building the demo. - debug_out // Output directory for Java MIDlet Debug build target. - release_out // Output directory for Java MIDlet Release build target. - resources // Directory for images in PNG format. - 1.png // Sample image in PNG format - 2.png // Sample image in PNG format - 3.png // Sample image in PNG format - 4.png // Sample image in PNG format - 5.png // Sample image in PNG format + sources // Directory with source code for demo. - DownloadFromURLForm.java // Implements download file form - HelpDisplayForm.java // Implements Help information form - HttpDownloader.java // Implements http download methods - ImageAlbum.java // Implements MIDlet's main class - MainMenu.java // Implements main menu list - MyTimerTask.java // Implements timer for slide show - OptionsInputForm.java // Implements program options form - PhotoCanvas.java // Implements image display and UI - RMSOperations.java // Implements access to device's persistent // storage - StringByteOperations.java // Implements conversion between byte and // String data ~~~~~~~~~~~~~~ SERVER TESTING ~~~~~~~~~~~~~~ To test the download features of Image Album, you must have a http server running, with the J2ME ImageAlbum version 2 MIDlet executing within the emulator. To install and use the Apache Web Server: --INSTALL WEB SERVER The installer versions of the Apache Web server software are located at: http://nagoya.apache.org/mirror/httpd/binaries/ Select the server for the target plaform and download the appropriate binary file. The instructions that follow are for the Windows implementation. Run the executable installer and follow the instructions provided by the installation wizard. --TEST WEB SERVER After the installation completes, point a Web browser to http://localhost. If you see the Apache welcome page, your Apache installation was successful. --FILE SETUP FOR DOWNLOAD After successful installation of Apache Web server, copy any .png image files for download testing to the following directory: Program Files\Apache Group\Apache2\htdocs The directory path depends on installation path of your Apache Web Server. --USE IMAGE ALBUM'S DOWNLOAD FEATURE Download the *.png file by specifying the URL as http://localhost/*.png in the ImageAlbum v2.0 download function. You can also browse the image by specifying this URL in your browser. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ New Features added in Version 2.0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Supports image scrolling, useful for viewing large image on small screen. * Supports PNG images download from a Web server over-the-air (OTA). * Users can add their own descriptions to images. * Users can edit descriptions of images in the album. * Users can delete downloaded images in the album. * Users can check the number of images saved in the album and the use of the phone's persistent memory. ~~~~~~~~~ INTERFACE ~~~~~~~~~ TOUCH SCREEN PHONE | NON-TOUCH SCREEN | EMULATOR KEYBOARD | | Scroll to view | | large image ---- By pointer drag action | Navigation button | Arrow keys | | Navigate to | | previous image - Press navigation key UP | Keypad key 1 | Number key 1 or LEFT | | | | Navigate to | | next image ----- Press navigation key | Keypad key 3 | Number key 3 DOWN or RIGHT ~~~~~~~~~~~~~~~~~ PROGRAM OPERATION ~~~~~~~~~~~~~~~~~ After the MIDlet starts, you can choose the following commands from the Main Menu: View Album- This command lets you view the images one by one at your pace. You can browse through the Image Album forward and backward by pressing the keys shown above, or using the command displayed from the menu. You can also scroll through the on-screen image using the keys shown above. Choose the command 'Edit description' from the menu to edit the description of the currently displayed image. Choose the command 'Delete Image' to delete the current image. (Note: only an image downloaded Over-The-Air and added to the album can be deleted. An image stored in the MIDlet's JAR package CANNOT be deleted.) Slide Show- This Main Menu command lets you view the images in the Image Album one by one without pressing any key. It displays the next image in the album automatically at the time interval preset in 'Options'. You can also pause or continue the slide show using the menu commands 'Pause' and 'Continue Slide Show' . Options- With this Main Menu command, you can choose to loop back to first image or not while navigating through the album. You do this by checking the 'Looping?' check box. You can also preset the time interval between consecutive images during Slide Show. The default interval is 3 seconds. Download from specified URL- This Main Menu command lets you download PNG images from a web server using over-the-air (OTA) provisioning. You enter the image file's URL in the text box shown and choose the 'Get Image' Command to start download the image. When the download completes you see its image on-screen, Now choose the 'Save Image' command to save image into the phone's persistent storage. When an image is saved, the URL it was downloaded from becomes the image's default description. You can edit the description in the text box on 'Image Save OK!' screen, and then choose 'Save description' Command to save the changes. Image Database Status Information- You use this Main Menu Command to display the following information: 1. Total number of images stored in the Image Album. 2. Number of images in the Image Album JAR package. 3. Number of images saved in the phone's Record Store (persistent storage). 4. The amount of memory the Record Store consumes to store the images. 5. The amount of memory the Record Store uses to hold the descriptions. 6. The remaining memory available in Record Store. Help- You obtain addtional Help information by selecting this command. You browse through the HELP content using the handset's UP and DOWN keys. About- You can check the Image Album version number by selecting this command. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ADDING AN IMAGE TO THE IMAGE ALBUM JAR PACKAGE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Users add PNG image files to the album by first naming the files with numbers (that is, 1.png, 2.png....etc). Next, the files are placed in the ImageAlbum.jar file as a resource. The names of these PNG files MUST be in a consecutive number sequence, as shown above. Adding another PNG file requires a number that is the next consecutive number not in use within the .jar file. That is, the number follows the largest number already used in the .jar file. For example, if the .jar file stores image files 1.png through 5.png, the next file you add must be named 6.png. To add a PNG image file to ImageAlbum.jar in CodeWarrior Wireless Studio: First place the PNG files in the resources folder. Next, add the PNG files to the project. After adding the PNG files, examine each one using the Project Inspector. Check the 'Merge Into Output' option in the Project Inspector window. ~~~~~~~~~~~ LIMITATIONS ~~~~~~~~~~~ The maximum number of images allowed in the album depends on: 1. The heap size limitations of handsets. 2. Restriction on .jar file size by real handsets (for images stored in a JAR package). The user interface may not display properly on all phones, depending upon the size of the display screen. For example, the command item or menu items may not appear completely. Image Album version 2.0 runs on various devices in Emulator 7.5 of Motorola J2ME SDK 2.0/3.0, except T720, which crashes with the default heap size setting. This problem can be fixed in the simulator by increasing the heap size to 1048576 bytes. Use notepad or any text editor to modify the heap size value to "heapsize=1048576" inside the TP720 properties file. This is located in Program Files\J2ME SDK v3.0\Emulator7.5\bin\resources\T720.props (the path may vary depending upon on your installation of the Motorola J2ME SDK). However, menu items or command names may not be displayed completely becaues of the relatively small screen size. When launched on real devices, the time required for Image Album to launch depends upon the total size of all the images stored in the .jar package. For Exceptions caught in networking/save/delete operations, Image Album lacks a dianostic UI that alerts the user to the problem. Such diagnostic messages are currently only available within the DOS prompt of the emulation environment, and are for debugging purposes only. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ISSUES FOUND DURING TESTING WITH REAL DEVICES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A388: - The speed is slow during launching and during operations like OTA download/save/delete image, should add a 'Loading' progress bar. (may be added in new version.) - The sequence in reading records from RecordStore using the 'nextRecordId()' method in RecordEnumeration for Motorola phones and SEMC P800 on Sun's WTK is different. You use 'nextRecordId()' for Motorola phones while using 'previousRecordID()' on SEMC P800 with Sun's WTK. In the source files ImageAlbum.java and RMSOperations.java, the appropriate code is commented with 'for Motorola phone' or 'for SEMC phone' to indicate whether it is for use with the Motorola phones or SEMC emulators. ~~~~~ NOTES ~~~~~ To run the J2ME MIDlet on Emulator 7.2 of Motorola J2ME SDK 2.0 using CodeWarrior Wireless Studio, add the following variable to the Environment Settings item of the Runtime Settings panel. Variable: J2ME_RESOURCE_DIR Value: path pointing to the resources folder in the project that holds the PNG files. Main Class name is ImageAlbum (Already set in the Java Target Settings panel by CodeWarrior Wireless Studio). Output jar file name is ImageAlbum.jar (Already set in the Java Output Settings Panel by CodeWarrior Wireless Studio).

近期下载者

相关文件


收藏者