180 likes | 263 Views
J2ME Technology. J2ME Home Monitoring. The Java™ 2 Platform. Learn Once… Write Anywhere Dynamic provisioning of new applications Enhanced User experience Dynamic, graphical content Fast interaction (local operation) Disconnected operation (convenience, cost-effective)
E N D
J2ME Technology J2ME Home Monitoring
Learn Once… Write Anywhere Dynamic provisioning of new applications Enhanced User experience Dynamic, graphical content Fast interaction (local operation) Disconnected operation (convenience, cost-effective) Intelligent network bandwidth usage Leverage 2.5 million Java developers Availability of development tools Large selection of available tools Java Technology Benefits
Java Enabled Content for Wireless Mobile Information Services Mobile Communication Services News Stock Updates Weather forecast Directories Location-based services Email CRM Instant Messaging SMART Wireless Portal Infrastructure Mobile Commerce Services Mobile Entertainment Services Music Games Video Streaming Auctions Banking and Trading Travel Reservations Mobile Enterprise Services Productivity Collaboration Work-Force Automation
Advertise App on Web Page 2 Descriptor File Name Version Size App URL ... HandsetDownloads Descriptor File User Selects App 1 3 HandsetDownloads Application OTA OTA Java Application Jar file “Breakout”game HTTP Network Transfer J2ME User Initiated Provisioning
Java Services Java Service Vending Machine J2ME CLDC J2ME CDC J2SE
Major J2ME Adoption Handset Manufacturers Wireless Operators
Major Industry Interest Java Service Vending Machine Industry Players Mobilitec Iplanet ATG BEA Openwave Ellipsus 4thpass
What is J2ME Home Monitoring: It is a Java Application for your remote visual monitoring needs. You can monitor your office, warehouse, yard and other places while you are on-the-go. The software package allows you to easily view up-to-the-minute images of the places or things you wish to monitor, right on your mobile device. David Fox won the Motorola-Nextel Developer Challenge at JavaOne by whipping up a program that lets you control lights and appliances at home via cell phone, and stream webcam images to its tiny screen. And, he did it in six hours, and drove away in a BMW Z3 for his efforts. The contest was simple enough -- write an application, any application, for the new Motorola i85s cell phone. From design to prototype to build to deploy, in six hours or less. J2ME Home Monitoring
Hardware and Software Requirements 1. IBM-compatible personal computer with an attached PC Camera. 2. JDK1.3.1(base tools needed to develop Java applets and applications) 3. J2ME emulator for developing and testing the MIDlet ( a set of tools that provides developers with the emulation environment, documentation and examples needed to develop CLDC/MIDP compliant applications, Microsoft Windows 98 Second Edition, Microsoft Windows NT or Microsoft Windows 2000. ) 4. PNG Image converter 5. A web server or a web space for your home page J2ME Home Monitoring
A use case of J2ME Home Monitor 1. The PC Camera can be set to take a picture each 10 seconds. 2. The picture will be placed in a certain directory. 3. The PNG Converter will pick the image from a certain directory and convert it from jpg to png format. 4. The batch file will pick the png image and ftp it to a certain directory on your web server. 5. The Java 2 application allows you to “pull” down the last image uploaded to your website and view it on your mobile device. J2ME Home Monitoring
Batch script :start C:\PROGRA~1\2png\2png.exe s="C:\delete\Source\*.*" d="c:\delete\destination" -q75 -w200 -h100 -prop c:\WINNT\system32\ftp -s:ftp.TXT @echo off echo Starting! echo Wscript.Sleep 10000> sleep.vbs start /w wscript.exe sleep.vbs echo Done! del sleep.vbs @echo off goto :start d at: Description: Pic2Pic Pro is easy to use and powerful utility for batch conversion of image files using scripts. Description: J2ME Home Monitoring
ftp script open 10.213.51.154 userID Password # directory of destination cd /app cd weblogic cd nunivak cd wlserver6.1 cd config cd eghosh01domain cd applications binary hash #directory of source lcd c:\delete\source put Sample.png bye d at: Description: Pic2Pic Pro is easy to use and powerful utility for batch conversion of image files using scripts. Description: J2ME Home Monitoring
Testing your application Ihttp://people.ku.edu/~eghosh01/monitor.png J2ME application: Consists of two classes VideoTimer ClassJ MIDlet ClassJ VideoTimer, which calles a nextImage() method every couple of seconds: nextImage httpconnection.openDataInputStream() datainputstream.readFully(abyte0) createImage() J2J powerful utility for batch conversion of image files using scripts. Description:
class VideoTimer extends TimerTask { VideoTimer() { } public void run() { try { nextImage(); frm.append(image); disp.setCurrent(frm); } catch (Exception ex) { System.out.println("Exception " + ex); } } } MIDlet Class: The timer is triggered like this: timer = new Timer(); vt = new VideoTimer(); timer.schedule(vt,(long)10,10); It also needs to pass the Form and display obkect to VideoTimer Class
1. JavaTM 2 SDK, Standard Edition Version 1.3.1_02 http://java.sun.com/j2se/1.3/download-windows.html Description: 2. JavaTM 2 Platform Micro Edition, Wireless Toolkit 1.0.3 http://java.sun.com/products/j2mewtoolkit/download.html 3. Pic2PicPro http://www.wavelsoftware.com/pc2pcpro.htm J2ME Home MonitoringSoftware
References • Wireless Java with J2ME in 21 days • Wireless programming with Java 2 Micro Edition • http://www-106.ibm.com/developerworks/ • http://java.sun.com/j2me/