الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

How to retrieve system properties in a Midlet

مغلق
بدأه .S.T.A.L.K.E.R في 11 أغسطس 2007 · 0 رد · 660 مشاهدة · في JavaME
مشاركة: واتساب X فيسبوك تيليجرام
#1

في ال Midlet طريقة مباشرة لمعرفة الخصائص الاربعة القياسية للنظام المعرفة من خلال CDLC

import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.midlet.MIDlet;

/* Creates the "Hello world" program in J2ME MIDP.
Note that the class must be public so that the device
application management software can instantiate it. */

public class HelloWorld extends MIDlet
{

  public void startApp() {

	// Create a Displayable widget.
	form = new Form("Hello World");
	// Add a string to the form.
	String msg = "My first MIDlet!";
	form.append(msg);
	// This app simply displays the single form created
	// above.
	display = Display.getDisplay(this);
	display.setCurrent(form);
	printSystemProperties();

  }


/* Prints the values of the standard system properties
using the System.getProperty() call. */

  protected void printSystemProperties()
  {

	String conf;
	String profiles;
	String platform;
	String encoding;
	String locale;

	conf = System.getProperty("microedition.configuration");
	System.out.println(conf);

	profiles = System.getProperty("microedition.profiles");
	System.out.println(profiles);

	platform = System.getProperty("microedition.platform");
	System.out.println(platform);

	encoding = System.getProperty("microedition.encoding");
	System.out.println(encoding);

	locale = System.getProperty("microedition.locale");
	System.out.println(locale);
	System.out.println();
  }
}

هذا الموضوع مغلق.

مواضيع مشابهة