Programming java 2 micro edition for symbian os phần 10 ppsx

50 341 0
Programming java 2 micro edition for symbian os phần 10 ppsx

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

422 THE MARKET, THE OPPORTUNITIES AND SYMBIAN’S PLANS • network bandwidth will improve, though not so dramatically • network connections will always be available, reducing latency • costs for persistent storage will continue to tumble and access speeds will increase dramatically as new memory technologies, such as Ferroelectric RAM, Magnetic RAM and Ovonic memory, replace NOR and NAND flash • the resolution of screen displays will continue to improve, through a decrease in dot pitch as screen sizes will be limited by overall mobile phone ergonomics. There will also be market changes: • ”smart houses” will become a reality: climate control, entertainment and security systems will be controlled by a variety of devices, including mobile phones • digital consumer goods will converge. Today, video cameras can take still images and digital cameras can record video, and quite often both include MP3 players. These capabilities are moving into mobile phones: the current phones only support VGA, however the next generation of mobile phones will have megapixel resolution cameras (indeed a number of Japanese cameras already do). Many of today’s mobile phones come with FM radios and in the future we are likely to see the inclusion of Digital Audio Broadcast radios. In Korea, people can now use their mobile phones for credit card purchases. The consequence will be an explosion in the amount of data users store on their mobile phone: audio, video, images, email and messaging. This will amount to gigabytes of storage. So, we leave you with a simple challenge: to use your development skills, and the knowledge and insight that we hope you have gained from this book, to create the next killer Java service or application on Symbian OS. Appendix 1 CLDC Core Libraries System Classes java.lang.Class Instances of Class represent classes and interfaces in a running application. java.lang.Object The Object class is the root of classes. java.lang.Runtime Every Java application has a single instance of the Runtime class, which allows the application to interface with the environment in which it is running. Note that the Exit() method always throws a java.lang. SecurityException. java.lang.System The System class contains several useful fields and methods and it cannot be instantiated. Note that the Exit() method always throws a java.lang. SecurityException. java.lang.Thread A Thread is a unit of execution in a program. Multiple threads may be executed concurrently. java.lang.Runnable (interface) This interface should be implemented by any class which is intended to be executed as threads. A run() method must be defined by such a class. java.lang.Throwable The Throwable class is the superclass of all errors and exceptions. Programming Java 2 Micro Edition on Symbian OS: A developer’s guide to MIDP 2.0 . Martin de Jode  2004 Symbian Ltd ISBN: 0-470-09223-8 424 CLDC CORE LIBRARIES Data Type Classes java.lang.Boolean The Boolean class wraps a value of the boolean primitive type in an object. java.lang.Byte The Byte class wraps a value of the byte primitive type in an object. java.lang.Character The Character wraps a value of the char primitive type in an object. java.lang.Integer The Integer class wraps a value of the int primitive type in an object. java.lang.Long The Long class wraps a value of the long primitive type in an object. java.lang.Short The Short class wraps a value of the short primitive type in an object. java.lang.String The String class represents character strings. java.lang.Stringbuffer A StringBuffer implements a mutable sequence of characters. Collection Classes java.util.Vector The Vector class implements an array of objects that can grow. java.util.Stack The Stack class represents a last in first out stack of objects. java.util.Hashtable This class implements a hashtable, which maps keys to values. java.util.Enumeration (interface) An object that implements the Enumeration interface generates a series of elements, one at a time. Input/Output Classes java.io.InputStream This abstract class is the superclass of all classes representing an input stream of bytes. java.io.OutputStream This abstract class is the superclass of all classes representing an output stream of bytes. java.io.ByteArrayInputStream A ByteArrayInputStream has an internal buffer that contains bytes that may be read from the stream. CALENDAR AND TIME CLASSES 425 java.io.ByteArrayOutputStream This class implements an output stream in which the data is written into a byte array. java.io.DataInput (interface) The DataInput interface provides for reading bytes from a binary stream and reconstructing from them data in any of the primitive types. java.io.DataOutput (interface) The DataOutput interface provides for converting data from any of the primitive types to a series of bytes and writing to a binary stream. java.io.DataInputStream A DataInputStream lets an application read primitive data types from an underlying input stream in a machine-independent way. java.io.DataOutputStream A DataOutputStream lets an application write primitive data types to an output stream in a portable way. java.io.Reader An abstract class for reading character streams. java.io.Writer An abstract class for writing character streams. java.io.InputStreamReader An InputStreamReader is a bridge from byte streams to character streams. It reads bytes and translates them into characters according to a specified character encoding. java.io.OutputStreamReader An OutputStreamReader is a bridge from character streams to byte streams. Characters written to it are translated into bytes according to a specified character encoding. java.io.PrintStream A PrintStream adds functionality to another output stream, namely the ability to print representations of various data values conveniently. Calendar and Time Classes java.util.Calendar The Calendar is an abstract class for getting and setting dates using a set of integer fields such as YEAR, MONTH, DAY, etc. 426 CLDC CORE LIBRARIES java.util.Date The Date class represents a specific instant in time with a millisecond precision. java.util.TimeZone The TimeZone class represents a time zone offset and also works out daylight savings. Additional Utility Classes java.util.Random An instance of this class is used to generate series of pseudo-random numbers. java.lang.Math The Math class contains methods for performing basic numeric operations. Exception Classes java.lang.Exception The Exception class and its subclasses are a form of Throwable that indicates conditions that a reasonable application might want to catch. java.lang.ClassNotFoundException Thrown when an application tries to load in a class through its string name using the forName() method in Class class. java.lang.IllegalAccessException Thrown when an application tries to load in a class but the executing method does not have access to the class definition, because the class is in another package and is not public. java.lang.InstantiationException Thrown when an application tries to create an instance of a class using the newInstance() method in Class class, but cannot instantiate it because it is an interface or an abstract class or it doesn’t have a default constructor. java.lang.InterruptedException Thrown when a thread is waiting, sleeping or otherwise paused and another thread interrupts it. java.lang.RuntimeException This is the superclass of exceptions that can be thrown during the normal operation of the Java Virtual Machine. EXCEPTION CLASSES 427 java.lang.ArithmeticException Thrown when an exceptional arithmetic condition occurs. java.lang.ArrayStoreException Thrown to indicate that an attempt has been made to store the wrong type of object in an array of objects. java.lang. ArrayIndexOutOfBoundsException Thrown to indicate that an array has been accessed with an illegal index. java.lang.ClassCastException Thrown to indicate that the code has attempted to cast an object to a subclass of which it is not an instance. java.lang. IllegalArgumentException Thrown to indicate that a method has been passed an illegal or inappropriate argument. java.lang. IllegalThreadStateException Thrown when starting a Thread for the second time. java.lang.NumberFormatException Thrown when trying to read an Integer from a malformed String. java.lang. IllegalMonitorStateException Thrown to indicate that a thread has attempted to wait on an object’s monitor or to notify other threads waiting on an object’s monitor without owning the specified monitor. java.lang. IndexOutofBoundsException Thrown to indicate that an index of some sort (such as an index to an array, to a string, or to a vector) is out of range. java.lang. StringIndexOutOfBoundsException Thrown by the charAt() method in class String and by other String methods, to indicate that an index is either negative or greater than or equal to the size of the string. java.lang. NegativeArraySizeException Thrown if an application tries to create an array with negative size. java.lang.NullPointerException Thrown when an application attempts to use null in a case where an object is required. java.lang.SecurityException Thrown by the security manager to indicate a security violation. java.util.EmptyStackException Thrown by methods in the Stack class to indicate that the stack is empty. java.util.NoSuchElementException Thrown by the methods of an Enumeration to indicate that there are no more elements in the enumeration. 428 CLDC CORE LIBRARIES java.io.EOFException Signals that an end of file or end of stream has been reached unexpectedly during input. java.io.IOException Signals that an I/O exception of some sort has occurred. java.io.InterruptedIOException Signals that an I/O operation has been interrupted. java.io. UnsupportedEncodingException Signals that the character encoding is not supported. java.io.UTFDataFormatException Signals that a malformed UTF8 string has been read in a data input stream or by any class that implements the data input interface. Error Classes In contrast to the exception classes, the error-handling capabilities of CLDC are limited to just three: java.lang.Error Error is a subclass of Throwable that indicates serious problems that a reasonable application may not try to catch. java.lang.VirtualMachineError Thrown to indicate that the Java Virtual Machine is broken or has run out of the resources necessary for it to continue operating. java.lang.OutOfMemoryError Thrown when the Java Virtual Machine cannot allocate an object because it is out of memory and no more memory can be made available by the garbage collector. Catching an OutOfMemoryError is very good practice when devel- oping for a resource-constrained device. It allows the developer to try to free all the memory he can and maybe give the application another chance to perform the requested action. In the worst case scenario, the application should be able to display a previously allocated dialog box to inform the user that the application cannot continue. Appendix 2 MIDP Libraries Networking Package javax.microedition.io.Connection This interface is the most basic type of generic connection. javax.microedition.io.Connector This class is a placeholder for the static methods used to create all the connection objects. javax.microedition.io.CommConnection This interface defines a logical serial port connection. javax.microedition.io.ContentConnection This interface defines the stream connection over which content is passed. javax.microedition.io.Datagram This is the generic datagram interface. javax.microedition.io.DatagramConnection This interface defines the capabilities that a datagram connection must have. javax.microedition.io.HttpConnection This interface defines the necessary methods and constants for an HTTP connection. javax.microedition.io.HttpsConnection This interface defines the necessary methods and constants to establish a secure network connection. javax.microedition.io.InputConnection This interface defines the capabilities that an input stream connection must have. Programming Java 2 Micro Edition on Symbian OS: A developer’s guide to MIDP 2.0 . Martin de Jode  2004 Symbian Ltd ISBN: 0-470-09223-8 430 MIDP LIBRARIES javax.microedition.io.OutputConnection This interface defines the capabilities that an output stream connection must have. javax.microedition.io.PushRegistry This class maintains a list of inbound connections. javax.microedition.io.SecureConnection This interface defines the secure socket stream connection. javax.microedition.io.SecurityInfo This interface defines the methods for accessing information about a secure connection. javax.microedition.io. ServerSocketConnection This interface defines the server socket stream connection. javax.microedition.io.SocketConnection This interface defines the socket stream connection. javax.microedition.io.StreamConnection This interface defines the capabilities that a stream connection must have. javax.microedition.io. StreamConnectionNotifier This interface defines the capabilities that a connection notifier must have. javax.microedition.io. UDPDatagramConnection This interface defines a datagram connection which knows the local end point address. Exception javax.microedition.io. ConnectionNotFoundException Signals that the protocol for the connection is not supported by the device. User Interface Classes javax.microedition.lcdui.Alert A screen that shows data to the user and waits for a certain period of time before proceeding to the next screen. javax.microedition.lcdui.AlertType Provides an indication of thenatureofalerts. USER INTERFACE CLASSES 431 javax.microedition.lcdui.Canvas The base class for writing applications that need to handle low-level events andtoissuegraphics calls for drawing to the display. javax.microedition.lcdui.Choice This interface defines an API for user interface components that enable the user to select from a predefined number of choices. javax.microedition.lcdui.ChoiceGroup A group of selectable elements intended to be placed within a Form. javax.microedition.lcdui.Command A construct that encapsulates the semantic information of an action. javax.microedition.lcdui.CommandListener This interface is used by applications which need to receive high-level events from the implementation. javax.microedition.lcdui.CustomItem A customizable element which can be subclassed to introduce new visual and interactive elements to a Form. javax.microedition.lcdui.DateField An editable component for presenting date and time (calendar) information that may be placed in a Form. javax.microedition.lcdui.Display Represents the manager of the display and GUI capabilities of the system. javax.microedition.lcdui.Displayable An object that can be placed on the display. javax.microedition.lcdui.Font Represents fonts and font metrics. javax.microedition.lcdui.Form A Screen that contains an arbitrary mixture of items: read-only text fields, editable text fields, editable date fields, gauges, choice groups and custom items. [...]...4 32 MIDP LIBRARIES javax.microedition.lcdui.Gauge javax.microedition.lcdui.Graphics javax.microedition.lcdui.Image javax.microedition.lcdui.ImageItem javax.microedition.lcdui.Item javax.microedition.lcdui ItemCommandListener javax.microedition.lcdui ItemStateListener javax.microedition.lcdui.List javax.microedition.lcdui.Screen javax.microedition.lcdui.Spacer javax.microedition.lcdui.StringItem javax.microedition.lcdui.TextBox... element composed of a grid of cells that can be filled with a set of tile images Media API java. microedition.media.Control java. microedition.media.Controllable java. microedition.media.Manager java. microedition.media.MediaException java. microedition.media.Player java. microedition.media.PlayerListener java. microedition.media.control ToneControl java. microedition.media.control VolumeControl A superclass for objects... System for Bluetooth www.csr.com Forum Nokia, Nokia Developer’s Suite for J2ME 2. 0 http://forum.nokia.com Forum Nokia, Series 60 MIDP SDK 1 .2. 1 for Symbian OS, Nokia Edition http://forum.nokia.com Forum Nokia (20 03) Setting Up and Using the Bluetooth Testing Environment for Series 60 Platform http://forum.nokia.com Hopkins, B and Anthony, R (20 03) Bluetooth for Java, Apress Java Community Process, JSR 82: ... javax.microedition.rms.RecordComparator javax.microedition.rms.RecordEnumeration javax.microedition.rms.RecordFilter javax.microedition.rms.RecordListener javax.microedition.rms.RecordStore javax.microedition.rms RecordStoreException javax.microedition.rms RecordStoreFullException javax.microedition.rms RecordStoreNotFoundException javax.microedition.rms RecordStoreNotOpenException Thrown to indicate an operation... C:> SET J2MEHOME=\WTK21 C:> SET MIDPAPI=%J2MEHOME%\lib\midpapi20.jar C:> SET J2MECLASSPATH=%J2MEHOME%\wtklib\kenv.zip; %J2MEHOME%\wtklib\kvem.jar;%J2MEHOME%\wtklib\lime.jar; %J2MEHOME%\lib\cldcapi10.jar Programming Java 2 Micro Edition on Symbian OS: A developer’s guide to MIDP 2. 0 Martin de Jode  20 04 Symbian Ltd ISBN: 0-470-0 922 3-8 438 USING THE WIRELESS TOOLKIT TOOLS AT THE COMMAND... 3D Graphics API for J2ME http://jcp.org/en/jsr/detail?id=184 Java Community Process, JSR 20 5: Wireless Messaging API 2. 0 http://jcp.org/en/jsr/detail?id =20 5 Java Community Process, JSR 21 1: Content Handler API http://jcp.org/en/jsr/detail?id =21 1 Java Community Process, JSR 22 6: Scalable 2D Vector Graphics API for J2ME http://jcp.org/en/jsr/detail?id =22 6 Java Community Process, JSR 22 9: Payment API... http://jcp.org/en/jsr/detail?id =22 9 Java Community Process, JSR 23 0: Data Sync API http://jcp.org/en/jsr/detail?id =23 0 Java Community Process, JSR 23 2: Mobile Operational Management http://jcp.org/en/jsr/detail?id =23 2 Java Verified Program www.javaverified.com Khronos Group, OpenGL ES www.khronos.org/opengles Macrospace www.macrospace.com O’Doherty, P (20 03) SIP Specifications and the Java Platforms, Sun www.cs.columbia.edu/sip /Java- SIP-Specifications.pdf... www.openmobilealliance.org/docs/DRM %20 Short% 20 Paper %20 DEC %20 2003 %20 .pdf Appendix 5 Specifications of Symbian OS Phones Additional technical information on a range of phones can be found at www .symbian. com/phones Please note that this is a quick guide to Symbian OS phones For full specifications, C++ developers retrieve extended information using HAL APIs or check the manufacturer’s website Programming Java 2 Micro Edition on Symbian. .. An interface for manipulating the audio volume of a Player 434 MIDP LIBRARIES Midlet Classes javax.microedition.midlet.Midlet javax.microedition.midlet.Midlet StateChangeException Superclass for all MIDP applications Signals that a requested MIDlet state change failed Persistent Storage javax.microedition.rms InvalidRecordIDException javax.microedition.rms.RecordComparator javax.microedition.rms.RecordEnumeration... http://jcp.org/en/jsr/detail?id=185 Java Verified Program for J2ME www.javaverified.com Sony Ericsson, Developer Guidelines: Java MIDP 2. 0 for P900/908 Version R3A http://developer.sonyericsson.com 4 42 DEVELOPER RESOURCES AND BIBLIOGRAPHY Sun (20 03) The CLDC HotSpot Implementation Virtual Machine, White Paper http:/ /java. sun.com Symbian, Symbian on Java www .symbian. com/technology/standard -java. html Symbian Phones www .symbian. com/phones . connection must have. Programming Java 2 Micro Edition on Symbian OS: A developer’s guide to MIDP 2. 0 . Martin de Jode  20 04 Symbian Ltd ISBN: 0-470-0 922 3-8 430 MIDP LIBRARIES javax.microedition.io.OutputConnection. J2MECLASSPATH=%J2MEHOME%wtklibkenv.zip; %J2MEHOME%wtklibkvem.jar;%J2MEHOME%wtkliblime.jar; %J2MEHOME%libcldcapi10.jar Programming Java 2 Micro Edition on Symbian OS: A developer’s guide to MIDP 2. 0 . Martin de Jode  20 04 Symbian. Resources Motorola http://idenphones.motorola.com/iden/developer/developer home.jsp Nokia www.forum.nokia.com Programming Java 2 Micro Edition on Symbian OS: A developer’s guide to MIDP 2. 0 . Martin de Jode  20 04 Symbian Ltd ISBN: 0-470-0 922 3-8 440 DEVELOPER RESOURCES

Ngày đăng: 09/08/2014, 18:22

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan