Wireless Technologies for Mobile Phones 大同大學 資訊工程系 副教授 鄭福炯(cheng@cse.ttu.edu.tw) 1 Contents Wireless Services and Mobile applications Wireless solution: WAP, Native code or Java? Standards: – 2 Mobile Execution Environment (MExE (mexy)) J2ME for mobile phones/PDAs: CLDC + MIDP Demo: J2ME Sample programs Wireless Internet Usage in USA Millions Of Users 3 Source: industry standard Wireless Services: The Good News 4 The value of mobile commerce transactions in Western Europe will top US$37 billion in 2004. (IDC) 40 percent of e-commerce transactions outside the US will be done via portable, cellular-enabled devices. (Gartner Group)$ Companies will increase the number of workers allowed remote connectivity by roughly 30 percent, spending approximately $10,000 per mobile user.” (Informetrics Research) Wireless Services: The Good News 5 By 2004, mobile professionals will make up 34% of the U.S. mobile and remote population, followed by work extenders (31%), telecommuters (21%), and mobile data collectors (14%). (IDC) The cellular phone service market in Asia/Pacific swelled to 170.7 million subscribers in the first quarter of 2000, a 47 percent increase over the same period last year.” (Dataquest Inc., a unit of Gartner Group, Inc.) Wireless Services: The Good News 6 About one billion people will use wireless data services by 2005.(ARC Group) By 2003, 1 billion mobile devices will be in use. (Gartner Group) Businesses worldwide will have 47 million mobile and remote workers worldwide by 2002. (IDC) The enterprise WLAN market will expand at a 25% compound annual growth rate from 2000 to 2004, reaching $2.2 billion in worldwide sales. (Cahners InStat Group) Wireless Services: The Good News 7 Enterprises will spend more than $400 million by 2001 to enable their existing infrastructure for wireless access. (Aberdeen Group) The wireless market for e-services could represent over $30 billion by 2003. (IBM) Service Age: Anyone Anywhere Anytime Anything Small Office Email Voice Financial Telephony Entertainment Services Corporate Center Mobile A Web of Intelligent Devices LAPTOP AUTO CAMERA ROBOT NETWORK Webpad PRINTER/Fax TV/Set-top box KITCHEN APPLIANCES PDAs TELEPHONE Mobile Wireless Services Banking & Broking Shopping & Auctions Advertising Travel Services Location-based services Mobile Commerce service 10 Mobile Information service Service creation, Delivery & management infrastructure Mobile Communication service Mobile Enterprise service Mobile Entertainment service Mobile Wireless Services News services Stocks information Weather information Traffic information Directory services Mobile Commerce service 11 Mobile Information service Service creation, Delivery & management infrastructure Mobile Communication service Mobile Enterprise service Mobile Entertainment service Mobile Wireless Services PIM Collaboration CRM ERP Mobile Commerce service 12 Mobile Information service Service creation, Delivery & management infrastructure Mobile Communication service Mobile Enterprise service Mobile Entertainment service Mobile Wireless Services Music Games Multimedia Mobile Commerce service 13 Mobile Information service Service creation, Delivery & management infrastructure Mobile Communication service Mobile Enterprise service Mobile Entertainment service Mobile Wireless Services E-mail Short message service Chat Video-telephony Mobile Commerce service 14 Mobile Information service Service creation, Delivery & management infrastructure Mobile Communication service Mobile Enterprise service Mobile Entertainment service Service Delivery Platform Mobile Wireless Value Chain Mobile Application Venders Telecom Technology Equipment Platform Venders Venders Telecom Network Internet Content Providers 16 Mobile Carries Mobile Portal Providers Device Manufacturers Mobile Service Providers Wireless Infrastructure: Services 1G - Analog, 9600 baud, voice applications 2G - Digital, circuit-switched, PCS, 19.2k++, slow 2.5G - Digital, packet- switched, 19.2k- 384k, faster than 2G – 17 Ricochet has 200K already! 3G - Digital, 384k- 2Mbps, high-quality audio/video, expensive infrastructure, US (2003?), Europe (20012003?), Japan (2001?) 4G - Digital, software- controlled infrastructure (“software- defined radio”), 2010? Wireless Application Constraints 18 Small Display Different Input Devices Security Issues Connect Speed Varies Possible High Latency Connection Network Coverage Memory Constraints Battery Constraints Less Connection Stability Less Predictable Behavior Wireless Application: Advantages 19 Highly Mobile Localized Services Always Connected Reduced Cost Contents Wireless Services and Mobile applications Wireless solution: WAP, Native code or Java? Standards: – 20 Mobile Execution Environment (MExE (mexy)) J2ME for mobile phones/PDAs: CLDC + MIDP Demo: J2ME Sample programs Trends Eras of computing – – – Networking: – – 21 Mainframe era: one computer, many people PC era: one person, one computer Ubiquitous-computing era: one person, many computers An internet of computers A internet of things that embed computers Wireless Services Today WAP has been disappointing – “We realize now what we've known all along: Web sites can't be effectively crammed onto tiny WAP phone screens, no matter how much the sites are modified.” by John Dodge, eWeek. Growing hype around Java-enabled handsets – Success will only come by providing the consumer with a compelling “service” experience that leverages the capabilities of the mobile device, differentiating the wireless internet from the fixed internet – J2ME on the handset can help achieve this, but it requires innovation to leverage the capability 22 Wireless Services Today Japan: DoCoMo + I-mode (+ I-appli) – – USA: Nextel + Motorala – – – Java Platform (CLDC/Proprietary Profile) http://java.ez-i.co.kr/wire/index.asp Europe: Nokia 9210 and Ericsson R380 – 23 I85s i50sx Korea: LG Telecom™s EZ-Java – f503i handsets (Fujitsu) p503 (Panasonic) Java platform (CLDC/Proprietary profile) JDK 1.1.8 (Personal Java) + Symbian Epoc WAP Programming Model 24 Current Limitations of WAP (I) 25 Microbrowser Only Interface to Internet Must Use Slow WAP Gateway Device Display is Limited Input Mechanisms are Limited Only Simple UI Not Good Enough Security Model Current Limitations of WAP (II) 26 Currently, Must Be Connected Currently, Only a “Pull” Model Currently, No Multimedia Limited or Non-existent Graphics Limited Manipulation of Corporate Objects Minimal Colors Java Architecture 27 Write Once Run Anywhere? 28 Write Once Run Anywhere? 29 Java Platforms 30 Java End-to-end Total Solutions Why Java Technology For Mobile Applications? Write once, run anywhere – Rich compelling user experience – – – – – 32 Leverage all platforms and devices GUI-based, multimedia, interactive applications Works with XML, WAP, HTML Dynamic delivery of services and applications, easy upgrades Disconnected use Saves battery life, user always on Why Java Technology For Mobile Applications? Security – 33 Integrated security, private data, networked, encryption Open standards Server-side model (J2EE), Client- side model(J2SE or J2ME), or Both 2. 5M+ Java Programmers! Application Delivery Options Spectrum of Devices Browser Based (WAP) Native Code (C Lang) Java Code 34 Application Variety ? Personal Productivity ? Location Based Apps ? Voice/Text hybrids ? Entertainment OS Variety ? Proprietary to manufacturer, no dominant player Application Delivery Options Why Java fits perfectly: 36 Portability Secure Execution Environment Downloadable Code Contents Wireless Services and Mobile applications Wireless solution: WAP, Native code or Java? Standards: – 37 Mobile Execution Environment (MExE (mexy)) J2ME for mobile phones/PDAs: CLDC + MIDP Demo: J2ME Sample programs MExE: Introduction Mobile Execution Environment or MExE (pronounced “mexy”) is a specification – – 38 first created by ETSI and maintained and developed by 3GPP (3rd generation partnership project) MExE provides a standardized application execution environment for mobile terminals (mobile phones, PDAs) MExE allows applications to be developed independently of any mobile terminal platform MExE: Introduction Mobile Terminal (MT) consists of – – 39 the Mobile Equipment (ME) and SIM/USIM (Universal Subscriber Identity Module) MT can vary from small devices (with low bandwidth, limited displays, low processor speeds), to more sophisticated PDA-like devices Mobile Terminals 40 MExE: Introduction MExE allows negotiation of capabilities between MTs and MExE servers Services are provided by mobile applications executing on the clients or the servers or both For wide variety of possible mobile terminal configurations (pages, mobile phone, PDAs,..) MExE defines three classmarks – – – 41 MExE Classmark 1 – WAP Environment MExE Classmark 2 – PersonalJava Environment MExE Classmark 3 – Java 2 ME CLDC Environment MExE Architecture MExE Architecture Classmarks A classmark specifies an application environment based on an existing and already proven technology like WAP and Java. MExE incorporates these existing technologies into an open standard that will allow interoperability between device manufacturers and application developers – 44 Thus, MExE is not a new technology Classmarks MExE devices are required to support at least one of three classsmarks Multiple classmarks support is optional Common configuration – – 45 Classmark 1 + 2 (WAP + PJava): Nokia 9210 Classmark 1 + 3 (WAP + KJava): Motorala A6288 WAP provides the browser functionality and the ability to download new PJava or KJava applications MExE Classmark 1 – WAP Environment WAP (Wireless Application Protocol) features: – – – – – 46 A lightweight markup language: WML (Wireless Markup Lang.) A script language: WMLScript WML and WMLScript are derived from XML & JavaScript A lightweight protocol stack to minimize the required bandwidth (WSP, WTP, WTLS, WDP) and to run on wireless networks (GSM, GPRS, WCDMA,…) WTA (Wireless telephony applications) allows access to telephony functionality (call control, phone book) WAP Network Architecture MExE Classmark 1 – WAP Environment WAP services: – – – – – – – 48 – News Weather information Package tracking Share Trading Telephony services Time tables Access to corporate database Sports MExE Classmark 2 – PersonalJava Environment 49 PersonalJava Application environment is a Java platform for building network-connectable applications for consumer devices for home, office and mobile use. PersonalJava = full JVM (Java Virtual Machine) + an optimized Java class library JavaPhone API is a vertical extension to the PJava that defines APIs for telephony control, messaging, address book and calendar info. PersonalJava High Level Architecture 50 MExE Classmark 2 – PersonalJava Environment 51 PersonalJava is based on JDK 1.1.8 with only AWT support (no swing) and runs on classic VM. New version will be based on J2ME CDC + personal profile (still making the standard) run on CVM (Compact Virtual Machine) MExE Classmark 3 – J2ME CLDC MIDP Environment MExE classmark 3 devices are based on – – – Java platforms: – – – – 52 J2ME (Java 2 Micro Edition) CLDC (Connected Limited Device Configuration) MIDP (Mobile Information Device Profile) J2EE (Java 2 Enterprise Edition) J2SE (Java 2 Standard Edition) J2ME (Java 2 Micro Edition) Java Card platform Why? One-size does not fit all. KJava High Level Architecture 53 MIDP Application Download Steps Every MIDlet Application has – – Download Steps: – – – – 54 A Java Application Descriptor (JAD) file and A MIDlet suite (jar file) Step 1: MExE Client requests JAD file Step 2: JAD file downloaded to MExE client Step 3: Java Application Manager (JAM) checks JAD file for suitability Step 4: MIDlet suite downloaded to MExE Client MIDP Application Download Steps MExE Security Need to prevent attack from unfriendly sources or transferred applications unintentionally damaging the MExE device Basic MExE security: – – – 56 A framework which defines the permissions that transferred MExE executables have within the MExE Mobile Terminal The secure storage of these permissions Conditions within the executable environment that ensure that MExE executables can only perform actions for which there have permission. MExE Executable Authentication Four domain are defined – – – – 57 MExE Security Operator Domain (MExE execuables authorized by the network operator) MExE Security Manufacturer Domain (MExE execuables authorized by the MT manufacturer) MExE Security Third Party Domain (MExE execuables authorized by the trusted third party) MExE untrusted (untrusted MExE executables) User Permissions The user will be prompted for user permission whenever an application wishes to perform an action that may be seen as a security risk. Types of Permissions: – – – 58 Blanket Permission: permission for the App. Session Permission: permission for the run of the App. Single-Action Permission: one time only MExE Certification and Authorization 59 To enforce the MExE security framework, the MExE capable mobile terminal is required to operate an authentication mechanism for verifying downloaded MExE executables A successful authentication will result in the MExE executable being trusted and able to be executed in security domain (manufacturer, operator, Third party) MExE Certification and Authorization Mobile terminal has public keys and the corresponding private keys – – 60 Root public key (securely installed in the MT, e.g. at manufacture) or A signed public key provided by a certificate Root public keys for a number of Certification Authorities (CAs) may be installed in the ME at manufacture. These root public keys can be used to verify certificates for the third party MExE executables. MExE Certification and Authorization: An Example 61 A third party software developer (3PSD) generates a private and public key pair (obtained from a CA) The 3PSD obtains a certificate for the public key from a CA. (certificate = developer public key + private key of the CA) The 3PSD adds all the certificates required in the key chain in the JAR MExE Certification and Authorization: An Example 62 The MExE MT downloads a MExE executable of 3PSD The MExE MT verifies the certificate using the root public key, contained in the browser of the relevant CA and extracts the 3PSD public key The MExE MT verifies that the MExE executable was signed using the private key corresponding to the 3PSD public key and installs or rejects the MExE executable accordingly MExE Services: Services execute on remote server 63 Example: WAP browser MExE Services: Service client downloaded to MExE MT 64 • MExE MT downloads new Services • New services interact with servers • Examples: email client or share ticker MExE Services: Standalone Service downloaded to MExE MT 65 • MExE MT downloads new Services • Services execute on the MT • Example: game MExE Services: MExE MT to MExE MT Services 66 • MExE MT downloads new Services • Services execute on the MT and establish connections • Example: interactive games, sharing calendar info. Information 67 3GPP (3rd Generation Partnership Project): http://www.3gpp.org/ European Telecommunications Standards Institute: http://www.etsi.org/ MExE forum: http://www.mexeforum.org/ Contents Wireless Services and Mobile applications Wireless solution: WAP, Native code or Java? Standards: – 68 Mobile Execution Environment (MExE (mexy)) J2ME for mobile phones/PDAs: CLDC + MIDP Demo: J2ME Sample programs What is it? A thing have the following: – – – – – – 69 CPU some memory screen keyboard networked runs applications New Computers 70 Current Mobile Phone Computing No software market !!! Everything is proprietary – Hardware, software and tools No compelling content Handsets are useless without a network 71 J2ME is the Solution Designed for small devices Online and offline activities Rich user and network interaction models Fully programmable Portable 72 Java Provides Total Solutions 73 Java Platform 74 Java™ 2 Platform, Enterprise Edition (J2EE™) – Enterprise solutions: e-commerce, e-business Java™ 2 Platform, Standard Edition (J2SE™) – Desktop solutions: standalone apps, applets Java 2 Platform, Micro Edition (J2ME) – Consumer solutions: cell phones, PDAs, TV STBs, cars All based on the Java programming language Different JVMs and APIs J2ME Configurations and Profiles Java™ 2 Platform, Micro Edition (J2ME™) Optional Packages • Configurations: define VMs and Optional Packages core APIs • Profiles: vertical (market-specific) APIs Java 2 Enterprise Edition (J2EE) Core APIs Java 2 Standard Edition (J2SE) Core APIs Personal Profile RMI Profile Other CDC Profiles ... Foundation Profile Mobile Phones, PDAs Mobile Information Device Profile Java 2 Micro Edition Core APIs Java Card APIs Java Programming Language Java HotSpot ™ Java Virtual Machine (JVM) KVM Card VM What Is a Configuration? Defines the minimum capabilities and libraries for a JVM that will be available on all devices belonging to the same “horizontal” family of devices Similar requirements in memory size and processing capabilities Subject to compatibility test Two configuration defined – 76 – Connected, Limited Device Configuration (CLDC) Connected Device Configuration (CDC) Connected Limited Device Configuration (CLDC) Targeted at devices with – – – – – 77 160KB to 512KB total memory available for Java™ technology Slow processor Limited power (often battery) Limited, perhaps intermittent connectivity to a network (often wireless) Extremely constrained UIs, small screens CLDC 1.0 specification available for free download now Sun provides CLDC reference implementation built using the KVM What Is a Profile? A collection of Java technology-based APIs that supplement a Configuration to provide capabilities for a specific “vertical” market or device type Adds features that are specific to a certain device category such as cell phones or PDAs One profile defined – 78 Mobile Information Device Profile Mobile Information Device Profile Targets mobile two-way communication devices implementing J2ME CLDC Profile addresses – – – 79 Display toolkit, User input methods Persistent data storage using simple record-oriented database model HTTP-based networking using CLDC Generic Connection framework MIDP 1.0 spec and implementation available for download now MIDP Class Libraries MIDP defines the following set of class libraries that map to the aforementioned assumptions. – – – – – 80 Application Lifecycle Package javax.microedition.midlet User Interface Package javax.microedition.lcdui Persistence Package javax.microedition.rms Networking Package javax.microedition.io Language and Utility Packages java.lang and java.util CLDC and MIDP Architecture MIDP Profile Applications OEM Applications MID Profile CLDC (KVM) Operating System 81 OEM APIs MIDP Application Lifecycle Server MIDlet publish create MIDlet develop 82 Development Env retrieve install MIDlet run Device remove MIDP Application Lifecycle MIDP applications are known as “MIDlets” Pause MIDlets move from state to pauseApp startApp state in the lifecycle: – – – 83 Start – acquire resources and start executing Pause – release resources and become quiescent (wait) Destroy – release all resources, destroy threads, and end all activity destroyApp Active destroyApp Destroyed import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class HelloMIDlet extends MIDlet implements CommandListener { private Command exitCommand; private Display display; public HelloMIDlet() { display = Display.getDisplay(this); exitCommand = new Command("Exit", Command.SCREEN, 2); } public void startApp() { TextBox t = new TextBox("Hello MIDlet", ”Hello World!", 256, 0); t.addCommand(exitCommand); t.setCommandListener(this); display.setCurrent(t); } public void pauseApp() { } public void destroyApp(boolean unconditional) { } public void commandAction(Command c, Displayable s) { if (c == exitCommand) { destroyApp(false); notifyDestroyed(); } } } Hello Sample Class File Verification in CLDC Myapp.java ..download Javac Myapp.class 85 Verifier Preverifier Interpreter Myapp.class Target device Developing a MIDP Application 86 Create/modify the JavaTM programming language source code Compile and Preverify the classes Package the application into a jar file Create the application descriptor file Test the application on the emulator Typical J2ME Technology Stack Your MIDlet Mobile Information Device Profile Yellow Pages, train schedules and ticketing, games… UI, HTTP networking... J2ME core APIs CLDC = KVM + J2ME Core APIs in this example 87 KVM DSP chip (e.g., ARM) Threads, no Floats… 32-bit RISC, 256K ROM, 256K Flash, 64K RAM Java-enabled Phones Motorola i85s, i50sx Motorola Accompli A008 Fujitsu f503, Panasonic p503 IDen (from Nextel) GSM, GPRS J2ME MIDP (USA only) i-Mode DoCoMo FOMA N2001 (made by NEC) DoCoMo FOMA P2101V J-SH07 (made by Sharp for JPhone) Nokia 9210 3G (W-CDMA) J2ME CLDC + NTT libraries (Japan only) There are other x503 phones by other vendors J2ME CLDC + NTT libraries (Japan only) 3G (W-CDMA) J2ME CLDC + NTT libraries (Japan only) PDC Symbian EPOC J2ME/CLDC/MIDP; JBlend; J-PHONE Specific Class Libraries (JSCL) (Japan only) Personal Java (not for USA) Ericsson R380 Symbian EPOC Personal Java (not for USA) Motorola A6288 GSM, GPRS J2ME MIDP (Chunghwa TeleCom) J2ME MIDP (USA only) Java-enabled PDAs PalmOS MIDP for Palm (Sun) J2ME MIDP Windows CE 2.11 PalmOS, WindowsCE PalmOS Personal Java Runtime (Sun) IBM J9 PersonalJava JBed Various libraries, no MIDP yet CLDC PalmOS kAWT Color KVM, kAWT EPOC from Symbian WindowsCE 2.12 and 3.0 Windows CE Symbian Java PersonalJava Jeode PersonalJava NSIcom CrEme PersonalJava RIM Blackberry RIM J2ME J2ME MIDP PalmOS KadaVM PersonalJava Windows CE ChaiVM PersonalJava J2ME Application Screenshots 90 J2ME To J2EE Communication J2EE Application Server Web Container EJB Container J2ME Servlet forward HTTP 91 HTML Servlet Book EJB J2EE Architecture 92 Client Tier Web Tier Business Tier Integration Tier EIS Tier Key J2EE Components Enterprise Java Bean – Servlet – Templates used to generate content dynamically J2EE Connectors – 93 Java classes that extends the function of a web server Java Server Pages – Business logic packaging, distribution and access Generic access to back end EIS Example of A J2EE Application 94 EJB is used to encapsulate business logic and apply them to EIS back office systems Servlets are used to co-ordinate the interactions between users and EJBs JSPs are used to present forms, information and results back to the user J2ME To J2EE Communication J2EE Application Server Web EJB Container Container 3. Communicate J2ME Servlet 1. request forward HTTP 95 Book EJB HTML Servlet 2. process & redirect Getting Started on J2ME Java2 Standard Edition – Java2 Micro Edition Wireless Toolkit – 96 http://java.sun.com/j2se http://java.sun.com/products/j2mewtoolkit/ Contents Wireless Services and Mobile applications Wireless solution: WAP, Native code or Java? Standards: – 97 Mobile Execution Environment (MExE (mexy)) J2ME for mobile phones/PDAs: CLDC + MIDP Demo: J2ME Sample programs Program Sources Micro Java Network: – Bestis Co., Taipei Taiwan: – 98 http://www.microjava.com http://www.e-bestis.com.tw/ 線上即時証券商 99 賓果遊戲 10 0 小蜜蜂 10 1 坦克大戰 10 2 手指跳舞機 10 3