public class AppUtility
extends java.lang.Object
AppUtility
provides utility methods related to the screen
parameters.
Modifier and Type | Field and Description |
---|---|
static AppUtility |
instance
Deprecated.
Direct member access is discouraged. Use
getInstance() . |
Constructor and Description |
---|
AppUtility() |
Modifier and Type | Method and Description |
---|---|
int |
calculateHeight(javax.microedition.lcdui.Image image,
int newWidth) |
int |
calculateWidth(javax.microedition.lcdui.Image image,
int newHeight) |
int |
convertDpToPixel(int dp)
Deprecated.
Use
RuntimeInfo.dpToPixel(int) . |
static AppUtility |
getInstance()
Global instance of AppUtility to access all members.
|
int |
getRetinaScale()
Deprecated.
Use
RuntimeInfo.getFormFactor() . |
int |
getScreenHeight()
Returns the device screen height.
|
int |
getScreenPPI()
Returns the current screen PPI.
|
int |
getScreenWidth()
Returns the device screen width.
|
boolean |
isEmpty(java.lang.String s)
Checks if the delivered String is null or empty.
|
boolean |
isLandscapeMode() |
boolean |
isRunningOnTablet() |
public static AppUtility instance
getInstance()
.public static AppUtility getInstance()
public int getRetinaScale()
RuntimeInfo.getFormFactor()
.public int getScreenWidth()
public int getScreenHeight()
public int getScreenPPI()
public boolean isLandscapeMode()
public boolean isEmpty(java.lang.String s)
s
- public boolean isRunningOnTablet()
public int calculateHeight(javax.microedition.lcdui.Image image, int newWidth)
image
- image used for the scalingnewWidth
- new width used for the calculation of the scalingpublic int calculateWidth(javax.microedition.lcdui.Image image, int newHeight)
image
- image used for the scalingnewHeight
- new height used for the calculation of the scalingpublic int convertDpToPixel(int dp)
RuntimeInfo.dpToPixel(int)
.dp
-