Package org.opencms.jsp.util
Class UAgentInfo
java.lang.Object
org.opencms.jsp.util.UAgentInfo
The DetectSmartPhone class encapsulates information about
a browser's connection to your web site.
You can use it to find out whether the browser asking for
your site's content is probably running on a mobile device.
The methods were written so you can be as granular as you want.
For example, enquiring whether it's as specific as an iPod Touch or
as general as a smartphone class device.
The object's methods return true, or false.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
ConstructorDescriptionUAgentInfo
(String userAgent, String httpAccept) Initialize the userAgent and httpAccept variables -
Method Summary
Modifier and TypeMethodDescriptionboolean
Detects if the current Amazon device is using the Silk Browser.boolean
Detects *any* Android OS-based device: phone, tablet, and multi-media player.boolean
Detects if the current device is a (small-ish) Android OS-based device used for calling and/or multi-media (like a Samsung Galaxy Player).boolean
Detects if the current device is a (self-reported) Android tablet.boolean
Detects if the current device is an Android OS-based device and the browser is based on WebKit.boolean
Detects if the current device is an Archos media player/Internet tablet.boolean
Detects a device running the Bada OS from Samsung.boolean
Detects if the current browser is any BlackBerry.boolean
Detects if the current browser is a BlackBerry 10 OS phone.boolean
Detects if the current browser is a BlackBerry device AND has a more capable recent browser.boolean
Detects if the current browser is a BlackBerry device AND has an older, less capable browser.boolean
Detects if the current browser is on a BlackBerry tablet device.boolean
Detects if the current browser is a BlackBerry Touch device, such as the Storm, Torch, and Bold Touch.boolean
Detects if the current browser is a BlackBerry device AND uses a WebKit-based browser.boolean
Detects whether the device is a Brew-powered device.boolean
Detects the Danger Hiptop device.boolean
Detects a mobile device (probably) running the Firefox OS.boolean
Detects a phone (probably) running the Firefox OS.boolean
Detects a tablet (probably) running the Firefox OS.boolean
Detects if the current device is an Internet-capable game console.boolean
Detects if the current device is a handheld gaming device with a touchscreen and modern iPhone-class browser.boolean
Detects if the current browser is a Garmin Nuvifone.boolean
Detects if the current device is a GoogleTV.boolean
Detects *any* iOS device: iPhone, iPod Touch, iPad.boolean
Detects if the current device is an iPad tablet.boolean
Detects if the current device is an iPhone.boolean
Detects if the current device is an iPhone or iPod Touch.boolean
Detects if the current device is an iPod Touch.boolean
Detects if the current device is an Amazon Kindle (eInk devices only).boolean
Detects if the current device is on one of the Maemo-based Nokia Internet Tablets.boolean
Detects a device running the Meego OS.boolean
Detects a phone running the Meego OS.boolean
Detects if the current device supports MIDP, a mobile Java technology.boolean
The longer and more thorough way to detect for a mobile device.boolean
Detects if the current device is a mobile device.boolean
Detects if the current device is a Nintendo game device.boolean
Detects Opera Mobile or Opera Mini.boolean
Detects if the current browser is on a PalmOS device.boolean
Detects if the current browser is on a Palm device running the new WebOS.boolean
Detects if the current browser is the Symbian S60 Open Source Browser.boolean
Detects a device running the Sailfish OS.boolean
Detects a phone running the Sailfish OS.boolean
Check to see whether the device is any device in the 'smartphone' category.boolean
Detects if the current browser is a Sony Mylo device.boolean
Detects if the current device is a Sony Playstation.boolean
Detects if the current device is any Symbian OS-based device, including older S60, Series 70, Series 80, Series 90, and UIQ, or other browsers running on these devices.boolean
The quick way to detect for a tier of devices.boolean
The quick way to detect for a tier of devices.boolean
The quick way to detect for a tier of devices.boolean
The quick way to detect for a tier of devices.boolean
Detects a device running the Tizen smartphone OS.boolean
Detects if the current browser is on a Tizen smart TV.boolean
Detects a mobile device running the Ubuntu Mobile OS.boolean
Detects a phone running the Ubuntu Mobile OS.boolean
Detects a tablet running the Ubuntu Mobile OS.boolean
Detects whether the device supports WAP or WML.boolean
Detects if the current browser is based on WebKit.boolean
Detects if the current browser is on an HP tablet running WebOS.boolean
Detects if the current browser is on a WebOS smart TV.boolean
Detects if the current browser is a Windows Mobile device.boolean
Detects if the current browser is a Windows Phone 7.x, 8, or 10 deviceboolean
Detects a Windows Phone 10 device (in mobile browsing mode).boolean
Detects a Windows Phone 7 device (in mobile browsing mode).boolean
Detects a Windows Phone 8 device (in mobile browsing mode).boolean
Detects if the current device is a Microsoft Xbox.Return the lower case HTTP_ACCEPTboolean
Return whether the device is an Iphone or iPod Touchboolean
Return whether the device is a generic, less-capable mobile device.boolean
Return whether the device is in the Iphone Tier.boolean
Return whether the device is in the 'Rich CSS' tier of mobile devices.boolean
Return whether the device is in the Tablet Tier.Return the lower case HTTP_USER_AGENTvoid
Initialize Key Stored Values.
-
Field Details
-
engineWebKit
- See Also:
-
deviceIphone
- See Also:
-
deviceIpod
- See Also:
-
deviceIpad
- See Also:
-
deviceMacPpc
- See Also:
-
deviceAndroid
- See Also:
-
deviceGoogleTV
- See Also:
-
deviceWinPhone7
- See Also:
-
deviceWinPhone8
- See Also:
-
deviceWinPhone10
- See Also:
-
deviceWinMob
- See Also:
-
deviceWindows
- See Also:
-
deviceIeMob
- See Also:
-
devicePpc
- See Also:
-
enginePie
- See Also:
-
deviceBB
- See Also:
-
deviceBB10
- See Also:
-
vndRIM
- See Also:
-
deviceBBStorm
- See Also:
-
deviceBBBold
- See Also:
-
deviceBBBoldTouch
- See Also:
-
deviceBBTour
- See Also:
-
deviceBBCurve
- See Also:
-
deviceBBCurveTouch
- See Also:
-
deviceBBTorch
- See Also:
-
deviceBBPlaybook
- See Also:
-
deviceSymbian
- See Also:
-
deviceS60
- See Also:
-
deviceS70
- See Also:
-
deviceS80
- See Also:
-
deviceS90
- See Also:
-
devicePalm
- See Also:
-
deviceWebOS
- See Also:
-
deviceWebOStv
- See Also:
-
deviceWebOShp
- See Also:
-
deviceNuvifone
- See Also:
-
deviceBada
- See Also:
-
deviceTizen
- See Also:
-
deviceMeego
- See Also:
-
deviceSailfish
- See Also:
-
deviceUbuntu
- See Also:
-
deviceKindle
- See Also:
-
engineSilk
- See Also:
-
engineBlazer
- See Also:
-
engineXiino
- See Also:
-
vndwap
- See Also:
-
wml
- See Also:
-
deviceTablet
- See Also:
-
deviceBrew
- See Also:
-
deviceDanger
- See Also:
-
deviceHiptop
- See Also:
-
devicePlaystation
- See Also:
-
devicePlaystationVita
- See Also:
-
deviceNintendoDs
- See Also:
-
deviceNintendo
- See Also:
-
deviceWii
- See Also:
-
deviceXbox
- See Also:
-
deviceArchos
- See Also:
-
engineFirefox
- See Also:
-
engineOpera
- See Also:
-
engineNetfront
- See Also:
-
engineUpBrowser
- See Also:
-
engineOpenWeb
- See Also:
-
deviceMidp
- See Also:
-
uplink
- See Also:
-
engineTelecaQ
- See Also:
-
devicePda
- See Also:
-
mini
- See Also:
-
mobile
- See Also:
-
mobi
- See Also:
-
smartTV1
- See Also:
-
smartTV2
- See Also:
-
maemo
- See Also:
-
linux
- See Also:
-
qtembedded
- See Also:
-
mylocom2
- See Also:
-
manuSonyEricsson
- See Also:
-
manuericsson
- See Also:
-
manuSamsung1
- See Also:
-
manuSony
- See Also:
-
manuHtc
- See Also:
-
svcDocomo
- See Also:
-
svcKddi
- See Also:
-
svcVodafone
- See Also:
-
disUpdate
- See Also:
-
initCompleted
-
isWebkit
-
isMobilePhone
-
isIphone
-
isAndroid
-
isAndroidPhone
-
isTierTablet
-
isTierIphone
-
isTierRichCss
-
isTierGenericMobile
-
-
Constructor Details
-
UAgentInfo
Initialize the userAgent and httpAccept variables- Parameters:
userAgent
- the User-Agent headerhttpAccept
- the Accept header
-
-
Method Details
-
detectAmazonSilk
Detects if the current Amazon device is using the Silk Browser. Note: Typically used by the the Kindle Fire.- Returns:
- detection of an Amazon Kindle Fire in Silk mode.
-
detectAndroid
Detects *any* Android OS-based device: phone, tablet, and multi-media player. Also detects Google TV.- Returns:
- detection of an Android device
-
detectAndroidPhone
Detects if the current device is a (small-ish) Android OS-based device used for calling and/or multi-media (like a Samsung Galaxy Player). Google says these devices will have 'Android' AND 'mobile' in user agent. Ignores tablets (Honeycomb and later).- Returns:
- detection of an Android phone
-
detectAndroidTablet
Detects if the current device is a (self-reported) Android tablet. Google says these devices will have 'Android' and NOT 'mobile' in their user agent.- Returns:
- detection of an Android tablet
-
detectAndroidWebKit
Detects if the current device is an Android OS-based device and the browser is based on WebKit.- Returns:
- detection of an Android WebKit browser
-
detectArchos
Detects if the current device is an Archos media player/Internet tablet.- Returns:
- detection of an Archos media player
-
detectBada
Detects a device running the Bada OS from Samsung.- Returns:
- detection of a Bada device
-
detectBlackBerry
Detects if the current browser is any BlackBerry. Includes BB10 OS, but excludes the PlayBook.- Returns:
- detection of Blackberry
-
detectBlackBerry10Phone
Detects if the current browser is a BlackBerry 10 OS phone. Excludes tablets.- Returns:
- detection of a Blackberry 10 device
-
detectBlackBerryHigh
Detects if the current browser is a BlackBerry device AND has a more capable recent browser. Excludes the Playbook. Examples, Storm, Bold, Tour, Curve2 Excludes the new BlackBerry OS 6 and 7 browser!!- Returns:
- detection of a Blackberry device with a better browser
-
detectBlackBerryLow
Detects if the current browser is a BlackBerry device AND has an older, less capable browser. Examples: Pearl, 8800, Curve1- Returns:
- detection of a Blackberry device with a poorer browser
-
detectBlackBerryTablet
Detects if the current browser is on a BlackBerry tablet device. Example: PlayBook- Returns:
- detection of a Blackberry Tablet
-
detectBlackBerryTouch
Detects if the current browser is a BlackBerry Touch device, such as the Storm, Torch, and Bold Touch. Excludes the Playbook.- Returns:
- detection of a Blackberry touchscreen device
-
detectBlackBerryWebKit
Detects if the current browser is a BlackBerry device AND uses a WebKit-based browser. These are signatures for the new BlackBerry OS 6. Examples: Torch. Includes the Playbook.- Returns:
- detection of a Blackberry device with WebKit browser
-
detectBrewDevice
Detects whether the device is a Brew-powered device.- Returns:
- detection of a Brew device
-
detectDangerHiptop
Detects the Danger Hiptop device.- Returns:
- detection of a Danger Hiptop
-
detectFirefoxOS
Detects a mobile device (probably) running the Firefox OS.- Returns:
- detection of a Firefox OS mobile device
-
detectFirefoxOSPhone
Detects a phone (probably) running the Firefox OS.- Returns:
- detection of a Firefox OS phone
-
detectFirefoxOSTablet
Detects a tablet (probably) running the Firefox OS.- Returns:
- detection of a Firefox OS tablet
-
detectGameConsole
Detects if the current device is an Internet-capable game console. Includes many handheld consoles.- Returns:
- detection of any Game Console
-
detectGamingHandheld
Detects if the current device is a handheld gaming device with a touchscreen and modern iPhone-class browser. Includes the Playstation Vita.- Returns:
- detection of a handheld gaming device
-
detectGarminNuvifone
Detects if the current browser is a Garmin Nuvifone.- Returns:
- detection of a Garmin Nuvifone
-
detectGoogleTV
Detects if the current device is a GoogleTV.- Returns:
- detection of GoogleTV
-
detectIos
Detects *any* iOS device: iPhone, iPod Touch, iPad.- Returns:
- detection of an Apple iOS device
-
detectIpad
Detects if the current device is an iPad tablet.- Returns:
- detection of an iPad
-
detectIphone
Detects if the current device is an iPhone.- Returns:
- detection of an iPhone
-
detectIphoneOrIpod
Detects if the current device is an iPhone or iPod Touch.- Returns:
- detection of an iPhone or iPod Touch
-
detectIpod
Detects if the current device is an iPod Touch.- Returns:
- detection of an iPod Touch
-
detectKindle
Detects if the current device is an Amazon Kindle (eInk devices only). Note: For the Kindle Fire, use the normal Android methods.- Returns:
- detection of a Kindle
-
detectMaemoTablet
Detects if the current device is on one of the Maemo-based Nokia Internet Tablets.- Returns:
- detection of a Maemo OS tablet
-
detectMeego
Detects a device running the Meego OS.- Returns:
- detection of a Meego device
-
detectMeegoPhone
Detects a phone running the Meego OS.- Returns:
- detection of a Meego phone
-
detectMidpCapable
Detects if the current device supports MIDP, a mobile Java technology.- Returns:
- detection of a MIDP mobile Java-capable device
-
detectMobileLong
The longer and more thorough way to detect for a mobile device. Will probably detect most feature phones, smartphone-class devices, Internet Tablets, Internet-enabled game consoles, etc. This ought to catch a lot of the more obscure and older devices, also -- but no promises on thoroughness!- Returns:
- detection of any mobile device using the more thorough method
-
detectMobileQuick
Detects if the current device is a mobile device. This method catches most of the popular modern devices. Excludes Apple iPads and other modern tablets.- Returns:
- detection of any mobile device using the quicker method
-
detectNintendo
Detects if the current device is a Nintendo game device.- Returns:
- detection of Nintendo
-
detectOperaMobile
Detects Opera Mobile or Opera Mini.- Returns:
- detection of an Opera browser for a mobile device
-
detectPalmOS
Detects if the current browser is on a PalmOS device.- Returns:
- detection of a PalmOS device
-
detectPalmWebOS
Detects if the current browser is on a Palm device running the new WebOS.- Returns:
- detection of a Palm WebOS device
-
detectS60OssBrowser
Detects if the current browser is the Symbian S60 Open Source Browser.- Returns:
- detection of Symbian S60 Browser
-
detectSailfish
Detects a device running the Sailfish OS.- Returns:
- detection of a Sailfish device
-
detectSailfishPhone
Detects a phone running the Sailfish OS.- Returns:
- detection of a Sailfish phone
-
detectSmartphone
Check to see whether the device is any device in the 'smartphone' category.- Returns:
- detection of a general smartphone device
-
detectSonyMylo
Detects if the current browser is a Sony Mylo device.- Returns:
- detection of a Sony Mylo device
-
detectSonyPlaystation
Detects if the current device is a Sony Playstation.- Returns:
- detection of Sony Playstation
-
detectSymbianOS
Detects if the current device is any Symbian OS-based device, including older S60, Series 70, Series 80, Series 90, and UIQ, or other browsers running on these devices.- Returns:
- detection of SymbianOS
-
detectTierIphone
The quick way to detect for a tier of devices. This method detects for devices which can display iPhone-optimized web content. Includes iPhone, iPod Touch, Android, Windows Phone 7 and 8, BB10, WebOS, Playstation Vita, etc.- Returns:
- detection of any device in the iPhone/Android/Windows Phone/BlackBerry/WebOS Tier
-
detectTierOtherPhones
The quick way to detect for a tier of devices. This method detects for all other types of phones, but excludes the iPhone and RichCSS Tier devices.- Returns:
- detection of a mobile device in the less capable tier
-
detectTierRichCss
The quick way to detect for a tier of devices. This method detects for devices which are likely to be capable of viewing CSS content optimized for the iPhone, but may not necessarily support JavaScript. Excludes all iPhone Tier devices.- Returns:
- detection of any device in the 'Rich CSS' Tier
-
detectTierTablet
The quick way to detect for a tier of devices. This method detects for the new generation of HTML 5 capable, larger screen tablets. Includes iPad, Android (e.g., Xoom), BB Playbook, WebOS, etc.- Returns:
- detection of any device in the Tablet Tier
-
detectTizen
Detects a device running the Tizen smartphone OS.- Returns:
- detection of a Tizen device
-
detectTizenTV
Detects if the current browser is on a Tizen smart TV.- Returns:
- detection of a Tizen smart TV
-
detectUbuntu
Detects a mobile device running the Ubuntu Mobile OS.- Returns:
- detection of an Ubuntu Mobile OS mobile device
-
detectUbuntuPhone
Detects a phone running the Ubuntu Mobile OS.- Returns:
- detection of an Ubuntu Mobile OS phone
-
detectUbuntuTablet
Detects a tablet running the Ubuntu Mobile OS.- Returns:
- detection of an Ubuntu Mobile OS tablet
-
detectWapWml
Detects whether the device supports WAP or WML.- Returns:
- detection of a WAP- or WML-capable device
-
detectWebkit
Detects if the current browser is based on WebKit.- Returns:
- detection of a WebKit browser
-
detectWebOSTablet
Detects if the current browser is on an HP tablet running WebOS.- Returns:
- detection of an HP WebOS tablet
-
detectWebOSTV
Detects if the current browser is on a WebOS smart TV.- Returns:
- detection of a WebOS smart TV
-
detectWindowsMobile
Detects if the current browser is a Windows Mobile device. Excludes Windows Phone 7.x and 8 devices. Focuses on Windows Mobile 6.xx and earlier.- Returns:
- detection of Windows Mobile
-
detectWindowsPhone
Detects if the current browser is a Windows Phone 7.x, 8, or 10 device- Returns:
- detection of Windows Phone 7.x OR 8
-
detectWindowsPhone10
Detects a Windows Phone 10 device (in mobile browsing mode).- Returns:
- detection of Windows Phone 10
-
detectWindowsPhone7
Detects a Windows Phone 7 device (in mobile browsing mode).- Returns:
- detection of Windows Phone 7
-
detectWindowsPhone8
Detects a Windows Phone 8 device (in mobile browsing mode).- Returns:
- detection of Windows Phone 8
-
detectXbox
Detects if the current device is a Microsoft Xbox.- Returns:
- detection of Xbox
-
getHttpAccept
Return the lower case HTTP_ACCEPT- Returns:
- httpAccept
-
getIsIphone
Return whether the device is an Iphone or iPod Touch- Returns:
- isIphone
-
getIsTierGenericMobile
Return whether the device is a generic, less-capable mobile device.- Returns:
- isTierGenericMobile
-
getIsTierIphone
Return whether the device is in the Iphone Tier.- Returns:
- isTierIphone
-
getIsTierRichCss
Return whether the device is in the 'Rich CSS' tier of mobile devices.- Returns:
- isTierRichCss
-
getIsTierTablet
Return whether the device is in the Tablet Tier.- Returns:
- isTierTablet
-
getUserAgent
Return the lower case HTTP_USER_AGENT- Returns:
- userAgent
-
initDeviceScan
Initialize Key Stored Values.
-