|
|
|
|
Get Device Screen Size - J2ME
Posted:
Aug 28, 2008 12:10 AM
|
|
|
|
|
Hi,
I am developing application for MIDP 2.0 based devices and and i would like to fetch mobile device screen size programmatically. Is there any way through which i can get device screen size/resolution?
Any help and support is much appreciated. Thank you.
Best Regards, Ankit
=========================================================================== To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff KVM-INTEREST". For general help, send email to listserv@java.sun.com and include in the body of the message "help". [att1.html]
|
|
|
|
|
|
|
Re: Get Device Screen Size - J2ME
Posted:
Aug 28, 2008 12:30 AM
in response to: Ankit Shah
|
|
|
|
|
Hi Ankit, Please use " Displayable.getWidth() / getHeight()...." .
Best regards, Abhinav Impetus -----Original Message----- From: A mailing list for KVM discussion [mailto:KVM-INTEREST@JAVA.SUN.COM] On Behalf Of Ankit Shah Sent: Thursday, August 28, 2008 12:41 PM To: KVM-INTEREST@JAVA.SUN.COM Subject: Get Device Screen Size - J2ME
Hi,
I am developing application for MIDP 2.0 based devices and and i would like to fetch mobile device screen size programmatically. Is there any way through which i can get device screen size/resolution?
Any help and support is much appreciated. Thank you.
Best Regards, Ankit =========================================================================== To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff KVM-INTEREST". For general help, send email to listserv@java.sun.com and include in the body of the message "help".
________________________________ NOTE: This message may contain information that is confidential, proprietary, privileged or otherwise protected by law. The message is intended solely for the named addressee. If received in error, please destroy and notify the sender. Any use of this email is prohibited when received in error. Impetus does not represent, warrant and/or guarantee, that the integrity of this communication has been maintained nor that the communication is free of errors, virus, interception or interference.
Impetus is the winner of the Economic Times Intel Smart Workplace Awards 2008 and the CNBC emerging India 2008. Visit www.impetus.com for details.
=========================================================================== To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff KVM-INTEREST". For general help, send email to listserv@java.sun.com and include in the body of the message "help". [att1.html]
|
|
|
|
|
|
|
|
Re: Get Device Screen Size - J2ME
Posted:
Jun 30, 2009 11:30 PM
in response to: Abhinav Holkar
|
|
|
Hi,
I am using J2ME lwuit. In this Displayable is not recognized.
Kindly suggest how can i get the screen resolution/size.
|
|
|
|
|
|
|
|
Re: Get Device Screen Size - J2ME
Posted:
Jul 1, 2009 7:51 AM
in response to: ims_lab
|
|
|
Just create an Alert object and use that.
Alert tmp = new Alert("just getting screen size"); int w = tmp.getWidth(); int h = tmp.getHeight(); tmp = null;
You don't have to put it on the screen... and you can pass in a blank string "" to the constructor if you want. If there is an Alert in LWUIT then fully qualify the class name javax.microedition.lcdui.Alert
-Shawn
|
|
|
|
|
|
|
|
Re: Get Device Screen Size - J2ME
Posted:
Jul 1, 2009 8:47 PM
in response to: sfitzjava
|
|
|
I did that using Display.getInstance().getDisplayWidth() and Display.getInstance().getDisplayHeight().
This gives same result as getWidth() and getHeight(). So any can be used.
Thank you!
|
|
|
|
|