{"id":323,"date":"2007-10-17T00:00:00","date_gmt":"2007-10-17T00:00:00","guid":{"rendered":"http:\/\/www.strongd.net\/?p=323"},"modified":"2007-10-17T00:00:00","modified_gmt":"2007-10-17T00:00:00","slug":"J2ME : Shows the values of the system properties","status":"publish","type":"post","link":"https:\/\/www.strongd.net\/?p=323","title":{"rendered":"J2ME : Shows the values of the system properties"},"content":{"rendered":"<p><FONT face=\"Courier New\"><FONT color=#7f0055><STRONG>import&nbsp;<\/STRONG><\/FONT><FONT color=#000000>javax.microedition.midlet.*;<\/FONT><BR><FONT color=#7f0055><B>import&nbsp;<\/B><\/FONT><FONT color=#000000>javax.microedition.lcdui.*;<\/FONT><BR><FONT color=#ffffff><\/FONT><BR><FONT color=#3f5fbf>\/**<\/FONT><BR><FONT color=#ffffff>&nbsp;<\/FONT><FONT color=#3f5fbf>*&nbsp;A&nbsp;MIDlet&nbsp;shows&nbsp;the&nbsp;values&nbsp;of&nbsp;the&nbsp;system&nbsp;properties.<\/FONT><BR><FONT color=#ffffff>&nbsp;<\/FONT><FONT color=#3f5fbf>*\/<\/FONT><BR><FONT color=#7f0055><B>public&nbsp;class&nbsp;<\/B><\/FONT><FONT color=#000000>MIDletProps&nbsp;<\/FONT><FONT color=#7f0055><B>extends&nbsp;<\/B><\/FONT><FONT color=#000000>MIDlet&nbsp;<\/FONT><FONT color=#7f0055><B>implements&nbsp;<\/B><\/FONT><FONT color=#000000>CommandListener<\/FONT><BR><FONT color=#000000>{<\/FONT><BR><FONT color=#ffffff><\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#7f0055><B>private&nbsp;<\/B><\/FONT><FONT color=#000000>Display&nbsp;display;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#3f7f5f>\/\/&nbsp;The&nbsp;display&nbsp;for&nbsp;this&nbsp;MIDlet<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#7f0055><B>private&nbsp;<\/B><\/FONT><FONT color=#000000>Form&nbsp;props;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#7f0055><B>private&nbsp;<\/B><\/FONT><FONT color=#000000>StringBuffer&nbsp;propbuf;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#7f0055><B>private&nbsp;<\/B><\/FONT><FONT color=#000000>Command&nbsp;exitCommand&nbsp;=&nbsp;<\/FONT><FONT color=#7f0055><B>new&nbsp;<\/B><\/FONT><FONT color=#000000>Command<\/FONT><FONT color=#000000>(<\/FONT><FONT color=#2a00ff>&#8220;Exit&#8221;<\/FONT><FONT color=#000000>,&nbsp;Command.SCREEN,&nbsp;<\/FONT><FONT color=#990000>1<\/FONT><FONT color=#000000>)<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff><\/FONT><BR><FONT color=#ffffff><\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#3f5fbf>\/**<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#3f5fbf>*&nbsp;Construct&nbsp;MIDletProps<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#3f5fbf>*\/<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#7f0055><B>public&nbsp;<\/B><\/FONT><FONT color=#000000>MIDletProps<\/FONT><FONT color=#000000>()&nbsp;{<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>display&nbsp;=&nbsp;Display.getDisplay<\/FONT><FONT color=#000000>(<\/FONT><FONT color=#7f0055><B>this<\/B><\/FONT><FONT color=#000000>)<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>}<\/FONT><BR><FONT color=#ffffff><\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#3f5fbf>\/**<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#3f5fbf>*&nbsp;Show&nbsp;the&nbsp;value&nbsp;of&nbsp;the&nbsp;properties<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#3f5fbf>*\/<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#7f0055><B>public&nbsp;<\/B><\/FONT><FONT color=#7f0055><B>void&nbsp;<\/B><\/FONT><FONT color=#000000>startApp<\/FONT><FONT color=#000000>()&nbsp;{<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>Runtime&nbsp;runtime&nbsp;=&nbsp;Runtime.getRuntime<\/FONT><FONT color=#000000>()<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>runtime.gc<\/FONT><FONT color=#000000>()<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#7f0055><B>long&nbsp;<\/B><\/FONT><FONT color=#000000>free&nbsp;=&nbsp;runtime.freeMemory<\/FONT><FONT color=#000000>()<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#7f0055><B>long&nbsp;<\/B><\/FONT><FONT color=#000000>total&nbsp;=&nbsp;runtime.totalMemory<\/FONT><FONT color=#000000>()<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>propbuf&nbsp;=&nbsp;<\/FONT><FONT color=#7f0055><B>new&nbsp;<\/B><\/FONT><FONT color=#000000>StringBuffer<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#990000>50&nbsp;<\/FONT><FONT color=#000000>)<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>props&nbsp;=&nbsp;<\/FONT><FONT color=#7f0055><B>new&nbsp;<\/B><\/FONT><FONT color=#000000>Form<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#2a00ff>&#8220;System&nbsp;Properties&#8221;&nbsp;<\/FONT><FONT color=#000000>)<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>props.append<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#2a00ff>&#8220;Free&nbsp;Memory&nbsp;=&nbsp;&#8221;&nbsp;<\/FONT><FONT color=#000000>+&nbsp;free&nbsp;+&nbsp;<\/FONT><FONT color=#2a00ff>&#8220;\\n&#8221;&nbsp;<\/FONT><FONT color=#000000>)<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>props.append<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#2a00ff>&#8220;Total&nbsp;Memory&nbsp;=&nbsp;&#8221;&nbsp;<\/FONT><FONT color=#000000>+&nbsp;total&nbsp;+&nbsp;<\/FONT><FONT color=#2a00ff>&#8220;\\n&#8221;&nbsp;<\/FONT><FONT color=#000000>)<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>props.append<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#000000>showProp<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#2a00ff>&#8220;microedition.configuration&#8221;&nbsp;<\/FONT><FONT color=#000000>)&nbsp;)<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>props.append<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#000000>showProp<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#2a00ff>&#8220;microedition.platform&#8221;&nbsp;<\/FONT><FONT color=#000000>)&nbsp;)<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>props.append<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#000000>showProp<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#2a00ff>&#8220;microedition.locale&#8221;&nbsp;<\/FONT><FONT color=#000000>)&nbsp;)<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>props.append<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#000000>showProp<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#2a00ff>&#8220;microedition.encoding&#8221;&nbsp;<\/FONT><FONT color=#000000>)&nbsp;)<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>props.append<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#000000>showProp<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#2a00ff>&#8220;microedition.encodingClass&#8221;&nbsp;<\/FONT><FONT color=#000000>)&nbsp;)<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>props.append<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#000000>showProp<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#2a00ff>&#8220;microedition.http_proxy&#8221;&nbsp;<\/FONT><FONT color=#000000>)&nbsp;)<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>props.addCommand<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#000000>exitCommand&nbsp;<\/FONT><FONT color=#000000>)<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>props.setCommandListener<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#7f0055><B>this&nbsp;<\/B><\/FONT><FONT color=#000000>)<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>display.setCurrent<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#000000>props&nbsp;<\/FONT><FONT color=#000000>)<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff><\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>}<\/FONT><BR><FONT color=#ffffff><\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#3f5fbf>\/**<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#3f5fbf>*&nbsp;Eventhandling&nbsp;code&nbsp;goes&nbsp;into&nbsp;commandAction<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#3f5fbf>*\/<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#7f0055><B>public&nbsp;<\/B><\/FONT><FONT color=#7f0055><B>void&nbsp;<\/B><\/FONT><FONT color=#000000>commandAction<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#000000>Command&nbsp;c,&nbsp;Displayable&nbsp;s&nbsp;<\/FONT><FONT color=#000000>)&nbsp;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>{<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#7f0055><B>if&nbsp;<\/B><\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#000000>c&nbsp;==&nbsp;exitCommand&nbsp;<\/FONT><FONT color=#000000>)&nbsp;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>{<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>destroyApp<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#7f0055><B>false&nbsp;<\/B><\/FONT><FONT color=#000000>)<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>notifyDestroyed<\/FONT><FONT color=#000000>()<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>}&nbsp;&nbsp;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>}<\/FONT><BR><FONT color=#ffffff><\/FONT><BR><FONT color=#ffffff><\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#3f5fbf>\/**<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#3f5fbf>*&nbsp;Show&nbsp;a&nbsp;property.<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#3f5fbf>*\/<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>String&nbsp;showProp<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#000000>String&nbsp;prop&nbsp;<\/FONT><FONT color=#000000>)&nbsp;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>{<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>String&nbsp;value&nbsp;=&nbsp;System.getProperty<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#000000>prop&nbsp;<\/FONT><FONT color=#000000>)<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>propbuf.setLength<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#990000>0&nbsp;<\/FONT><FONT color=#000000>)<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>propbuf.append<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#000000>prop&nbsp;<\/FONT><FONT color=#000000>)<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>propbuf.append<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#2a00ff>&#8221;&nbsp;=&nbsp;&#8221;&nbsp;<\/FONT><FONT color=#000000>)<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#7f0055><B>if&nbsp;<\/B><\/FONT><FONT color=#000000>(<\/FONT><FONT color=#000000>value&nbsp;==&nbsp;<\/FONT><FONT color=#7f0055><B>null<\/B><\/FONT><FONT color=#000000>)&nbsp;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>{<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>propbuf.append<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#2a00ff>&#8220;&lt;undefined&gt;&#8221;&nbsp;<\/FONT><FONT color=#000000>)<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>}&nbsp;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#7f0055><B>else&nbsp;<\/B><\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>{<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>propbuf.append<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#2a00ff>&#8220;\\&#8221;&#8221;&nbsp;<\/FONT><FONT color=#000000>)<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>propbuf.append<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#000000>value&nbsp;<\/FONT><FONT color=#000000>)<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>propbuf.append<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#2a00ff>&#8220;\\&#8221;&#8221;&nbsp;<\/FONT><FONT color=#000000>)<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>}<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>propbuf.append<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#2a00ff>&#8220;\\n&#8221;&nbsp;<\/FONT><FONT color=#000000>)<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#7f0055><B>return&nbsp;<\/B><\/FONT><FONT color=#000000>propbuf.toString<\/FONT><FONT color=#000000>()<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>}<\/FONT><BR><FONT color=#ffffff><\/FONT><BR><FONT color=#ffffff><\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#3f5fbf>\/**<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#3f5fbf>*&nbsp;Time&nbsp;to&nbsp;pause,&nbsp;free&nbsp;any&nbsp;space&nbsp;we&nbsp;don&#8217;t&nbsp;need&nbsp;right&nbsp;now.<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#3f5fbf>*\/<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#7f0055><B>public&nbsp;<\/B><\/FONT><FONT color=#7f0055><B>void&nbsp;<\/B><\/FONT><FONT color=#000000>pauseApp<\/FONT><FONT color=#000000>()&nbsp;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>{<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>display.setCurrent<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#7f0055><B>null&nbsp;<\/B><\/FONT><FONT color=#000000>)<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>propbuf&nbsp;=&nbsp;<\/FONT><FONT color=#7f0055><B>null<\/B><\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>props&nbsp;=&nbsp;<\/FONT><FONT color=#7f0055><B>null<\/B><\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>}<\/FONT><BR><FONT color=#ffffff><\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#3f5fbf>\/**<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#3f5fbf>*&nbsp;No&nbsp;op<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#3f5fbf>*\/<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#7f0055><B>public&nbsp;<\/B><\/FONT><FONT color=#7f0055><B>void&nbsp;<\/B><\/FONT><FONT color=#000000>destroyApp<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#7f0055><B>boolean&nbsp;<\/B><\/FONT><FONT color=#000000>unconditional&nbsp;<\/FONT><FONT color=#000000>)&nbsp;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>{<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>System.out.println<\/FONT><FONT color=#000000>(&nbsp;<\/FONT><FONT color=#2a00ff>&#8220;In&nbsp;destroyApp&#8221;&nbsp;<\/FONT><FONT color=#000000>)<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff><\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>}<\/FONT><BR><FONT color=#ffffff><\/FONT><BR><FONT color=#000000>}<\/FONT><\/FONT><BR><FONT color=#ffffff><\/FONT><BR><br \/>\n<DIV><\/DIV><\/p>\n","protected":false},"excerpt":{"rendered":"<p>import&nbsp;javax.microedition.midlet.*;import&nbsp;javax.microedition.lcdui.*;\/**&nbsp;*&nbsp;A&nbsp;MIDlet&nbsp;shows&nbsp;the&nbsp;values&nbsp;of&nbsp;the&nbsp;system&nbsp;properties.&nbsp;*\/public&nbsp;class&nbsp;MIDletProps&nbsp;extends&nbsp;MIDlet&nbsp;implements&nbsp;CommandListener{&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;Display&nbsp;display;&nbsp;&nbsp;&nbsp;&nbsp;\/\/&nbsp;The&nbsp;display&nbsp;for&nbsp;this&nbsp;MIDlet&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;Form&nbsp;props;&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;StringBuffer&nbsp;propbuf;&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;Command&nbsp;exitCommand&nbsp;=&nbsp;new&nbsp;Command(&#8220;Exit&#8221;,&nbsp;Command.SCREEN,&nbsp;1);&nbsp;&nbsp;&nbsp;&nbsp;\/**&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Construct&nbsp;MIDletProps&nbsp;&nbsp;&nbsp;&nbsp;*\/&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;MIDletProps()&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display&nbsp;=&nbsp;Display.getDisplay(this);&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;\/**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Show&nbsp;the&nbsp;value&nbsp;of&nbsp;the&nbsp;properties&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*\/&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;void&nbsp;startApp()&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Runtime&nbsp;runtime&nbsp;=&nbsp;Runtime.getRuntime();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;runtime.gc();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;long&nbsp;free&nbsp;=&nbsp;runtime.freeMemory();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;long&nbsp;total&nbsp;=&nbsp;runtime.totalMemory();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;propbuf&nbsp;=&nbsp;new&nbsp;StringBuffer(&nbsp;50&nbsp;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;props&nbsp;=&nbsp;new&nbsp;Form(&nbsp;&#8220;System&nbsp;Properties&#8221;&nbsp;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;props.append(&nbsp;&#8220;Free&nbsp;Memory&nbsp;=&nbsp;&#8221;&nbsp;+&nbsp;free&nbsp;+&nbsp;&#8220;\\n&#8221;&nbsp;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;props.append(&nbsp;&#8220;Total&nbsp;Memory&nbsp;=&nbsp;&#8221;&nbsp;+&nbsp;total&nbsp;+&nbsp;&#8220;\\n&#8221;&nbsp;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;props.append(&nbsp;showProp(&nbsp;&#8220;microedition.configuration&#8221;&nbsp;)&nbsp;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;props.append(&nbsp;showProp(&nbsp;&#8220;microedition.platform&#8221;&nbsp;)&nbsp;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;props.append(&nbsp;showProp(&nbsp;&#8220;microedition.locale&#8221;&nbsp;)&nbsp;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;props.append(&nbsp;showProp(&nbsp;&#8220;microedition.encoding&#8221;&nbsp;)&nbsp;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;props.append(&nbsp;showProp(&nbsp;&#8220;microedition.encodingClass&#8221;&nbsp;)&nbsp;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;props.append(&nbsp;showProp(&nbsp;&#8220;microedition.http_proxy&#8221;&nbsp;)&nbsp;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;props.addCommand(&nbsp;exitCommand&nbsp;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;props.setCommandListener(&nbsp;this&nbsp;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display.setCurrent(&nbsp;props&nbsp;);&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;\/**&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Eventhandling&nbsp;code&nbsp;goes&nbsp;into&nbsp;commandAction&nbsp;&nbsp;&nbsp;&nbsp;*\/&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;void&nbsp;commandAction(&nbsp;Command&nbsp;c,&nbsp;Displayable&nbsp;s&nbsp;)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(&nbsp;c&nbsp;==&nbsp;exitCommand&nbsp;)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;destroyApp(&nbsp;false&nbsp;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;notifyDestroyed();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;\/**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Show&nbsp;a&nbsp;property.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*\/&nbsp;&nbsp;&nbsp;String&nbsp;showProp(&nbsp;String&nbsp;prop&nbsp;)&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;value&nbsp;=&nbsp;System.getProperty(&nbsp;prop&nbsp;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;propbuf.setLength(&nbsp;0&nbsp;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;propbuf.append(&nbsp;prop&nbsp;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;propbuf.append(&nbsp;&#8221;&nbsp;=&nbsp;&#8221;&nbsp;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(value&nbsp;==&nbsp;null)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;propbuf.append(&nbsp;&#8220;&lt;undefined&gt;&#8221;&nbsp;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;propbuf.append(&nbsp;&#8220;\\&#8221;&#8221;&nbsp;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;propbuf.append(&nbsp;value&nbsp;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;propbuf.append(&nbsp;&#8220;\\&#8221;&#8221;&nbsp;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;propbuf.append(&nbsp;&#8220;\\n&#8221;&nbsp;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;propbuf.toString();&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;\/**&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Time&nbsp;to&nbsp;pause,&nbsp;free&nbsp;any&nbsp;space&nbsp;we&nbsp;don&#8217;t&nbsp;need&nbsp;right&nbsp;now.&nbsp;&nbsp;&nbsp;&nbsp;*\/&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;void&nbsp;pauseApp()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display.setCurrent(&nbsp;null&nbsp;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;propbuf&nbsp;=&nbsp;null;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;props&nbsp;=&nbsp;null;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;\/**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;No&nbsp;op&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*\/&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;void&nbsp;destroyApp(&nbsp;boolean&nbsp;unconditional&nbsp;)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(&nbsp;&#8220;In&nbsp;destroyApp&#8221;&nbsp;);&nbsp;&nbsp;&nbsp;&nbsp;}}<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-323","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/323","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=323"}],"version-history":[{"count":0,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/323\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=323"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=323"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=323"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}