ShowProperties.java Source code

Java tutorial

Introduction

Here is the source code for ShowProperties.java

Source

/*--------------------------------------------------
* ShowProperties.java
*
* Example from the book:     Core J2ME Technology
* Copyright John W. Muchow   http://www.CoreJ2ME.com
* You may use/modify for any non-commercial purpose
*-------------------------------------------------*/
import javax.microedition.midlet.*;

public class ShowProperties extends MIDlet {
    public void startApp() throws MIDletStateChangeException {
        System.out.println("Vendor: " + getAppProperty("MIDlet-Vendor"));
        System.out.println("Description: " + getAppProperty("MIDlet-Description"));
        System.out.println("JadFile Version: " + getAppProperty("JadFile-Version"));
        System.out.println("MIDlet-Data-Size: " + getAppProperty("MIDlet-Data-Size"));

        Runtime rtime = Runtime.getRuntime();
        System.out.println("Total memory: " + rtime.totalMemory());
        System.out.println("Free memory: " + rtime.freeMemory());
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }
}