本文整理汇总了Java中javax.microedition.midlet.MIDletStateChangeException类的典型用法代码示例。如果您正苦于以下问题:Java MIDletStateChangeException类的具体用法?Java MIDletStateChangeException怎么用?Java MIDletStateChangeException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MIDletStateChangeException类属于javax.microedition.midlet包,在下文中一共展示了MIDletStateChangeException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startApp
import javax.microedition.midlet.MIDletStateChangeException; //导入依赖的package包/类
protected void startApp() throws MIDletStateChangeException {
System.out.println("Hello, Dan");
// Socket client test code:
// try {
// String[] args = {"10.0.0.6", "8001"};
// // String[] args = {"www.sun.com"};
// Test.main(args);
// } catch (IOException ex) {
// ex.printStackTrace();
// }
EchoServer.runEchoServer(8007);
notifyDestroyed(); // cause the MIDlet to exit
}
示例2: startApp
import javax.microedition.midlet.MIDletStateChangeException; //导入依赖的package包/类
protected void startApp() throws MIDletStateChangeException {
try {
System.out.println("Hello, EchoTest");
new Thread(new EchoServer(8300)).start();
new Thread(new EchoServer(8301)).start();
EchoServerTest.runEchoServerTest(8300);
EchoServerTest.runEchoServerTest(8301);
EchoServerTest.runEchoServerTest(8302);
new Thread(new EchoServer(8302)).start();
while (true) {
sleep(1000);
}
} finally {
notifyDestroyed(); // cause the MIDlet to exit
}
}
示例3: startApp
import javax.microedition.midlet.MIDletStateChangeException; //导入依赖的package包/类
protected void startApp() throws MIDletStateChangeException {
Isolate.currentIsolate().addLifecycleListener(new Isolate.LifecycleListener() {
public void handleLifecycleListenerEvent(Isolate iso, int event) {
System.out.println("Exiting " + iso);
System.out.flush();
}
},
Isolate.SHUTDOWN_EVENT_MASK);
try {
ServerChannel serverChannel = ServerChannel.create(CHANNEL_NAME);
Isolate isolate = new Isolate(ChildServer.class.getName(), new String[] {}, Isolate.currentIsolate().getClassPath(), Isolate.currentIsolate()
.getParentSuiteSourceURI());
isolate.start();
try {
Channel privateChannel = serverChannel.accept();
} catch (MailboxClosedException ex) {
ex.printStackTrace();
}
isolate.join();
System.out.println("Isolate name: " + isolate);
} catch (MailboxInUseException e) {
e.printStackTrace();
}
}
示例4: destroyApp
import javax.microedition.midlet.MIDletStateChangeException; //导入依赖的package包/类
protected void destroyApp(boolean b) throws MIDletStateChangeException {
notifyDestroyed();
if (registry.framework!=null){
registry.framework.shutdownFramework();
try {
// unregisterConnection returns false if it was
// unsuccessful and true if successful.
String ConnectionUrl=((FrameworkFrontEnd)registry.framework).currentNetwork.connectionURL;
PushRegistry.unregisterConnection(ConnectionUrl);
}
catch(SecurityException e) {
e.printStackTrace();
}
}
}
示例5: exitApplication
import javax.microedition.midlet.MIDletStateChangeException; //导入依赖的package包/类
public void exitApplication(boolean unconditional) {
try {
destroyApp(unconditional);
} catch (MIDletStateChangeException e) {
e.printStackTrace();
}
notifyDestroyed();
}
示例6: startApp
import javax.microedition.midlet.MIDletStateChangeException; //导入依赖的package包/类
protected void startApp() throws MIDletStateChangeException {
try {
System.out.println("Started WebClient application ...");
if(args == null || args.length == 0 || !args[0].equals("ignoreroots")) {
System.out.println("Installing default root cerficates");
installCertificate("Entrust");
installCertificate("Equifax Secure Global eBusiness CA-1");
installCertificate("GeoTrust");
installCertificate("GlobalSign");
installCertificate("GTE CyberTrust Global Root");
installCertificate("Thawte Premium Server CA");
installCertificate("Thawte Server CA");
installCertificate("VeriSign Class 3 Public Primary CA");
installCertificate("VeriSign Class 3 Public Primary Certification Authority - G5");
installCertificate("VeriSign Secure Server Certification Authority");
installCertificate("VeriSign Trust Network");
}
for (int i = 0; i < testURLs.length; i++) {
System.out.println("Testing URL " + testURLs[i]);
System.out.println("Memory available at start: " +
Runtime.getRuntime().freeMemory() + "/" +
Runtime.getRuntime().totalMemory());
runtest(testURLs[i]);
System.out.println("Memory available at end: " +
Runtime.getRuntime().freeMemory() + "/" +
Runtime.getRuntime().totalMemory());
}
System.out.println("\n *** FINISHED WEBCLIENT APPLICATION ***");
} catch (OutOfMemoryError e) {
e.printStackTrace();
}
}
示例7: startApp
import javax.microedition.midlet.MIDletStateChangeException; //导入依赖的package包/类
protected void startApp() throws MIDletStateChangeException {
try {
Test.main(new String[0]);
} finally {
notifyDestroyed();
}
}
示例8: startApp
import javax.microedition.midlet.MIDletStateChangeException; //导入依赖的package包/类
protected void startApp() throws MIDletStateChangeException {
String[] args = {"labs.oracle.com"};
try {
main(args);
} catch (IOException e) {
e.printStackTrace();
}
notifyDestroyed();
}
示例9: startApp
import javax.microedition.midlet.MIDletStateChangeException; //导入依赖的package包/类
protected void startApp() throws MIDletStateChangeException {
int x = 0;
VM.Stats.initHeapStats();
while (true) {
String uri = VM.getCurrentIsolate().getParentSuiteSourceURI();
Hashtable t = new Hashtable();
t.put("spot.diagnostics", "true");
Object sentinal = new Object(); // keep heap stats on objects younger than this one.
launchIso(x, t, uri);
// Utils.sleep(1000);
System.out.println("Live&Dead objects created by isolate start:");
VM.Stats.printHeapStats(sentinal, true);
Runtime.getRuntime().gc();
System.out.print("RAM free after isolate exit: ");
System.out.println(Runtime.getRuntime().freeMemory());
System.out.println("Live objects created by isolate start and remaining after isolate stop:");
VM.Stats.printHeapStats(sentinal, true);
x++;
if (x % 10 == 0) {
Isolate[] isos = Isolate.getIsolates();
for (int i = 0; i < isos.length; i++) {
System.out.println(" Iso " + i + " = " + isos[i]);
}
isos = null;
}
}
}
示例10: onResume
import javax.microedition.midlet.MIDletStateChangeException; //导入依赖的package包/类
@Override
protected void onResume() {
super.onResume();
new Thread(new Runnable() {
public void run()
{
MIDletAccess ma = MIDletBridge.getMIDletAccess(midlet);
if (ma != null) {
try {
ma.startApp();
} catch (MIDletStateChangeException e) {
e.printStackTrace();
}
}
if (contentView != null) {
if (contentView instanceof AndroidRepaintListener) {
((AndroidRepaintListener) contentView).onResume();
}
post(new Runnable() {
public void run() {
contentView.invalidate();
}
});
}
}
}).start();
}
示例11: startApp
import javax.microedition.midlet.MIDletStateChangeException; //导入依赖的package包/类
protected void startApp() throws MIDletStateChangeException {
// TODO Auto-generated method stub
display=Display.getDisplay(this);
list.append("����Ϸ", null);
list.append("�������", null);
list.append("��Ϸ˵��", null);
list.addCommand(cmd_ok);
list.addCommand(cmd_back);
list.setCommandListener(this);
display.setCurrent(list);
predisplay=display.getCurrent(); //��ʼ��ǰһ����ʾ
form=new Form("");
form.addCommand(cmd_back);
form.addCommand(cmd_ok);
}
示例12: destroyApp
import javax.microedition.midlet.MIDletStateChangeException; //导入依赖的package包/类
protected void destroyApp(boolean arg0) throws MIDletStateChangeException
{
try
{
if (iConnection!=null)
iConnection.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
示例13: startApp
import javax.microedition.midlet.MIDletStateChangeException; //导入依赖的package包/类
protected void startApp() throws MIDletStateChangeException{
mainGui = new MainGui();
logGui = new LogGui();
// connectGui = new ConnectGui();
// sendGui = new SendGui();
// Sets the main gui as the current Displayable
showGui(mainGui);
// Gets an instance of the Framework
framework = FrameworkFrontEnd.getInstance(this);
// Setting the name of the MIDlet
midletName = "Registry";
thisClass=this.getClass().getName();
thisMidlet=this;
}
示例14: startApp
import javax.microedition.midlet.MIDletStateChangeException; //导入依赖的package包/类
protected void startApp() throws MIDletStateChangeException {
// DataOutputStreamWrapper dosw = new DataOutputStreamWrapper("Registry.txt");
// try {
// dosw.writeInt(3);
// } catch (IOException e) {
// e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
// }
mainGui = new MainGui();
logGui = new LogGui();
thisMIDlet=this;
showGui(mainGui);
}
示例15: startApp
import javax.microedition.midlet.MIDletStateChangeException; //导入依赖的package包/类
protected void startApp() throws MIDletStateChangeException {
this.recordButton = new StringItem(null, "Start", Item.BUTTON);
Command toggleRecordingCMD = new Command("Click", Command.ITEM, 1);
this.recordButton.addCommand(toggleRecordingCMD);
this.recordButton.setDefaultCommand(toggleRecordingCMD);
this.recordButton.setItemCommandListener(this);
this.form = new Form(null, new Item[] {
new StringItem(null, "Audio Recorder"), this.recordButton });
this.display = Display.getDisplay(this);
this.display.setCurrent(this.form);
}