1. Trang chủ
  2. » Công Nghệ Thông Tin

Programming Java 2 Micro Edition on Symbian OS A developer’s guide to MIDP 2.0 phần 10 pptx

50 351 0

Đ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

Thông tin cơ bản

Định dạng
Số trang 50
Dung lượng 401,04 KB

Nội dung

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. [...]... 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 used to control some media processing functions An interface...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... 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 javax.microedition.rms.RecordFilter... specifications, C++ developers retrieve extended information using HAL APIs or check the manufacturer’s website 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 446 SPECIFICATIONS OF SYMBIAN OS PHONES Nokia 921 0i Java APIs CLDC 1.0 MIDP 1.0 PersonalJava 1.1.1 JavaPhone OS Version UI/Category Memory available to user Storage... 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 could not be completed because the record ID was invalid An interface used to. .. certificates Encapsulates an error that occurred while a certificate is being used Core Packages java. io java. lang java. lang.ref java. lang.reflect java. math java. net java. security java. security.cert Provides the system input and output through data streams and serialization Provides the classes that are fundamental to the design of the Java language For example, Object, which is the root of the class hierarchy... contain a string A screen that allows the user to enter and edit text An editable text component that may be placed in a Form Implements a ”ticker tape”, a piece of text that runs continuously across the display Game API java. microedition.lcdui.game.GameCanvas This class provides the basis for a game user interface MIDLET CLASSES java. microedition.lcdui.game.Layer java. microedition.lcdui.game LayerManager... LayerManager java. microedition.lcdui.game.Sprite java. microedition.lcdui.game.TiledLayer 433 An abstract class representing a visual element of a game The LayerManager manages a series of Layers A basic visual element that can be rendered with one of several frames stored in an image; different frames can be shown to animate the Sprite A visual element composed of a grid of cells that can be filled with a. .. Grand, M and Knudsen, J (1997) Java Fundamental Classes Reference, O’Reilly Haggar, P (20 00) Practical Java Programming Language Guide, AddisonWesley Knuth, D E (1997) The Art of Computer Programming Addison Wesley Larman, C and Guthrie, R (1999) Java 2 Performance and Idiom Guide Prentice Hall Lurie, J (20 01) Develop a Generic Caching Service to Improve Performance, Java World www.javaworld.com/javaworld/jw-07 -20 01/jw-0 720 cache... Provides classes and interfaces for parsing and managing certificates 436 java. text java. util java. util.jar java. util.zip javax.microedition.io MIDP LIBRARIES Provides classes and interfaces for handling text, dates, numbers and messages in a manner independent of natural languages Provides classes which contain the collections framework, legacy collection classes, event model, date and time facilities, . graphical image data. javax.microedition.lcdui.ImageItem An Item that contains an image. javax.microedition.lcdui.Item A superclass for components that can be added to a Form. javax.microedition.lcdui. ItemCommandListener This. J2MECLASSPATH=%J2MEHOME%wtklibkenv.zip; %J2MEHOME%wtklibkvem.jar;%J2MEHOME%wtkliblime.jar; %J2MEHOME%libcldcapi 10. 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- 4 70- 0 922 3-8 438 USING THE WIRELESS TOOLKIT. 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

Ngày đăng: 12/08/2014, 23:22

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN