Java Doc for MIDlet.java in  » 6.0-JDK-Modules » j2me » javax » microedition » midlet » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » javax.microedition.midlet 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.microedition.midlet.MIDlet

All known Subclasses:   com.sun.midp.appmanager.SMMManager,  com.sun.midp.installer.SuiteVerifier,  com.sun.midp.installer.DiscoveryApp,  com.sun.midp.appmanager.Manager,  com.sun.midp.installer.AutoTesterBase,  com.sun.midp.main.DummyNamsMIDlet,  com.sun.midp.scriptutil.CommandLineInstaller,  com.sun.midp.scriptutil.SuiteRemover,  com.sun.midp.scriptutil.SuiteLister,  com.sun.midp.demos.manyballs.ManyBalls,  com.sun.midp.main.NamsManager,  com.sun.midp.appmanager.DummyMIDlet1,  com.sun.midp.util.DummyMIDlet2,  examples.SipPushTest,  com.sun.midp.installer.GraphicalInstaller,  com.sun.midp.appmanager.CaManager,  com.sun.midp.content.Invoker,  com.sun.midp.util.DummyMIDlet,  com.sun.midp.demos.HelloWorld,  com.sun.midp.main.NamsTestServiceMidlet,  com.sun.midp.util.LcduiTestMIDlet,  com.sun.midp.i3test.Framework,  com.sun.midp.jsr82emul.ServerLauncher,  com.sun.midp.appmanager.DummyMIDlet2,  com.sun.midp.appmanager.MVMManager,  com.sun.midp.events.FatalMIDlet,  com.sun.midp.scriptutil.HttpJadInstaller,
MIDlet
abstract public class MIDlet (Code)
A MIDlet is a MID Profile application. The application must extend this class to allow the application management software to control the MIDlet and to be able to retrieve properties from the application descriptor and notify and request state changes. The methods of this class allow the application management software to create, start, pause, and destroy a MIDlet. A MIDlet is a set of classes designed to be run and controlled by the application management software via this interface. The states allow the application management software to manage the activities of multiple MIDlets within a runtime environment. It can select which MIDlets are active at a given time by starting and pausing them individually. The application management software maintains the state of the MIDlet and invokes methods on the MIDlet to notify the MIDlet of change states. The MIDlet implements these methods to update its internal activities and resource usage as directed by the application management software. The MIDlet can initiate some state changes itself and notifies the application management software of those state changes by invoking the appropriate methods.

Note: The methods on this interface signal state changes. The state change is not considered complete until the state change method has returned. It is intended that these methods return quickly.




Constructor Summary
protected  MIDlet()
     Protected constructor for subclasses.

Method Summary
final public  intcheckPermission(String permission)
     Get the status of the specified permission. If no API on the device defines the specific permission requested then it must be reported as denied. If the status of the permission is not known because it might require a user interaction then it should be reported as unknown.
Parameters:
  permission - to check if denied, allowed, or unknown.
abstract protected  voiddestroyApp(boolean unconditional)
     Signals the MIDlet to terminate and enter the Destroyed state. In the destroyed state the MIDlet must release all resources and save any persistent state.
final public  StringgetAppProperty(String key)
     Provides a MIDlet with a mechanism to retrieve named properties from the application management software. The properties are retrieved from the combination of the application descriptor file and the manifest. For trusted applications the values in the manifest MUST NOT be overridden by those in the application descriptor.
 MIDletPeergetMIDletPeer()
     Gets the MIDletPeer instance for this MIDlet.
final public  voidnotifyDestroyed()
     Used by an MIDlet to notify the application management software that it has entered into the Destroyed state.
final public  voidnotifyPaused()
     Notifies the application management software that the MIDlet does not want to be active and has entered the Paused state.
abstract protected  voidpauseApp()
     Signals the MIDlet to enter the Paused state. In the Paused state the MIDlet must release shared resources and become quiescent.
final public  booleanplatformRequest(String URL)
    

Requests that the device handle (for example, display or install) the indicated URL.

If the platform has the appropriate capabilities and resources available, it SHOULD bring the appropriate application to the foreground and let the user interact with the content, while keeping the MIDlet suite running in the background.

final public  voidresumeRequest()
     Provides a MIDlet with a mechanism to indicate that it is interested in entering the Active state.
abstract protected  voidstartApp()
     Signals the MIDlet that it has entered the Active state. In the Active state the MIDlet may hold resources. The method will only be called when the MIDlet is in the Paused state.

Two kinds of failures can prevent the service from starting, transient and non-transient.



Constructor Detail
MIDlet
protected MIDlet()(Code)
Protected constructor for subclasses. The application management software is responsible for creating MIDlets and creation of MIDlets is restricted. MIDlets should not attempt to create other MIDlets.
exception:
  java.lang.SecurityException - unless the applicationmanagement software is creating the MIDlet.




Method Detail
checkPermission
final public int checkPermission(String permission)(Code)
Get the status of the specified permission. If no API on the device defines the specific permission requested then it must be reported as denied. If the status of the permission is not known because it might require a user interaction then it should be reported as unknown.
Parameters:
  permission - to check if denied, allowed, or unknown. 0 if the permission is denied; 1 if the permission is allowed;-1 if the status is unknown



destroyApp
abstract protected void destroyApp(boolean unconditional) throws MIDletStateChangeException(Code)
Signals the MIDlet to terminate and enter the Destroyed state. In the destroyed state the MIDlet must release all resources and save any persistent state. This method may be called from the Paused or Active states.

MIDlets should perform any operations required before being terminated, such as releasing resources or saving preferences or state.

Note: The MIDlet can request that it not enter the Destroyed state by throwing an MIDletStateChangeException. This is only a valid response if the unconditional flag is set to false. If it is true the MIDlet is assumed to be in the Destroyed state regardless of how this method terminates. If it is not an unconditional request, the MIDlet can signify that it wishes to stay in its current state by throwing the MIDletStateChangeException. This request may be honored and the destroy() method called again at a later time.

If a Runtime exception occurs during destroyApp then they are ignored and the MIDlet is put into the Destroyed state.
Parameters:
  unconditional - If true when this method is called, theMIDlet must cleanup and release all resources. Iffalse the MIDlet may throwMIDletStateChangeException to indicate it does notwant to be destroyed at this time.
exception:
  MIDletStateChangeException - is thrownif the MIDlet wishes to continue toexecute (Not enter the Destroyed state).This exception is ignored if unconditionalis equal to true.




getAppProperty
final public String getAppProperty(String key)(Code)
Provides a MIDlet with a mechanism to retrieve named properties from the application management software. The properties are retrieved from the combination of the application descriptor file and the manifest. For trusted applications the values in the manifest MUST NOT be overridden by those in the application descriptor. If they differ, the MIDlet will not be installed on the device. For untrusted applications, if an attribute in the descriptor has the same name as an attribute in the manifest the value from the descriptor is used and the value from the manifest is ignored.
Parameters:
  key - the name of the property A string with the value of the property.null is returned if no value is available for thekey.
exception:
  NullPointerException - is thrownif key is null.



getMIDletPeer
MIDletPeer getMIDletPeer()(Code)
Gets the MIDletPeer instance for this MIDlet. MIDletPeer instance for this midlet.



notifyDestroyed
final public void notifyDestroyed()(Code)
Used by an MIDlet to notify the application management software that it has entered into the Destroyed state. The application management software will not call the MIDlet's destroyApp method, and all resources held by the MIDlet will be considered eligible for reclamation. The MIDlet must have performed the same operations (clean up, releasing of resources etc.) it would have if the MIDlet.destroyApp() had been called.



notifyPaused
final public void notifyPaused()(Code)
Notifies the application management software that the MIDlet does not want to be active and has entered the Paused state. Invoking this method will have no effect if the MIDlet is destroyed, or if it has not yet been started.

It may be invoked by the MIDlet when it is in the Active state.

If a MIDlet calls notifyPaused(), in the future its startApp() method may be called make it active again, or its destroyApp() method may be called to request it to destroy itself.

If the application pauses itself it will need to call resumeRequest to request to reenter the active state.




pauseApp
abstract protected void pauseApp()(Code)
Signals the MIDlet to enter the Paused state. In the Paused state the MIDlet must release shared resources and become quiescent. This method will only be called called when the MIDlet is in the Active state.

If a Runtime exception occurs during pauseApp the MIDlet will be destroyed immediately. Its destroyApp will be called allowing the MIDlet to cleanup.




platformRequest
final public boolean platformRequest(String URL) throws javax.microedition.io.ConnectionNotFoundException(Code)

Requests that the device handle (for example, display or install) the indicated URL.

If the platform has the appropriate capabilities and resources available, it SHOULD bring the appropriate application to the foreground and let the user interact with the content, while keeping the MIDlet suite running in the background. If the platform does not have appropriate capabilities or resources available, it MAY wait to handle the URL request until after the MIDlet suite exits. In this case, when the requesting MIDlet suite exits, the platform MUST then bring the appropriate application (if one exists) to the foreground to let the user interact with the content.

This is a non-blocking method. In addition, this method does NOT queue multiple requests. On platforms where the MIDlet suite must exit before the request is handled, the platform MUST handle only the last request made. On platforms where the MIDlet suite and the request can be handled concurrently, each request that the MIDlet suite makes MUST be passed to the platform software for handling in a timely fashion.

If the URL specified refers to a MIDlet suite (either an Application Descriptor or a JAR file), the application handling the request MUST interpret it as a request to install the named package. In this case, the platform's normal MIDlet suite installation process SHOULD be used, and the user MUST be allowed to control the process (including cancelling the download and/or installation). If the MIDlet suite being installed is an update of the currently running MIDlet suite, the platform MUST first stop the currently running MIDlet suite before performing the update. On some platforms, the currently running MIDlet suite MAY need to be stopped before any installations can occur.

If the URL specified is of the form tel:<number>, as specified in RFC2806, then the platform MUST interpret this as a request to initiate a voice call. The request MUST be passed to the "phone" application to handle if one is present in the platform. The "phone" application, if present, MUST be able to set up local and global phone calls and also perform DTMF post dialing. Not all elements of RFC2806 need be implemented, especially the area-specifier or any other requirement on the terminal to know its context. The isdn-subaddress, service-provider and future-extension may also be ignored. Pauses during dialing are not relevant in some telephony services.

Devices MAY choose to support additional URL schemes beyond the requirements listed above.

Many of the ways this method will be used could have a financial impact to the user (e.g. transferring data through a wireless network, or initiating a voice call). Therefore the platform MUST ask the user to explicitly acknowledge each request before the action is taken. Implementation freedoms are possible so that a pleasant user experience is retained. For example, some platforms may put up a dialog for each request asking the user for permission, while other platforms may launch the appropriate application and populate the URL or phone number fields, but not take the action until the user explicitly clicks the load or dial buttons.

true if the MIDlet suite MUST first exit before thecontent can be fetched.
Parameters:
  URL - The URL for the platform to load. An empty string(not null) cancels any pending requests.
exception:
  javax.microedition.io.ConnectionNotFoundException - ifthe platform cannot handle the URL requested.



resumeRequest
final public void resumeRequest()(Code)
Provides a MIDlet with a mechanism to indicate that it is interested in entering the Active state. Calls to this method can be used by the application management software to determine which applications to move to the Active state.

When the application management software decides to activate this application it will call the startApp method.

The application is generally in the Paused state when this is called. Even in the paused state the application may handle asynchronous events such as timers or callbacks.




startApp
abstract protected void startApp() throws MIDletStateChangeException(Code)
Signals the MIDlet that it has entered the Active state. In the Active state the MIDlet may hold resources. The method will only be called when the MIDlet is in the Paused state.

Two kinds of failures can prevent the service from starting, transient and non-transient. For transient failures the MIDletStateChangeException exception should be thrown. For non-transient failures the notifyDestroyed method should be called.

If a Runtime exception occurs during startApp the MIDlet will be destroyed immediately. Its destroyApp will be called allowing the MIDlet to cleanup.
exception:
  MIDletStateChangeException - is thrownif the MIDletcannot start now but might be able to start at alater time.




Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.