Create the main MIDlet class, which creates and shows the IAPTestForm
class.
Create the IAPInfoMIDlet class file.
Import the required classes.
/* * Copyright © 2007 Nokia. */ package com.nokia.midp.examples.IAPInfoAPI.iapinfotest; import javax.microedition.midlet.*; import javax.microedition.lcdui.*;
Set IAPInfoMIDlet to extend the MIDlet.
/** * IAPInfoMIDlet.java * MIDlet to test the APNInfo implementation * * This class extends the class javax.microedition.midlet.MIDlet. This * class is the entry point in the example application. The IAPInfoMIDlet class * creates and maintains references to an IAPTestForm object. * < p > * Note that the IAPInfoMIDlet class has no constructor. MIDlet constructors * are not required to do anything because initializing of the object is better * performed in the startApp() method. */ public class IAPInfoMIDlet extends MIDlet {
Create the three required MIDlet methods for starting, pausing, and ending the application.
/** * This method is called by the runtime * at starting the MIDlet. * * Creates the IAPTestForm class, the UI creation * is implemented in the IAPTestForm class * */ public void startApp() { try{ IAPTestForm testForm = new IAPTestForm( this ); }catch( Throwable e){ System.out.println ( "EXCEPTION:" + e.getMessage ()) ; System.err.println( "Exception at startApp method:" + e.toString()); e.printStackTrace(); } } public void pauseApp() { ;//do nothing } public void destroyApp( boolean unconditional ) { ;//do nothing } }