CSE403: MIDlets and Ant1 MIDlets and Ant April 3, 2003 Shane Cantrell Zach Crisman.

Slides:



Advertisements
Similar presentations
MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee.
Advertisements

Java 2D Training. Basic Tools Java SDK 1.4x Wireless Toolkit 2.x NetBeans IDE + mobility pack Global Code editor Text Comparer Tools Graphics Editor Sprite.
Department of Computer Science & Engineering
beas WEB App Installation
Using Eclipse. Getting Started There are three ways to create a Java project: 1:Select File > New > Project, 2 Select the arrow of the button in the upper.
The Web Warrior Guide to Web Design Technologies
ANT: Another Nice Tool Ali Beyad October 1, 2003.
ANT – Another Neat Tool Representation and Management of Data on the Internet.
ANT: Another Nice Tool Ali Beyad October 1, 2003.
Writing Your First MIDlet Running JAVA on a Cell Phone Jon A. Batcheller January 27, 2004.
Developing an Application with J2ME Technology Scott Palmer, Nat Panchee, Judy Sullivan, Karen Thabet, Sten Westgard.
1 Ant – Another Neat Tool Representation and Management of Data on the Internet.
CSC 395 – Software Engineering Lecture 24: Apache Ant –or– Programming the results of programming Based upon a talk by Anthony Wat.
Developing Software for Wireless Devices
The Internet. Telnet Telnet means using your computer as a terminal. All commands you type are sent to the host computer you are connected to and executed.
Developing J2ME Applications Mobile and Wireless Networks.
Chapter 3 - Introduction to Java Applets Outline 3.1Introduction 3.2Thinking About Objects 3.4A Simple Java Applet: Drawing a String 3.5Two More Simple.
Introduction to Ant David Rabinowitz. March 3rd, 2004 Object Oriented Design Course 2 Ant Yet another build tool? Why do we need one where there are make,
Chapter 13: Advanced GUIs and Graphics J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition.
Java 2 Platform, Micro Edition (J2ME) By Xiaorong Wang.
Detecting Changes  ItemStateListener interface – detect changes in internal state of an Item  new selection made in a ChoiceGroup  adjusted value of.
Introduction to Ant- a framework example Amit Shabtay.
J2ME and WAP Technologies CSCI – Independent Study Fall 2002 Presented by: Kashif Syed.
Using Ant to build J2EE Applications Kumar
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
J2ME Java for Mobile Environments Based on J2ME In A Nutshell, by Kim Topley, O’Reilly & Associates Inc., 2002, and Tetris by Alexei Patinov.
An Introduction to the Java ME Project Jens A Andersson.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 12 Using the KToolbar Rob Pooley
1 Creating Web Forms in HTML Web forms collect information from customers Web forms include different control elements including: –Input boxes –Selection.
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
© Keren Kalif Intro to Android Development Written by Keren Kalif, Edited by Liron Blecher Contains slides from Google I/O presentation.
Chapter 13 Advanced GUIs and Graphics. Chapter Objectives Learn about applets Explore the class Graphics Learn about the class Font Explore the class.
Getting Started with JXTA for J2ME Advisor : Dr. Ching-Long Yeh Report : DI.2, 洪泰昌 ( ) Course: XML 文件管理.
Using J2ME to create Field Force Applications Chris Clark, MobileHWY, LLC.
Apache Ant Java-Based Build Tool. Making your builds boring… Building projects should be easy and standardized. You should not be spending a substantial.
Mobile Applications and Java ME
Apache Ant A gateway to test-driven Java development.
Java Programming: From Problem Analysis to Program Design, 4e Chapter 12 Advanced GUIs and Graphics.
Ant Build Tools.  Creating a product from source may take several steps: Compile Link Copy files to various directories Remove intermediate files Generate.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 12 lcdui Rob Pooley
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 13 lcdui and OXO Rob Pooley
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 14 Various MIDlet examples Rob Pooley
July 2011CMSC 341 CVS/Ant 1 CMSC 341 Java Packages Ant CVS Project Submission.
8-January-2003cse ProjectOverview © 2003 University of Washington1 Project Overview CSE 403, Winter 2003 Software Engineering
Ant Presentation by: Bart Taylor. What is Ant? The simple definition: A Java-based build tool The Official Definition: “Apache Ant is a Java-based build.
Ant & Jar Ant – Java-based build tool Jar – pkzip archive, that contains metadata (a manifest file) that the JRE understands.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
Chapter 3 Understanding Ant datatypes and properties.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
Installing SPHINX by: COLLEGE OF ART & SCIENCE UNIVERSITI UTARA MALAYSIA STIW5023 ADVANCED PROGRAMMING.
File and Folder CLI Commands 12/24/ Agenda Overview of OS functions and the SHELL Internal v External Commands Command History Making & Modifying.
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
1 G52IWS: Example Web-services Chris Greenhalgh. 2 Contents Software requirements AXIS web service run-time components Getting started with Jetty & AXIS.
1 Introduction to J2ME Outline MIDP Building J2ME Apps- Tool J2ME Wireless Toolkit Demo MIDlet Programming -- MIDlet Transition States -- Midlet Skeleton.
Using Ant in Eclipse Dwight Deugo Nesa Matic
Software Development Tools COMP220 Seb Coope Ant: Datatypes and Properties These slides are mainly based on “Java Development with Ant” - E. Hatcher &
An Introduction to Ant. What is Ant? How do you use it? Why would you want to?
 It is a pure oops language and a high level language.  It was developed at sun microsystems by James Gosling.
Advance Computer Programming Market for Java ME The Java ME Platform – Java 2 Micro Edition (J2ME) combines a resource- constrained JVM and a set of Java.
Java N Amanquah.
CSE 403: Servlet Technology
NAnt Build Tool CSE784 : ProjectCentralNet Prof : Dr. Jim Fawcett
By Jeff Heaton An Overview of J2ME By Jeff Heaton
J2EE Application Development
Ant.
CSCI The UNIX System Shell Startup and Variables
Shane Cantrell Zach Crisman
Java for Mobile Devices
Shane Cantrell Zach Crisman
Advanced GUIs and Graphics
Presentation transcript:

CSE403: MIDlets and Ant1 MIDlets and Ant April 3, 2003 Shane Cantrell Zach Crisman

CSE403: MIDlets and Ant2 MIDlet: Skeleton import javax.microedition.midlet.*; public class MyMIDlet extends MIDlet { public MyMIDlet() {} // constructor public void startApp() {} // entering active state public void pauseApp() {} // entering paused state // entering destroyed state public void destroyApp(boolean unconditional) {} }

CSE403: MIDlets and Ant3 MIDlet: State Transitions Paused Active Destroyed startApp()pauseApp() destroyApp()

CSE403: MIDlets and Ant4 MIDlet: Resources Official J2ME WTK Page API reference file://C:/WTK104/doc/api/index.html

CSE403: MIDlets and Ant5 MIDlet: JAD file MIDlet-Name: Introductory Midlets MIDlet-1: Properties,,PView MIDlet-2: Accounts,,AccountViewer MIDlet-Vendor: Univ of Washington MIDlet-Version: 1.13 MIDlet-Jar-Size: MIDlet-Jar-URL: HW1.jar Image-1-name: Ant Image-1-location: /res/ant.gif

CSE403: MIDlets and Ant6 MIDlet: Getting Properties Class javax.microedition.midlet.MIDlet String getAppProperty(String key) property = getAppProperty(“Image-1-name”);

CSE403: MIDlets and Ant7 MIDlet: Displayable classes package javax.microedition.lcdui.* Class Screen abstract for classes Alert, Form, List, and TextBox, which allows use of basic GUI elements Class Canvas allows full control over painting and input handling

CSE403: MIDlets and Ant8 MIDlet: Using Displayable // from within a MIDlet class... // Get the display for this MIDlet Display display = Display.getDisplay(this); // Create the displayable object Displayable displayable = new MyDisplayableClass(); // Select the displayable object to show the user display.setCurrent(displayable);

CSE403: MIDlets and Ant9 MIDlet: Class Form useful functions int append(...) ChoiceGroup, DateField, Gauge, ImageItem, StringItem, TextField void setItemStateListener(ItemStateListener iListener)

CSE403: MIDlets and Ant10 MIDlet: Interface ItemStateListener key function to implement itemStateChanged(Item item) Class Item void setLabel(string label) String getLabel()

CSE403: MIDlets and Ant11 MIDlet: Class Canvas key functions to implement void paint(Graphics g) void keyPressed(int keyCode) other useful functions int getGameAction(int keyCode) Needed to use arrow buttons! int getWidth() int getHeight()

CSE403: MIDlets and Ant12 MIDlet: Internet Classes Class Connection DatagramConnection Datagram (Warning: A separate Datagram object is needed for both input and output!) = Connector.open(“datagram://somewhere.com:8000”) = Connector.open(“datagram://:8000”) StreamConnection oStream, iStream = Connector.open(“socket://somewhere.com:8000”) HttpConnection = Connector.open(“

CSE403: MIDlets and Ant13 MIDlet: Class RecordStore package javax.microedition.rms.* useful functions static void deleteRecordStore(...) static RecordStore openRecordStore(...) int getSize() int getSizeAvailable() int addRecord(...) int getRecord(...) RecordEnumeration enumerateRecords(...)

CSE403: MIDlets and Ant14 Design Points Limitations MIDlet JARs: ~64k or less awkward user input Good Design wait animations remember old inputs after error message (for example, remember the user name if the password was entered incorrectly)

CSE403: MIDlets and Ant15 Programming Guidelines Use local variables instead of fields. Local variables are faster than class members. Avoid unnecessary method calls. Avoid string concatenation; make use of StringBuffer instead. Reuse (recycle) objects whenever possible. Memory is limited and garbage collecting takes time. Use multi-threading to keep the MIDlet responsive.

CSE403: MIDlets and Ant16 Apache Ant xml based build tool using Java extended using Java classes Ant Is Not a Scripting Language!

CSE403: MIDlets and Ant17 Ant: Basic Example Build file description......

CSE403: MIDlets and Ant18 Ant: Properties File Example # This file defines properties for an Ant midlet builder. # The properties can be changed at run time by specifying # new values on the ant command line with the -D switch. # For example, -Demulator=DefaultColorPhone would request the # Default Color Phone instead of the Motorola i85s. # # $Id: build.properties,v /04/01 04:26:18 finson Exp $ # Location of the Wireless Toolkit installation. wtk.home = c:/wtk104 # Default emulator. Can be any valid device as listed # in the WTK104/wtklib/devices directory. emulator = Motorola_i85s

CSE403: MIDlets and Ant19 Ant: Properties The name of the property. Specified by “${src}” in this case. The directory value that it represents is relative to the basedir (unless the location is absolute). The value stays as “source”. Uses properties listed in the given file.

CSE403: MIDlets and Ant20 Ant: Targets

CSE403: MIDlets and Ant21 Ant: Filesets Collects the list of files matching the provided attributes and gives them the reference provided by ‘id’.

CSE403: MIDlets and Ant22 Ant: Pathconverts makes a list of the files separated by spaces (Warning: If any of the paths have spaces, this will cause problems!) refid = fileset id property = destination id pathsep = separation string

CSE403: MIDlets and Ant23 Ant: Executing Shell Programs runs collector.exe from ${basedir} with the arguments providedmakes a list of the files separated by spaces

CSE403: MIDlets and Ant24 Ant: Taskdefs allows you to refer to the plugin class WtkJad as wtkjad in your Ant build file inherit task classes from org.apache.tools.ant.Task file://C:/jakarta-ant-1.5.1/docs/manual/api/index.html

CSE403: MIDlets and Ant25 Other Tasks javac copy, delete, move, mkdir zip, unzip, jar, war It is possible to extract specific files from a zip file using a patternset. mail for SMTP (must not require a password) waitfor echo

CSE403: MIDlets and Ant26 Ant from the prompt ant –buildfile build403.xml clean a build file of build.xml is default ant run filetarget

CSE403: MIDlets and Ant27 Unix Setup Ant Path /usr/local/ant/bin Wireless Toolkit Path /usr/local/wtk-1.0.4

CSE403: MIDlets and Ant28 Environment Variables ANT_HOME = c:\jakarta-ant JAVA_HOME = c:\j2sdk1.4.1_01 Path = %PATH%;%ANT_HOME%\bin;c:\wtk104\bin;%JAVA_HOME%\bin Comments: Remember to avoid spaces in your target directory and file names! If your MIDlet does not run by selecting the JAD file, then it does not count as release worthy. (For example, running your MIDlet through the KToolbar does not count as complete.)

CSE403: MIDlets and Ant29 Homework Comments You are adding the “dist” target to the provided build.xml file. The directory structure, ${dist.dir}, and other variables are defined in build.xml. Don’t forget to refer to the Ant web site (or Ant installation docs) for more task information and examples. Don’t forget to send questions to either the list or all three of us.

CSE403: MIDlets and Ant30 MIDlets Free MIDlet programs Cannons:ME (multiplayer game)