Developing Mobile Applications

Similar documents
DAY 3 J2ME Aalborg University, Mobile Device Group. Mobile. Mobile Phone Programming

DAY 3 J2ME March 2007 Aalborg University, Mobile Device Group Mobile Phone Programming

Mobile Application Development. Introduction. Dr. Christelle Scharff Pace University, USA

Who am I? Wireless Online Game Development for Mobile Device. What games can you make after this course? Are you take the right course?

Building a Java ME Test Suite in 15 Minutes

Minne menet, Mobiili-Java?

Software Development & Education Center. Java Platform, Micro Edition. (Mobile Java)

phoneme: High-performance, product-quality GPLv2 CDC + CLDC stacks Terrence Barr

Mobile Information Device Profile (MIDP) Alessandro Cogliati. Helsinki University of Technology Telecommunications Software and Multimedia Laboratory

Mensch-Maschine-Interaktion 2

Series 40 6th Edition SDK, Feature Pack 1 Installation Guide

Project Overview. Readings and References. Initial project motivation. Opportunity. References. CSE 403, Winter 2003 Software Engineering

JAVA. Java Micro Edition

JSR 248: Taking Java Platform, Micro Edition (Java ME) to the Next Level

JUGAT meeting. Roman Waitz Development. MATERNA Information & Communications

One day Crash Course in Java ME Development. by Michael Sharon, Co-founder/CTO, Socialight

PTViewerME: Immersive Panoramas for PDA and Smartphone

Project Overview. CSE 403, Spring 2003 Software Engineering.

Project Overview. Readings and References. Opportunity. Initial project motivation. References. CSE 403, Spring 2003 Software Engineering

Developing mobile UI

J2ME crash course. Harald Holone

MMAPI (Mobile Media API) Multimedia Framework for Mobile Devices

Java ME Developer Guide for MOTOMAGX 1.0. Developer Guide

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

NOKIA 12 GSM MODULE JAVA TM IMLET PROGRAMMING GUIDE. Copyright Nokia. All rights reserved. Issue

Petr Suchomel Architect, NetBeans Mobility

Portability and Design Issues in Developing a Mobile Phone Quiz Application Quiz Pro 2006

CM0256 Pervasive Computing

J2ME ARCHITECTURE AND RELATED EMBEDDED TECHNOLOGIES

CHAMELEON Project. Developer Guide. - Mobile Client - Server - UDDIe Registry. CHAMELEON Client and Server side

Praktikum Mobile Productivity

Java 2 Platform, Micro Edition

GeoVTag: a User s Guide

BVRIT HYDERABAD College of Engineering for Women Department of Information Technology. Hand Out

Learning objectives. The Java Environment. Java timeline (cont d) Java timeline. Understand the basic features of Java

Java Card 3 Platform. Peter Allenbach Sun Microsystems, Inc.

PASS4TEST. IT Certification Guaranteed, The Easy Way! We offer free update service for one year

JavaME TAMZ. Department of Computer Science VŠB-Technical University of Ostrava

Portable Resource Control in Java The J-SEAL2 Approach

ST.MARTIN'S ENGINEERING COLLEGE Dhulapally,Secunderabad-014

Requirements and Issues of V**s for Mobile Terminals

LAB-6340: Advanced Java ME Programming - Streaming Video From Server to Your Device

TAMZ. JavaME. MIDlets. Department of Computer Science VŠB-Technical University of Ostrava

SUN. Sun Certified Mobile Application Developer for the Java 2 Platform, Micro Edition, Version 1.0

Exam : : Sun Certified Mobile Application Developer for J2ME. v1.0. Title. Version : DEMO

Accessing DB2 Everyplace using J2ME devices, part 1

Developing Games for J2ME Technology- Enabled Mobile Devices

Mobile Application Design and Development With the use of J2ME Technology & UML m.khlaif Computer Science Dept Garyounis University

Wireless Services in Faculty Information System

MOTOROKR E6/E6e Java ME Developer Guide. Version 02.00

Android Internals and the Dalvik VM!

Bluetooth Scatternet Application. Sun Code for Freedom

Mobile Station Execution Environment (MExE( MExE) Developing web applications for PDAs and Cellphones. WAP (Wireless Application Protocol)

Sortware Comprehension and Μaintenance

BUILDING DISTRIBUTED HETEROGENEOUS SMART PHONE JAVA APPLICATIONS AN EVALUATION FROM A DEVELOPMENT PERSPECTIVE

All about the new SCMAD Certification Exam

20.1 Tips for Lab Ex. 6

Copyright 2004 by Vincent Claes, Heusden-Zolder, Belgium

J2ME OGC WMS Client user manual

JSR 248 Mobile Service Architecture Change Log

Introduction to Java. Lecture 1 COP 3252 Summer May 16, 2017

Chapter 13 Add Multimedia to Your MIDlets

Introduction to Java

Wireless Java Technology

Mobile application development J2ME U N I T I

Technical Manual. Motorola C381p Handset J2ME Developer Guide. Version 01.00

مريم سعد جعفر رانيا عبد السجاد علي سامي سمادير عبد العباس ياسمين عبد االمير

Deploying Java Platform, Standard Edition (Java SE Platform) in Today s Embedded Devices

Translation Server for a Mobile Phone. Clare Scully B.A. (Mod.) CSLL Final Year Project, May 2005 Supervisor: Dr. Carl Vogel

Vipera OTA Provisioning Server

How to Build, Run, and Develop Code With the phoneme Open Source Project Stuart Marks Hinkmond Wong Sun Microsystems, Inc.

Reach the Next Billion with Engaging Apps: Full Developers

SCADA systems development on mobile device platform Java Client/Server model and localization enhancement

Series 40 5th Edition SDK. User s Guide

CHAPTER 1. Introduction to JAVA Programming

Graphics API for J2ME (JSR 184). The Sun J2ME Wireless Toolkit supports the development of Java applications that run on devices such as cellular

Debugging Tools for MIDP Java Devices

Acknowledgments Introduction p. 1 The Wireless Internet Revolution p. 1 Why Java Technology for Wireless Devices? p. 2 A Bit of History p.

Java: framework overview and in-the-small features

3 Software Stacks for IoT Solutions. Ian Skerrett Eclipse

Wireless service developing for ubiquitous computing environments using J2ME technologies

Portable Resource Control in Java: Application to Mobile Agent Security

Application Development using J2ME Architecture for Device Independence

Standards,Tools, & Best Practices Editor: Sumi Helal University of Florida

Lab Exercise 4. Please follow the instruction in Workshop Note 4 to complete this exercise.

Wireless Internet Platform for Interoperability (WIPI(

BlueSense Final Report

Whiz-Bang Graphics and Media Performance for Java Platform, Micro Edition (JavaME)

Mobile Messaging Using Bangla

History Introduction to Java Characteristics of Java Data types

Application Development Using J2ME. Evaluation of Intrinsic Platform Limitations

THE SHORT MESSAGE MANAGEMENT SYSTEM BASED ON J2ME

Advanced Object-Oriented Programming Introduction to OOP and Java

TAMZ. Department of Computer Science VŠB-Technical University of Ostrava

Actual4Test. Actual4test - actual test exam dumps-pass for IT exams

Java Smart Ticket Demo Application Scrutinized

IBM Workplace Client Technology, Micro Edition V5.7 delivers tools and run-times for server-managed client devices

Overview of Java 2 Platform, Micro Edition (J2ME )

User Manual. Contents. Conrad Koppitz August 18, I Client 1. II Server 5. 1 Requirements 2

ACCELERATING 2D GRAPHIC APPLICATIONS WITH LOW ENERGY OVERHEAD

Transcription:

Developing Mobile Applications J2ME Java 2 Micro Edition 1

Virtual machines portable apps virtual machine native apps operating system hardware 2

Java - important issues Symbolic language not a random access memory dynamic memory allocation garbage collection implemented using a virtual machine portability sand box Multi threaded, concurrent processes Large library! 3

Java sources Java Community Process www.jcp.org JSR, java specification request reference implementations Sun java.sun.com SDK, tools, community Your favorite phone manufacturer SDK, tools, community, device emulators 4

Compiling and emulating (J2SE) foo.java public class foo { int i; i = 5; i = i + 2; } foo.class : : iconst_5 istore_1 iload_1 bipush 2 iadd istore_1 return verify read eval 5

pros and cons Pros Simpler: it's simpler to build a compiler and emulator than to build a native code compiler. Portability; porting an emulator is simpler than porting a native code compiler. Cons slower since wee need to do a read-eval-loop limited access to OS and hardware 6

Flavors of Java 2 J2SE - standard edition the most used on laptops and desktops JSEE enterprise edition additional support for running large servers J2ME micro edition mobile devices set top boxes embedded systems 7

J2ME specification a configuration defines the minimum required complement of Java technology components and libraries for small connected devices, Java language and virtual machine features, core libraries, security, input/output, and networking no optional libraries a profile defines additional libraries and features for a particular vertical market, device category or industry optional libraries 8

J2ME The J2ME version that we are most interested in is the one for mobile phones. CLDC Connected Limited Device Configuration minimum 128Kbyte available CDC (Connected device configuration) is a larger configuration for more powerful terminals. Some mobile phones now support CDC. MIDP Mobile Information Device Profile 9

CLDC - Connected Limited Device Configuration CLDC 1.0 defined in May 2000, JSR 30 basic java.lang subset of java.lang/util/io/.. CLDC 1.1 defined in Dec 2002, JSR 139 adds support for float in java.lang java.util.calendar/date/timezone/... bug fixes and more 10

MIDP - Mobile Information Device Profile MIDP 1.0 - defined in Dec 2000, JSR 37 java.microedition.midlet java.microedition.rms java.microedition.lcdui java.microedition.io.httpconnection MIDP 2.0 - defined in Nov 2002 JSR 118 java.microedition.io.socketconnection java.microedition.media java.microedition.lcdui.game MIDP 3.0 in pipe-line Q3 2006 11

MIDP 1.0/2.0/3.0 The numbers does not mean that MIDP evolves and that older versions become obsolete. New devices can still be MIDP 1.0 devices because of limited resources. MIDP 2.0 does not imply CLDC 1.1! 12

Phones on the market older J2ME phones: CLDC 1.0/MIDP 1.0 most J2ME phones released since Q2 2004: CLDC 1.1/ MIDP 2.0 some phones also support additional libraries 13

Optional libraries JSR 82 Bluetooth connect to BT devices JSR 120 Wireless Messaging API sending and receiving SMS messages JSR 135 Mobile Media API high-level interface to sound and multimedia capabilities JSR 184 Mobile 3D Graphics interactive 3D graphics 14

Even more... JSR 177 Security and Trust Services API JSR 179 Java Location API JSR 180 Session Initiation Protocol (SIP) JSR 205 Wireless Messaging API (WMA) 2.0 JSR 226 Scalable 2D Vector Graphics API 15

MIDP 3.0 Let Java applications start and run in the back ground Several applications in the same JRE. Let applications talk to each other. Rules for firewalls.... is the sandbox a sandbox? 16

SonyEricsson T610, T630 CLDC1.0/MIDP1.0 Color 128x160 pixel, up to 60KB jar, up to 256 KB heap F500 CLDC1.1/ MIDP 2.0 + MMAPI, WMA, 3D... color 128x160 pixel, 1.5MB heap Z1010, K700, CLDC1.1/ MIDP 2.0 + MMAPI, WMA, 3D... 176 x 220 pixels, 1.5MB heap P910i: CLDC1.1/CDC1.0/MIDP2.0 color 208x320 pixels, X MB jar,... 17

Nokia Series 30 CLDC1.0/MIDP1.0 monochrome/color, 95x65 pixel, 32/64KB jar Series 40 CLDC1.0/MIDP1.0 or CLDC1.1/MIDP2.0 Color 128x128 pixel, >64KB jar, up to 200KB heap Series 60 CLDC1.1/MIDP2.0 + more Color 176x208 pixel, up to 4MB jar, up to 1MB heap Series 80 and Series 90 CLDC1.1/MIDP2.0 + more 18

How do we find out? <prf:javaenabled>yes</prf:javaenabled> <prf:javaplatform> <rdf:bag> <rdf:li>cldc</rdf:li> <rdf:li>midp</rdf:li> <rdf:li>profile/midp-2.0</rdf:li> <rdf:li>configuration/cldc-1.1</rdf:li> </rdf:bag> </prf:javaplatform> <prf:javapackage> <rdf:bag> <rdf:li>jsr-75</rdf:li> <rdf:li>jsr-234</rdf:li> : <rdf:li>vscl-2.1</rdf:li> </rdf:bag> </prf:javapackage> 19

Developing Mobile Applications J2ME : Midlets and program development 20

What you need a good editor (why not emacs) development tools from java.sun.com Java 2 Platform SDK 1.4 the J2ME Wireless Toolkit (1.x or 2.x) from your local phone manufacturer an emulator for your phone a complete SDK IDE, debugger tools,... 21

Pre-verifying foo.java public class foo { int i; i = 5; i = i + 2; } read eval foo.class : : iconst_5 istore_1 iload_1 bipush 2 iadd istore_1 return foo.class : : iconst_5 istore_1 iload_1 bipush 2 iadd istore_1 return pre-verify (opt. obfuscate) 22

environment WS P/HTTP device explorer emulator pre-verifier IrD A/B luetooth compiler java VM 23

Midlet Similar to a Applet An application that is controller by create the object startapp pauseapp destroyapp Interactive javax.microedition.lcdui.screen javax.microedition.lcdui.canvas 24

Life of a Midlet Start Call the constructor. Paused destroyapp() startapp() Shutdown pauseapp() Running destroyapp() 25

JAR Java Archive A JAR file contains one or more.class files and the images, sounds etc files that the midlet is using. MIDlets in a JAR file can share the same resources. This is one reason why you might want to include several midlets in one JAR. 26

RMS record management system RMS Foo 1: Hello 2: World Persistent storage App.jar Midlet A Midlet B RecordStore rs = RecordStore.openRecordStore("Foo",true); 27

JAR Manifest The JAR file also contains a manifest file (META-INF/MANIFEST.MF) that describes the content: MIDlet-Name: The Hello App MIDlet-Version: 1.0 MIDlet-Vendor: Your company MIDlet-1: Hello, img/hello.gif, demo.hello MicroEdition-Profile: MIP-1.0 MicroEdition-Configuration: CLDC-1.0 28

JAR Manifest The manifest can also contain user defined parameters that can be access from the midlet. This is useful for to keep constants separate form the Java code. The manifest information is accessible to all midlets in the JAR file. 29

Developing Mobile Applications J2ME: Provisioning 30

Over the air As with all larger files we would like to know what is about to be downloaded before we actually download it. A JAD Java application description file is very similar to a manifest file but is delivered in plain text and contains information about the jar-file. 31

JAD MIDlet-1: HelloWorld,, HelloWorld MIDlet-Name: HelloWorld MIDlet-Vendor: Your Company MIDlet-Version: 1.0 MIDlet-Jar-URL: http://www.compmy.com/helloworld.jar MIDlet-Jar-Size: 1801 MicroEdition-Profile: MIDP-1.0 MicroEdition-Configuration: CLDC-1.0 MIDlet-Description: HelloWorld Example 32

Deploy Place the.jar and.jad file on a web server. Patch the.jad file to point to the.jar file Have the.jad file referred to from a WML or XHTML file. When downloaded the user will be prompted. Download and execute. 33

JAD user defined parameters The JAD file can also contain user defined parameters. Can be access in the same way as manifest parameters. You can change JAD parameters with out repacking the JAR file. Could be useful for device specific information. JAD parameters override manifest parameters (unless the midlet is signed) 34

OTA MIDP 2.0 provisioning GE T JAD JAD GE T JAR JAR 35

JAD MIDlet-1: HelloWorld,, HelloWorld MIDlet-Name: HelloWorld MIDlet-Vendor: jm MIDlet-Version: 1.0 MIDlet-Jar-URL: http://www.compny.com/helloworld.jar MIDlet-Jar-Size: 1801 MicroEdition-Profile: MIDP-1.0 MicroEdition-Configuration: CLDC-1.0 MIDlet-Description: HelloWorld Example MIDlet-Install-Notify: http://www.company.com/installed.php 36

OTA MIDP 2.0 provisioning GE T JAD JAD GE T JAR JAR POS T 900 S ucess 37

Security (MIDP 2.0) MIDlets are divided into trusted and untrusted applications: untrusted applications can not (or only after user acceptance) access for example network resources etc. There are several domains, each with a set of rights: manufacturer operator third party MIDlets are digitally signed and can be verified by certificates for each domain. 38

Security (MIDP 2.0) The JAD and manifest file should contain the description of the rights that an application needs: MIDlet-Permissions: javax.microedition.io.connector.http MIDlet-Permissions-Opt: javax.microedition.io.connector.https Verifying signatures is done at installation, the MIDlet can still be executed even if the certificate has expired. 39

Native If the support is not there in the Java libraries you will have to do a native code implementation: SymbianOS Nokia Series 60/80 SonyEricsson P900 Microsoft Mobile Qtek, Palm Treo,... Qualcomm BREW Linux Mobile 40

Lab session 5 Write, compile, debug and deploy a small J2ME application (yes more than Hello World) 41