javax.microedition.midlet.MIDletStateChangeException Java Examples

The following examples show how to use javax.microedition.midlet.MIDletStateChangeException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Cottage360.java    From pluotsorbet with GNU General Public License v2.0 6 votes vote down vote up
protected void startApp() throws MIDletStateChangeException
{
	DeviceControl.setLights( 0, 100 );
	Display disp = Display.getDisplay( this );
	try
	{
		iCanvas = new PanoramaCanvas( Image.createImage(PHOTO_NAME), this );
		disp.setCurrent( iCanvas );
		iConnection = openAccelerationSensor();
		if (iConnection != null)
			iConnection.setDataListener( this, BUFFER_SIZE );
	}
	catch (IOException e)
	{
		e.printStackTrace();
	}
}
 
Example #2
Source File: FavouriteArtistsMIDlet.java    From pluotsorbet with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Called when the midlet starts.
 */
protected void startApp() throws MIDletStateChangeException {
	initLogging();
	control = new Control(this);
	control.initialize();
	
    /**  
     * VirtualKeyboard is supported for Java Runtime 2.0.0 for Series 40
     * onwards. This hides the open keypad command from the options menu.
     */
           if(System.getProperty("com.nokia.keyboard.type").equals("None"))
           {
               VirtualKeyboard.hideOpenKeypadCommand(true);
           }


}
 
Example #3
Source File: SampleMIDlet.java    From luaj with MIT License 5 votes vote down vote up
protected void startApp() throws MIDletStateChangeException {
	// get the script as an app property
	String script = this.getAppProperty("script");
	if ( script == null )
		script = DEFAULT_SCRIPT;
	
	// create an environment to run in
	Globals globals = JmePlatform.standardGlobals();
	globals.get("require").call( LuaValue.valueOf(script) );
}
 
Example #4
Source File: AudioRecorder.java    From pluotsorbet with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #5
Source File: Cottage360.java    From pluotsorbet with GNU General Public License v2.0 5 votes vote down vote up
protected void destroyApp(boolean arg0) throws MIDletStateChangeException
{
	try
	{
		if (iConnection!=null)
			iConnection.close();
	}
	catch (IOException e)
	{
		e.printStackTrace();
	}
}
 
Example #6
Source File: Cottage360.java    From pluotsorbet with GNU General Public License v2.0 5 votes vote down vote up
public void exit()
{
	try
	{
		destroyApp( true );
	}
	catch (MIDletStateChangeException e)
	{
		e.printStackTrace();
	}
	notifyDestroyed();
}
 
Example #7
Source File: BlogWriter.java    From pluotsorbet with GNU General Public License v2.0 5 votes vote down vote up
protected void destroyApp(boolean unconditional)
        throws MIDletStateChangeException {
    this.display.setCurrent(null);
    this.loginScreen.removeItems();
    this.loginScreen = null;
    this.display = null;
}
 
Example #8
Source File: SampleMIDlet.java    From luaj with MIT License 4 votes vote down vote up
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
}
 
Example #9
Source File: AudioRecorder.java    From pluotsorbet with GNU General Public License v2.0 4 votes vote down vote up
protected void destroyApp(boolean unconditional)
		throws MIDletStateChangeException {
}
 
Example #10
Source File: BlogWriter.java    From pluotsorbet with GNU General Public License v2.0 4 votes vote down vote up
protected void startApp() throws MIDletStateChangeException {
}
 
Example #11
Source File: FavouriteArtistsMIDlet.java    From pluotsorbet with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Destroys the midlet and exit.
 */
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
	if (Log.TEST) Log.note("[destroyApp] ");
	control.exitMidlet();
}
 
Example #12
Source File: MIDletPeer.java    From pluotsorbet with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Forwards destoryApp to the MIDlet.
 *
 * @param unconditional the flag to pass to destroy
 *
 * @exception <code>MIDletStateChangeException</code> is thrown
 *                if the <code>MIDlet</code>
 *          wishes to continue to execute (Not enter the <i>Destroyed</i>
 *          state).
 *          This exception is ignored if <code>unconditional</code>
 *          is equal to <code>true</code>.
 */
void destroyApp(boolean unconditional)
    throws MIDletStateChangeException {
    tunnel.callDestroyApp(midlet, unconditional);
}
 
Example #13
Source File: MIDletPeer.java    From pluotsorbet with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Forwards startApp to the MIDlet.
 *
 * @exception <code>MIDletStateChangeException</code>  is thrown if the
 *                <code>MIDlet</code> cannot start now but might be able
 *                to start at a later time.
 */
void startApp() throws MIDletStateChangeException {
    tunnel.callStartApp(midlet);
}
 
Example #14
Source File: MIDletTunnel.java    From pluotsorbet with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Calls the destroyApp method on the midlet instance.
 *
 * @param m MIDlet instance
 * @param unconditional the flag to pass to destroy
 *
 * @exception javax.microedition.midlet.MIDletStateChangeException 
 *     is thrown if the <code>MIDlet</code> wishes to continue 
 *     to execute (Not enter the <em>Destroyed</em> state).
 *     This exception is ignored if <code>unconditional</code>
 *     is equal to <code>true</code>.
 */
public void callDestroyApp(MIDlet m, boolean unconditional) 
    throws MIDletStateChangeException;
 
Example #15
Source File: MIDletTunnel.java    From pluotsorbet with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Calls the startApp method on the midlet instance.
 *
 * @param m MIDlet instance
 *
 * @exception javax.microedition.midlet.MIDletStateChangeException  
 *     is thrown if the <code>MIDlet</code> cannot start now but 
 *     might be able to start at a later time.
 */
public void callStartApp(MIDlet m) 
    throws MIDletStateChangeException;
 
Example #16
Source File: TCKMidlet.java    From pluotsorbet with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Performs two functions.
 * <pre>
 * 	new TestRunner(this);
 * 	notifyDestroyed();
 * </pre>
 * @see MIDlet#startApp().
 */
protected void startApp() throws MIDletStateChangeException {
	new TestRunner(this);
	notifyDestroyed();
}
 
Example #17
Source File: TCKMidlet.java    From pluotsorbet with GNU General Public License v2.0 2 votes vote down vote up
/**
 * @see MIDlet#destroyApp(boolean)
 */
protected void destroyApp(boolean flag) throws MIDletStateChangeException {
}