public class DeviceInfo
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
DeviceInfo.OperatingSystem |
Constructor and Description |
---|
DeviceInfo() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAddress()
Gets the IP-address of the web browser.
|
double |
getAspectRatio() |
java.lang.String |
getBrowserApplication()
Get the browser user-agent string.
|
int |
getBrowserMajorVersion()
Gets the major version of the browser the user is using.
|
int |
getBrowserMinorVersion()
Gets the minor version of the browser the user is using.
|
java.util.Locale |
getLocale()
Get the default locate of the browser.
|
double |
getMaximumDimension() |
double |
getMinimumDimension() |
DeviceInfo.OperatingSystem |
getOperatingSystem() |
int |
getScreenHeight()
Gets the height of the screen in pixels.
|
int |
getScreenWidth()
Gets the width of the screen in pixels.
|
boolean |
isAndroid()
Tests if the browser is run on Android.
|
boolean |
isChrome()
Tests whether the user is using Chrome.
|
boolean |
isChromeFrame()
Tests whether the user is using Chrome Frame.
|
boolean |
isChromeFrameCapable()
Tests whether the user's browser is Chrome Frame capable.
|
boolean |
isEdge()
Tests whether the user is using Edge.
|
boolean |
isFirefox()
Tests whether the user is using Firefox.
|
boolean |
isIE()
Tests whether the user is using Internet Explorer.
|
boolean |
isIOS()
Tests if the browser is run in iOS.
|
boolean |
isIPad()
Tests if the browser is run on IPad.
|
boolean |
isIPhone()
Tests if the browser is run on IPhone.
|
boolean |
isLinux()
Tests whether the user is using Linux.
|
boolean |
isMacOSX()
Tests whether the user is using Mac OS X.
|
boolean |
isOpera()
Tests whether the user is using Opera.
|
boolean |
isSafari()
Tests whether the user is using Safari.
|
boolean |
isSecureConnection()
Is the connection made using HTTPS?
|
boolean |
isTouchDevice() |
boolean |
isWindows()
Tests whether the user is using Windows.
|
boolean |
isWindowsPhone()
Tests whether the user is using Windows Phone.
|
void |
setAddress(java.lang.String address) |
void |
setBrowserApplication(java.lang.String browserApplication) |
void |
setBrowserMajorVersion(int browserMajorVersion) |
void |
setBrowserMinorVersion(int browserMinorVersion) |
void |
setChrome(boolean chrome) |
void |
setChromeFrame(boolean chromeFrame) |
void |
setChromeFrameCapable(boolean chromeFrameCapable) |
void |
setEdge(boolean edge) |
void |
setFirefox(boolean firefox) |
void |
setIE(boolean IE) |
void |
setIPad(boolean IPad) |
void |
setIPhone(boolean IPhone) |
void |
setLocale(java.util.Locale locale) |
void |
setOpera(boolean opera) |
void |
setOperatingSystem(DeviceInfo.OperatingSystem operatingSystem) |
void |
setSafari(boolean safari) |
void |
setScreenHeight(int screenHeight) |
void |
setScreenWidth(int screenWidth) |
void |
setSecureConnection(boolean secureConnection) |
void |
setTouchDevice(boolean touchDevice) |
void |
setWindowsPhone(boolean windowsPhone) |
public int getScreenHeight()
public void setScreenHeight(int screenHeight)
public int getScreenWidth()
public void setScreenWidth(int screenWidth)
public java.lang.String getBrowserApplication()
public void setBrowserApplication(java.lang.String browserApplication)
public java.util.Locale getLocale()
public void setLocale(java.util.Locale locale)
public boolean isSecureConnection()
public void setSecureConnection(boolean secureConnection)
public boolean isFirefox()
public void setFirefox(boolean firefox)
public boolean isIE()
public void setIE(boolean IE)
public boolean isEdge()
public void setEdge(boolean edge)
public boolean isSafari()
public void setSafari(boolean safari)
public boolean isOpera()
public void setOpera(boolean opera)
public boolean isChrome()
public void setChrome(boolean chrome)
public boolean isChromeFrame()
public void setChromeFrame(boolean chromeFrame)
public boolean isChromeFrameCapable()
public void setChromeFrameCapable(boolean chromeFrameCapable)
public int getBrowserMajorVersion()
Note that Internet Explorer in IE7 compatibility mode might return 8 in some cases even though it should return 7.
public void setBrowserMajorVersion(int browserMajorVersion)
public int getBrowserMinorVersion()
getBrowserMajorVersion()
public void setBrowserMinorVersion(int browserMinorVersion)
public boolean isLinux()
public boolean isMacOSX()
public boolean isWindows()
public boolean isWindowsPhone()
public void setWindowsPhone(boolean windowsPhone)
public boolean isAndroid()
public boolean isIOS()
public boolean isIPhone()
public void setIPhone(boolean IPhone)
public boolean isIPad()
public void setIPad(boolean IPad)
public boolean isTouchDevice()
public void setTouchDevice(boolean touchDevice)
public java.lang.String getAddress()
public void setAddress(java.lang.String address)
public DeviceInfo.OperatingSystem getOperatingSystem()
DeviceInfo.OperatingSystem
public void setOperatingSystem(DeviceInfo.OperatingSystem operatingSystem)
public double getAspectRatio()
public double getMaximumDimension()
getScreenHeight()
and getScreenWidth()
public double getMinimumDimension()
getScreenHeight()
and getScreenWidth()