Java Micro Edition Platform & Android - Seminar on Small and Mobile Devices

Post on 28-Jan-2015

104 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

 

Transcript

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 1

Java Micro Edition Platform& 

Android

Seminar on Small and Mobile DevicesMay 13th, 2008

Dejan Juric (djuric@student.ethz.ch)

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 2

Outline

● Motivation & Goal● Java Micro Edition Platform● Android● Java ME vs Android● Conclusion & Discussion

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 3

Motivation

● Number of mobile phone subscribers by November 2007: 3.3 billion. (personal computers: 1 billion)

● Problems with mobile devices:– Heterogeneous: different form factors, features, 

functions– Resource­constrained

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 4

Goal

● Allow customization of devices– Download new services and applications from the 

Internet

● Development of applications and services– Device­independent– Cost efficient

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 5

Java Micro Edition Platform

● Available on most current mobile phones● Subset of the Java Platform 

– for resource­constrained devices

Java SE

Java ME

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 6

Java Platforms

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 7

Java Micro Edition ­ Overview

Configurations

Profiles

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 8

Java ME ­ Configurations

● Configuration: complete Java runtime environment– Defines the minimum 

set of Java virtual machine features & class libraries

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 9

Java ME – Configurations ­ CDC

● Connected Device Configuration– 32bit CPU, 2MB of 

RAM, 2 MB of ROM– Modified Java SE core 

class libraries– CDC 1.1 matches JDK 

1.4 APIs

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 10

Java ME – Configurations ­ CLDC

● Connected Limited Device Configuration– At least 160 kB of 

non­volatile memory– At least 32 kB of 

volatile memory– Minimal host 

operating system or kernel available 

CLDC 1.1java.lang

+java.lang.refjava.iojava.util

javax.microedition.io

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 11

Java ME – CLDC

● Eliminated features– User­defined class loaders– Thread groups and daemon threads– Finalization of class instances– Asynchronous exceptions– Floating point types (since CLDC 1.1)

● Class file verification– Off­device preverification and runtime verification

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 12

Java ME ­ Profiles

● Define a minimum set of APIs available on a “family” of devices

● Applications are written for a particular profile– Portable across 

devices that support that profile

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 13

Java ME ­ MIDP

● Mobile Information Device Profile– Screen of at least 96x54 pixels– Keypad, keyboard or touchscreen input– 256 KB of nonvolatile memory – 128 KB of RAM– 8 KB of nonvolatile writable memory for persistent 

data– Two­way network connection

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 14

Java ME ­ MIDP

CLDC 1.1 MIDP 2.0java.lang javax.microedition.lcdui

+java.lang.ref +javax.microedition.lcdui.gamejava.io +javax.microedition.mediajava.util +javax.microedition.media.control

javax.microedition.io javax.microedition.midlet+javax.microedition.pkijavax.microedition.rms

● Mobile Information Device Profile – Building Blocks

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 15

Java ME – Development Process

Java Source

Java Class Files

Preverified Class Files

Preverification

JAR Package

Packaging

Application on Device

Deployment

Compile

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 16

Java ME – Development Tools

● Wireless toolkits:– Sun Wireless Toolkits– Motorola SDK for J2ME™– Sony Ericsson J2ME SDK

● Development Environments– EclipseME– Netbeans Mobility

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 17

Java ME – MIDlet Demo

// Exceptions omitted for claritypublic class TestMIDlet extends MIDlet implements CommandListener {

private Form mMainForm;public TestMIDlet() {

mMainForm = new Form("TestMIDlet");mMainForm.append(new StringItem(null, "Hello, MIDP!"));mMainForm.addCommand(new Command("Exit", Command.EXIT, 0));mMainForm.setCommandListener(this);

}protected void destroyApp(boolean arg0)  {}protected void pauseApp() {}protected void startApp() {

Display.getDisplay(this).setCurrent(mMainForm);}public void commandAction(Command arg0, Displayable arg1) {

notifyDestroyed();}

}

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 18

Java Micro Edition

● Questions?

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 19

Android

● Software platform and operating system for mobile devices based on the Linux operating system

● Developed by Google and the Open Handset Alliance

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 20

Android ­ Open Handset Alliance

● Vision: “... accelerate innovation in mobile and offer consumers a richer, less expensive, and better mobile experience.”

● Members (more than 30):– Google, HTC, NTT DoCoMo, China Mobile, T­

Mobile, Motorola, Samsung, Intel ...– Swiss members: Esmertec, Noser

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 21

Android ­ Architecture

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 22

Android ­ Runtime

● Dalvik: It's not a Java virtual machine● Every Android application runs in its own 

process within its own instance of the Dalvik VM.

Java Source Java Class Files

Dalvik ExecutableFiles (.dex)

javac

dx

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 23

Android – Application Framework

● Views: User Interface● Content Providers: Access & share data● Resource Manager: non­code resources 

(graphics, external strings ...)● Notification Manager: custom alerts in status 

bar● Activity Manager: Manages life cycle of 

applications

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 24

Android – Activity & Intent

● Activity: single, focused thing that the user can do

● Intent: abstract description of an operation to be performed

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 25

Android – Life cycle ­ Activity

● Activity can be killed! ● We have to store the 

state

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 26

Android ­ Development

● Software Development Kit:– Eclipse Plugin– Command line tools

● Dalvik Debug Monitor Service (ddms)● Android Debug Bridge (adb)● Android Asset Packaging Tool (aapt)● Android Interface Description Language (aidl)

– Emulator

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 27

Android ­ Demo

● Demonstration with SDK and emulator

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 28

JavaME vs Android – Developer's Perspective

● Java ME

+ Security model

+ Works on many devices

­ On mobile phones: Integration into system not seamless

­ Too many APIs

● Android

+ Security model

+ Optimized for smartphones

+ Seamless integration into system

­ API: more complicated than Java ME

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 29

Java ME vs. Android ­ General

● Java ME

+ Lots of devices already available

­ Fully controlled by Sun (Licensing!)

­ Formal specification process (slow)

● Android

+ Opensource

+ Defines unique software stack for mobile devices

­ No devices available

­ No standards are used (e.g. VM, IDL ...)

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 30

Conclusions

● Rapid growth in the mobile market expected● Wireless devices getting more powerful

– More features– Better connectivity

● Both technologies could play a big role in the future

May 13th, 2008 Seminar on Small and Mobile DevicesDejan Juric (djuric@student.ethz.ch) 31

Discussion

● Questions?

top related