Question : J2me - Getting the phone model, resolution and other properties.

What code should I write to get the phone's model, resolution, screen size, sound formats supported and all other properties?

Thank you very much!

Itsik

Answer : J2me - Getting the phone model, resolution and other properties.

dhasu has correctly identified the method you need to get the screen size.

Additionally, you can use methods in Display to identify whether the device isColor() and the number of colours it supports using numColors().

Note that if isColor() returns false, numColors() refers to the number of grayscale values.

Finally, properties.

The list of properties that should be available is defined in the MIDP specification.  You retrieve properties using System.getProperty().  With this there are two defined properties "microedition.locale" and "microedition.profiles".

You can also use the MIDlet.getAppProperty() method to retrieve data from the Application Management Software (and from the JAR manifest).

Information about the phone model can be extracted at the server end (if you make a network connection), from the HTTP header.

Jim.
Random Solutions  
 
programming4us programming4us