import javax.microedition.midlet.MIDlet;
import java.lang.*;
import java.io.*;
import javax.obex.*;
import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.AlertType;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.io.*;

import javax.microedition.media.*;

import javax.bluetooth.*;

import javax.wireless.messaging.*;

public class TestCommand extends MIDlet
{
private Form form;

private Display display;

String conf, jsr, media, blue, message, platform ;

// private final String ALERT_LABEL = conf;    //"Кнопа ;-)"
// private final String ALERT_LABEL1 = jsr;      //"Кнопа :-(";

private Alert alert;

private Command showAlert;
private Command sayHi;

//private MyCommandListener cl = new MyCommandListener();

public  TestCommand()
{
   super();
}

public void destroyApp(boolean destroy)
{
   form = null;
   notifyDestroyed();
}
public void pauseApp()
{
}
public void startApp()
{
  form = new Form("Test JAVA from Awanas & Satas");
  String msg = " test ";

  printSystemProperties(); 

  form.append(conf +" \n" + platform + " \n jsr-75: " + jsr + " \n jsr-135: " + media + " \n jsr-82: " + blue + " \n jsr-120: " + message );

  // form.setCommandListener(cl);

    
/*
   showAlert = new Command(conf, Command.SCREEN, 1);
   form.addCommand(showAlert); 

   sayHi = new Command(jsr, Command.SCREEN, 1);  //"Кнопа :-("
   form.addCommand(sayHi);
*/
    

   display = Display.getDisplay(this);
   display.setCurrent(form);
}



protected void printSystemProperties()
{
 //String conf;
 
 conf = System.getProperty("microedition.configuration");
 //System.out.println(conf); 

  // showAlert = new Command(conf, Command.SCREEN, 1);
  // form.addCommand(showAlert); 

jsr = System.getProperty("microedition.io.file.FileConnection.version");
media = System.getProperty("microedition.media.version");
//media = System.getProperty("microedition.media.supports.audio.capture");

blue = System.getProperty("obex.api.version");
//blue = System.getProperty("bluetooth.api.version");
 

// message = System.getProperty("microedition.wireless.messaging.version");
message = System.getProperty("wireless.messaging.version");

platform = System.getProperty("microedition.profiles");
  
}

/*
   private class MyCommandListener
   implements CommandListener
{


   public void commandAction(Command c, Displayable d)
{
   if (c == showAlert)
    {
     alert = new Alert("Событие", "Нажата клавиша '" + conf + 
                                     "' " , null, AlertType.INFO);
    }
   else if (c == sayHi)
     {
      alert = new Alert("Событие", "Нажата клавиша '" + "jsr-75 " + jsr + 
                                     "' " , null, AlertType.INFO);
     }
   alert.setTimeout(Alert.FOREVER);
   display.setCurrent(alert, form);
   }
  }
*/
 }



