list Capabilities : MIDlet « J2ME « Java Tutorial






list Capabilities
import javax.microedition.lcdui.Choice;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.List;
import javax.microedition.midlet.MIDlet;

public class CapabilitiesMIDlet extends MIDlet {
  private String[] capabilitiesIdx = { "microedition.media.version", "supports.mixing",
      "supports.audio.capture", "supports.video.capture", "supports.recording", "audio.encodings",
      "video.encodings", "video.snapshot.encodings", "streamable.contents" };

  public void startApp() {
    List list = new List("Audio/Video Capabilities", Choice.IMPLICIT);
    for (int i = 0; i < capabilitiesIdx.length; ++i) {
      list.append(System.getProperty(capabilitiesIdx[i]) + " - " + capabilitiesIdx[i], null);
    }
    Display.getDisplay(this).setCurrent(list);
  }

  public void pauseApp() {
  }

  public void destroyApp(boolean unconditional) {
  }
}








31.1.MIDlet
31.1.1.Skeleton of a MIDlet
31.1.2.list Capabilitieslist Capabilities
31.1.3.KVM Properties
31.1.4.Retrieving the predefined properties
31.1.5.extends MIDletextends MIDlet
31.1.6.detect and report MIDlet run-time environment
31.1.7.A first MIDlet with simple text and a few commandsA first MIDlet with simple text and a few commands