java2 platform micro edition (me) benedek balázs [email protected]

21
Java2 Platform Micro Edition (ME) Benedek Balázs [email protected]

Post on 19-Dec-2015

231 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Java2 Platform Micro Edition (ME) Benedek Balázs benedek@iit.bme.hu

Java2 PlatformMicro Edition (ME)

Benedek Balá[email protected]

Page 2: Java2 Platform Micro Edition (ME) Benedek Balázs benedek@iit.bme.hu

JAVA platform

Page 3: Java2 Platform Micro Edition (ME) Benedek Balázs benedek@iit.bme.hu

JAVA platform

http://www.clib.dote.hu/javacska

Page 4: Java2 Platform Micro Edition (ME) Benedek Balázs benedek@iit.bme.hu

Lego® Mindstorms™ Robotics Invention System™, http://mindstorms.lego.com

A RIS egy Lego robot építő csomag:– RCX kocka– USB IR torony– 2 motor– 2 érintés érzékelő– 1 fény érzékelő– 718 kocka

Page 5: Java2 Platform Micro Edition (ME) Benedek Balázs benedek@iit.bme.hu
Page 6: Java2 Platform Micro Edition (ME) Benedek Balázs benedek@iit.bme.hu

J2ME Platform• Because J2ME spans such a variety of devices, it wouldn't make sense to try to create a

one-size-fits-all solution. J2ME, therefore, is divided into configurations, profiles, and optional packages.

• Configurations are specifications that detail a virtual machine and a base set of APIs that can be used with a certain class of device. A configuration, for example, might be designed for devices that have less than 512 KB of memory and an intermittent network connection. The virtual machine is either a full Java Virtual Machine (as described in the specification) or some subset of the full JVM. The set of APIs is customarily a subset of the J2SE APIs.

• A profile builds on a configuration but adds more specific APIs to make a complete environment for building applications. While a configuration describes a JVM and a basic set of APIs, it does not by itself specify enough detail to enable you to build complete applications. Profiles usually include APIs for application life cycle, user interface, and persistent storage.

• An optional package provides functionality that may not be associated with a specific configuration or profile. One example of an optional package is the Bluetooth API (JSR 82), which provides a standardized API for using Bluetooth networking. This optional package could be implemented alongside virtually any combination of configurations and profiles.

Page 7: Java2 Platform Micro Edition (ME) Benedek Balázs benedek@iit.bme.hu

The J2ME Universe

Page 8: Java2 Platform Micro Edition (ME) Benedek Balázs benedek@iit.bme.hu

Configurations, Profiles, PackagesConfigurations• JSR 30 CLDC 1.0 Connected, Limited Device

Configuration• JSR 139 CLDC 1.1 Connected, Limited Device

Configuration 1.1• JSR 36 CDC Connected Device

Configuration• JSR 218 CDC 1.1 Connected Device

Configuration 1.1

Profiles• JSR 37 MIDP 1.0 Mobile Information Device

Profile• JSR 118 MIDP 2.0 Mobile Information Device

Profile 2.0• JSR 75 PDAP PDA Profile• JSR 46 FP Foundation Profile• JSR 219 FP 1.1 Foundation Profile 1.1• JSR 129 PBP Personal Basis Profile• JSR 217 PBP 1.1 Personal Basis Profile 1.1• JSR 62 PP Personal Profile• JSR 215 PP 1.1 Personal Profile 1.1• JSR 195 IMP Information Module Profile• JSR 228 IMP-NG Information Module Profile -

Next Generation

Optional Packages• JSR 75 PDA Optional Packages for the J2ME

Platform • JSR 82 Java APIs for Bluetooth• JSR 120 Wireless Messaging API• JSR 205 Wireless Messaging API 2.0• JSR 135 Mobile Media API• JSR 164 JAIN SIMPLE Presence• JSR 165  JAIN SIMPLE Instant Messaging• JSR 172  J2ME Web Services• JSR 177 Security and Trust Services API for J2ME• JSR 179  Location API for J2ME• JSR 180 SIPSIP API for J2ME• JSR 184 Mobile 3D Graphics API for J2ME• JSR 186  JAIN Presence• JSR 187 JAIN Instant Messaging• JSR 190  Event Tracking API for J2ME• JSR 209  Advanced Graphics and User Interface• JSR 211 Content Handling API• JSR 213 Micro WSCI Framework for J2ME• JSR 214 Micro BPSS for J2ME Devices• JSR 226  Scalable 2D Vector Graphics API• JSR 229 Payment API• JSR 230 Data Sync API• JSR 232 Mobile Operational Management• JSR 234 Advanced Multimedia Supplements• JSR 238 Mobile Internationalization API• JSR 239 Java Bindings for OpenGL ES• JSR 246 Device Management API• JSR 253 Mobile Telephony API (MTA)

Page 9: Java2 Platform Micro Edition (ME) Benedek Balázs benedek@iit.bme.hu
Page 10: Java2 Platform Micro Edition (ME) Benedek Balázs benedek@iit.bme.hu

Hello World!

Page 11: Java2 Platform Micro Edition (ME) Benedek Balázs benedek@iit.bme.hu

High-Level MIDP GUICommand

CommandListener interface

Page 12: Java2 Platform Micro Edition (ME) Benedek Balázs benedek@iit.bme.hu

High-Level MIDP GUI

• Alert

• DateField

• Form

• Gauge

• List

• TextBox

• TextField

http://developers.sun.com/techtopics/mobility/midp/articles/ui/

Page 13: Java2 Platform Micro Edition (ME) Benedek Balázs benedek@iit.bme.hu

Low-Level MIDP GUI

• Canvas

• Raw input event

• Command

• CommandListener

http://developers.sun.com/techtopics/mobility/midp/articles/ui/

Page 14: Java2 Platform Micro Edition (ME) Benedek Balázs benedek@iit.bme.hu

Low-Level MIDP GUI

http://developers.sun.com/techtopics/mobility/midp/articles/ui/

Page 15: Java2 Platform Micro Edition (ME) Benedek Balázs benedek@iit.bme.hu

Over-The-Air (OTA) Deploying

Page 16: Java2 Platform Micro Edition (ME) Benedek Balázs benedek@iit.bme.hu

Deploying – JAD file

MIDlet-1: WordLearner, WordLearner.png, MainMIDlet-Data-Size: 40000MIDlet-Install-Notify: http://wordlearner.com/dl/installed.php?ID=101MIDlet-Jar-Size: 74932MIDlet-Jar-URL: http://wordlearner.com/WordLearner.jarMIDlet-Name: WordLearnerMIDlet-Vendor: UpSpringMIDlet-Version: 0.32.11MicroEdition-Configuration: CLDC-1.0MicroEdition-Profile: MIDP-1.0

File Extension MIME Type.JAD text/vnd.sun.j2me.app-descriptor.JAR application/java-archive

Page 17: Java2 Platform Micro Edition (ME) Benedek Balázs benedek@iit.bme.hu
Page 18: Java2 Platform Micro Edition (ME) Benedek Balázs benedek@iit.bme.hu

MIDP Emulator Applicatons

http://developers.sun.com/techtopics/mobility/midp/articles/emulators/index.html

Page 19: Java2 Platform Micro Edition (ME) Benedek Balázs benedek@iit.bme.hu

MIDP Emulator Applet

http://sourceforge.net/projects/microemulator/

Page 20: Java2 Platform Micro Edition (ME) Benedek Balázs benedek@iit.bme.hu

Bibliográfia

• Jávácska portálhttp://www.clib.dote.hu/javacska

• Wireless Development Tutorial Part Ihttp://developers.sun.com/techtopics/mobility/midp/articles/wtoolkit/

• MIDP Emulatorshttp://developers.sun.com/techtopics/mobility/midp/articles/emulators/index.html

• Obfuscatinghttp://developers.sun.com/techtopics/mobility/midp/ttips/proguard/index.html

• Technical Articles and Tipshttp://developers.sun.com/techtopics/mobility/midp/reference/techart/

Page 21: Java2 Platform Micro Edition (ME) Benedek Balázs benedek@iit.bme.hu

Overview of the Java 2 Platform• The Java programming language is syntactically similar to C++ but differs fundamentally. While

C++ uses unsafe pointers and programmers are responsible for allocating and freeing memory, the Java programming language uses type safe object references, and unused memory is reclaimed automatically. Furthermore, the Java programming language eschews multiple inheritance (a likely source of confusion and ambiguity in C++) in favor of a cleaner construct, interfaces.

• A virtual machine forms the foundation of the Java platform. This architecture offers several attractive features: The virtual machine can be implemented to run atop a variety of operating systems and hardware, with binary-compatible Java applications operating consistently across many implementations. In addition, the virtual machine provides tight control of executed binaries, enabling safe execution of untrusted code.

• Finally, an extensive set of standard application programming interfaces (APIs) rounds out the Java platform. These support almost everything you might want your applications to do, from user interface through cryptography, from CORBA connectivity through internationalization.

• Java 2, Standard Edition (J2SE) is designed for desktop computers. Most often it runs on top of OS X, Linux, Solaris, or Microsoft Windows.

• Java 2, Enterprise Edition (J2EE) is a comprehensive platform for multiuser, enterprise-wide applications. It is based on J2SE and adds APIs for server-side computing.

• Java 2, Micro Edition (J2ME) is a set of technologies and specifications developed for small devices like pagers, mobile phones, and set-top boxes. J2ME uses subsets of J2SE components, such as smaller virtual machines and leaner APIs.