Index of /PPerso/membres/donsez/cours/exemplesj2me/crypto

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory   -  
[DIR]bin/ 2014-01-09 10:08 -  
[TXT]build.xml 2014-01-09 10:08 759  
[TXT]buildmidlets.xml 2014-01-09 10:08 6.5K 
[TXT]buildtask.xml 2014-01-09 10:08 774  
[   ]configenv.bat 2014-01-09 10:08 417  
[DIR]src/ 2014-01-09 10:08 -  

Programming Wireless Devices Sample Programs

Programming Wireless Devices Samples

The Addison-Wesley book Programming Wireless Devices with the Java 2 Platform, Micro Edition™ (J2ME™) is the definitive Java™ Series guide that provides a programmer's introduction to the Java 2 Platform, Micro Edition. It presents a general description of wireless technology, an overview of the J2ME™ platform, and information on the small-footprint K Virtual Machine. In addition, the book details the Connected Limited Device Configuration (CLDC) and the Mobile Information Device Profile (MIDP), the standards which define the Java platform features and libraries for wireless, resource-constrained devices. The source code for the sample MIDlets and matching Servlets™ is included with directions for building and packaging the MIDlets for use with any of the existing MIDP devices and integrated development environments. Additional information and sample chapters from the book are available from the Sun Developer Connection.

You Will Need

Programming Wireless Devices Sample Code

The examples are:

Building the Samples

The examples can be built and packaged using any of a number of tools that aid in the compiling and packaging of MIDP applications.

The examples are distributed in a zip file which must be unzipped into a working directory. Any of the usual zip and decompression tools can be used including unzip, winzip, etc.

The build file supplied uses Ant. Ant is a freely available build tool based on the Java™ programming language. It is developed and supported by the Jakarta project at the Apache Software Foundation. Ant will need to be installed before the supplied build file can be used.

The Ant build file, <examples>/build.xml, compiles the source files for each MIDlet and places JARs and MIDP application descriptors in the <examples>/lib directory. It also compiles the server components directly into the <tomcat>/webapps directory so they are ready to use.

The build file relies on having the class library for MIDP and the class library for servlets being available. It assumes the following definitions which may need to be overridden before use. For example:

    ant -DJ2MEWTK.HOME=d:\j2mewtk -DTOMCAT.HOME=d:\tomcat-3.2.1 all

The build tasks supplied are:

Most of the detailed build rules are contained in the build file <examples>/buildmidlets.xml. An additional Ant task is defined to correctly create the application descriptors using <examples>/buildtask.xml.

TOMCAT Server Setup

The Jakarta Tomcat server is used to run the Java Servlets that demonstrate the communication between the MIDP client applications and standard web services.

Jakarta Tomcat is the official Reference Implementation for the Java Servlet and JavaServer Pages technologies. The Java™ Servlet and JavaServer Pages™ specifications are developed by Sun under the Java Community Process.

The netclient example program shows how to write a client that uses basic authentication to login to a server. To demonstrate that the client works correctly the web server must be configured for a user named "book" with password "bkpasswd". Alternatively, the NetClient ConnectionManager can be modified to use whatever username and password are appropriate. If the role is changed then the <examples>/web.xml file must be modified.

For example in the Tomcat server the <tomcat>/conf/tomcat-users.xml file should be modified to include the following extra line:

    user name="book"   password="bkpasswd" roles="book"

J2ME™ Wireless Toolkit

The Java™ 2 Platform Micro Edition (J2ME™) Wireless Toolkit is a set of tools that provides Java developers with the emulation environment, documentation and examples needed to develop MIDP compliant applications targeted at mobile information devices such as cellular phones and two way pagers.