+ All Categories
Home > Documents > J2ME Technology J2ME Home Monitoring. The Java™ 2 Platform.

J2ME Technology J2ME Home Monitoring. The Java™ 2 Platform.

Date post: 25-Dec-2015
Category:
Upload: darrell-short
View: 235 times
Download: 1 times
Share this document with a friend
Popular Tags:
18
J2ME Technology J2ME Home Monitoring
Transcript

J2ME TechnologyJ2ME Technology

J2ME Home MonitoringJ2ME 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)– 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

SMART Wireless

PortalInfrastructure

MobileCommunication

Services

MobileInformation

Services

MobileEntertainment

Services

MobileEnterpriseServices

MobileCommerceServices

NewsStock Updates

Weather forecastDirectories

Location-based services

MusicGamesVideo

Streaming

ProductivityCollaborationWork-Force Automation

AuctionsBanking and TradingTravel Reservations

EmailCRM

Instant Messaging

J2ME User Initiated ProvisioningAdvertiseApp on

Web Page

UserSelects

App

Descriptor File

NameVersion

SizeApp URL

...

Descriptor File

NameVersion

SizeApp URL

...

Java ApplicationJar file

“Breakout”game

Java ApplicationJar file

“Breakout”game

HTTP Network Transfer

OTA

HandsetDownloadsApplication

HandsetDownloads

Descriptor File

OTA

Java Service Vending Machine

J2ME CDC

J2ME CLDC

J2SE

Major J2ME Adoption

Handset ManufacturersHandset ManufacturersWireless OperatorsWireless Operators

Major Industry Interest

Java Service Vending Machine Industry PlayersJava Service Vending Machine Industry Players

Iplanet

Ellipsus

Openwave

ATG

BEA

Mobilitec

4thpass

J2ME Home MonitoringWhat 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 IBM-compatible personal computer with an attached PC Camera.JDK1.3.1(base tools needed to develop Java applets and applications)

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

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:

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 theForm and display obkect to VideoTimer Class

 

J2ME Home MonitoringSoftware 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

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/


Recommended