当前位置: 首页>>代码示例>>Java>>正文


Java MIDletStateChangeException类代码示例

本文整理汇总了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

    }
 
开发者ID:tomatsu,项目名称:squawk,代码行数:17,代码来源:StartApplication.java

示例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
    }

}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:23,代码来源:StartApplication.java

示例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();
	}
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:26,代码来源:DeadlocksOnDesktop.java

示例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();
        }
    }
}
 
开发者ID:meisamhe,项目名称:GPLshared,代码行数:17,代码来源:RegistryMIDlet.java

示例5: exitApplication

import javax.microedition.midlet.MIDletStateChangeException; //导入依赖的package包/类
public void exitApplication(boolean unconditional) {
	try {
		destroyApp(unconditional);
	} catch (MIDletStateChangeException e) {
		e.printStackTrace();
	}
	notifyDestroyed();
}
 
开发者ID:NotesTeam,项目名称:TaskBook-J2ME,代码行数:9,代码来源:MainMidlet.java

示例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();
    }
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:39,代码来源:StartApplication.java

示例7: startApp

import javax.microedition.midlet.MIDletStateChangeException; //导入依赖的package包/类
protected void startApp() throws MIDletStateChangeException {
    try {
        Test.main(new String[0]);
    } finally {
        notifyDestroyed();
    }
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:8,代码来源:SmokeTest.java

示例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();
  }
 
开发者ID:tomatsu,项目名称:squawk,代码行数:10,代码来源:TestSockets.java

示例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;
        }
    }

}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:35,代码来源:IsolateMemoryTest.java

示例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();
}
 
开发者ID:Helltar,项目名称:AMPASIDE,代码行数:32,代码来源:MicroEmulator.java

示例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);
}
 
开发者ID:cabbage89,项目名称:danceGame,代码行数:16,代码来源:Main.java

示例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();
	}
}
 
开发者ID:mozilla,项目名称:pluotsorbet,代码行数:13,代码来源:Cottage360.java

示例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;

    }
 
开发者ID:meisamhe,项目名称:GPLshared,代码行数:16,代码来源:RegistryClient.java

示例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);
    }
 
开发者ID:meisamhe,项目名称:GPLshared,代码行数:13,代码来源:RegistryMIDlet.java

示例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);
}
 
开发者ID:mozilla,项目名称:pluotsorbet,代码行数:14,代码来源:AudioRecorder.java


注:本文中的javax.microedition.midlet.MIDletStateChangeException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。