⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 package-summary.html

📁 是MIDP 的API 查詢文件, 大家可以看一下裡面的index.html, 再用Package 或 Class 名字來查.
💻 HTML
📖 第 1 页 / 共 4 页
字号:
                <CODE>new</CODE>. The public no-argument constructor for the                 <CODE>MIDlet</CODE> is called and returns without throwing an exception.                The application typically does little or no initialization in this                step. If an exception occurs, the application immediately enters                the Destroyed state and is discarded.</P>            </LI>          </UL>          <UL>            <LI>              <P>From the Active state after the              <CODE>MIDlet.pauseApp()</CODE> method is called from the              AMS and returns successfully.</P>            </LI>            <LI>              <P>From the Active state when the                 <CODE>MIDlet.notifyPaused()</CODE> method returns successfully to the                <CODE>MIDlet</CODE>.</P>            </LI>            <LI>              <P>From the Active state if <CODE>startApp</CODE> throws an                 <CODE>MIDletStateChangeException</CODE>.</P>            </LI>          </UL>        </TD>      </TR>      <TR>        <TD width="20%">          <P>Active</P>        </TD>        <TD width="80%">          <P>The <CODE>MIDlet</CODE> is functioning normally. This state is            entered:</P>          <UL>            <LI>              <P>Just prior to the AMS calling the              <CODE>MIDlet.startApp()</CODE> method.</P>            </LI>          </UL>        </TD>      </TR>      <TR>        <TD width="20%">          <P>Destroyed</P>        </TD>        <TD width="80%">          <P>The <CODE>MIDlet</CODE> has released all of its resources and            terminated. This state is entered:</P>          <UL>            <LI>              <P>When the AMS called the              <CODE>MIDlet.destroyApp()</CODE> method and returns              successfully, except in the case when the              <CODE>unconditional</CODE> argument is false and a              <CODE>MIDletStateChangeException</CODE> is thrown. The              <CODE>destroyApp()</CODE> method shall release all              resources held and perform any necessary cleanup so it              may be garbage collected.</P>            </LI>            <LI>              <P>When the <CODE>MIDlet.notifyDestroyed()</CODE> method returns                successfully to the application. The <CODE>MIDlet</CODE> must have                performed the equivalent of the <CODE>MIDlet.destroyApp()</CODE>                method before calling <CODE>MIDlet.notifyDestroyed()</CODE>.</P>            </LI>          </UL>          <P><B>Note:</B> This state is only entered once.</P>        </TD>      </TR>    </TABLE>    <P><BR>      <BR>    </P>    <P>The states and transitions for a <CODE>MIDlet</CODE> are:</P>    <P><IMG src="doc-files/App-States.gif" name="Graphic1" align="LEFT"             width=377 height=309 border="0"><BR clear="LEFT">      <BR>      <BR>    </P>    <H2>MIDlet Lifecycle Model</H2>    <P style="margin-bottom: 0in">A typical sequence of       <CODE>MIDlet</CODE> execution is:</P>        <TABLE width="100%" border="2" cellpadding="2" cellspacing="3">       <TR>        <TH width="66%">          Application Management Software        </TH>        <TH width="34%">          <CODE>MIDlet</CODE>        </TH>      </TR>      <TR>        <TD width="66%">          <P>The application management software creates a new instance of a            <CODE>MIDlet</CODE>.</P>        </TD>        <TD width="34%">          <P>The default (no argument) constructor for the             <CODE>MIDlet</CODE> is called; it is in the Paused state.</P>        </TD>      </TR>      <TR>        <TD width="66%">          <P>The application management software has decided that it is an            appropriate time for the <CODE>MIDlet</CODE> to run, so it calls            the <CODE>MIDlet.startApp</CODE> method for it to enter the Active            state.</P>        </TD>        <TD width="34%">          <P>The <CODE>MIDlet</CODE> acquires any resources it needs and            begins to perform its service.</P>        </TD>      </TR>      <TR>        <TD width="66%">          <P>The application management software wants the MIDlet to	    significantly reduce the amount of resources it is	    consuming, so that they may temporarily be used by other	    functions on the device such as a phone call or running	    another MIDlet. The AMS will signal this request to the	    MIDlet by calling the <CODE>MIDlet.pauseApp</CODE>	    method. The MIDlet should then reduce its resource	    consumption as much as possible.</P>        </TD>        <TD width="34%">          <P>The <CODE>MIDlet</CODE> stops performing its service and might            choose to release some resources it currently holds.</P>        </TD>      </TR>      <TR>        <TD width="66%">          <P>The application management software has determined that the            <CODE>MIDlet</CODE> is no longer needed, or perhaps needs to make            room for a higher priority application in memory, so it signals the            <CODE>MIDlet</CODE> that it is a candidate to be destroyed by            calling the <CODE>MIDlet.destroyApp</CODE> method.</P>        </TD>        <TD width="34%">          <P>If it has been designed to do so, the <CODE>MIDlet</CODE> saves            state or user preferences and performs clean up.</P>        </TD>      </TR>    </TABLE>    <H2>MIDlet Interface</H2>    <UL>      <LI>        <P><CODE>pauseApp</CODE> - the <CODE>MIDlet</CODE> SHOULD release          any temporary resources and become passive</P>      </LI>      <LI>        <P><CODE>startApp</CODE> - the <CODE>MIDlet</CODE>          SHOULD acquire any resources it needs and resume</P>      </LI>      <LI>        <P><CODE>destroyApp</CODE> - the <CODE>MIDlet</CODE> SHOULD save          any state and release all resources</P>      </LI>      <LI>        <P><CODE>notifyDestroyed</CODE> - the <CODE>MIDlet</CODE> notifies          the application management software that it has cleaned up and is          done</P>      </LI>      <LI>        <P><CODE>notifyPaused</CODE> - the <CODE>MIDlet</CODE> notifies the          application management software that it has paused</P>      </LI>      <LI>        <P><CODE>resumeRequest</CODE> - the <CODE>MIDlet</CODE> asks          application management software to be started again</P>      </LI>      <LI>        <P><CODE>getAppProperty</CODE> - gets a named property from the          <CODE>MIDlet</CODE></P>      </LI>    </UL>    <H2>Application Implementation Notes</H2>    <P>The application SHOULD take measures to avoid race conditions in      the execution of the <CODE>MIDlet</CODE> methods. Each method may      need to synchronize itself with the other methods avoid concurrency      problems during state changes.</P>    <H2>Example MIDlet Application</H2>    <P>The example uses the MIDlet lifecycle to do a simple measurement      of the speed of the Java Virtual Machine.</P><PRE><CODE>import javax.microedition.midlet.*;            /**       * An example MIDlet runs a simple timing test       * When it is started by the application management software it will       * create a separate thread to do the test.       * When it finishes it will notify the application management software       * it is done.       * Refer to the startApp, pauseApp, and destroyApp       * methods so see how it handles each requested transition.       */      public class MethodTimes extends MIDlet implements Runnable {          // The state for the timing thread.          Thread thread;                /**           * Start creates the thread to do the timing.           * It should return immediately to keep the dispatcher           * from hanging.           */          public void startApp() {              thread = new Thread(this);              thread.start();          }                /**           * Pause signals the thread to stop by clearing the thread field.           * If stopped before done with the iterations it will           * be restarted from scratch later.           */          public void pauseApp() {              thread = null;          }                /**           * Destroy must cleanup everything.  The thread is signaled           * to stop and no result is produced.           */          public void destroyApp(boolean unconditional) {              thread = null;          }               /**           * Run the timing test, measure how long it takes to           * call a empty method 1000 times.           * Terminate early if the current thread is no longer           * the thread from the           */          public void run() {              Thread curr = Thread.currentThread();  // Remember which thread is current              long start = System.currentTimeMillis();              for (int i = 0; i &lt; 1000000 &amp;&amp; thread == curr; i++) {                  empty();              }              long end = System.currentTimeMillis();                    // Check if timing was aborted, if so just exit              // The rest of the application has already become quiescent.              if (thread != curr) {                  return;              }              long millis = end - start;              // Reporting the elapsed time is outside the scope of this example.                    // All done cleanup and quit              destroyApp(true);              notifyDestroyed();          }                /**           * An Empty method.           */          void empty() {          }      }     </code></PRE>
<P>
<DL>
<DT><B>Since: </B><DD>MIDP 1.0</DD>
</DL>
<HR>

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<strong>MID Profile</strong></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../javax/microedition/media/control/package-summary.html"><B>PREV PACKAGE</B></A>&nbsp;
&nbsp;<A HREF="../../../javax/microedition/pki/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="package-summary.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>
<font size="-1"><a href="mailto:midp-feedback@risc.sps.mot.com">Submit a comment or suggestion</a> Version 2.0 of MID Profile Specification<br>Java is a trademark or registered trademark of Sun Microsystems,  Inc. in the US and other countries. Copyright (c) 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road,Palo Alto, California, 94303, U.S.A.  All Rights Reserved.</font>
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -