I am working on an Apache Wicket WebApplication in Java. In this application I have a general method to detect the user device using the user agent. However, since the iOS 13 update my check is not working anymore for the iPad as the user agent returns MacIntel or Intel Mac for both, iPad and PC. I checked and found that this issue has already been discussed here:
Link 1
Link 2
Link 3
But these solutions are only for JavaScript. I need to handle this in Java (org.apache.wicket.protocol.http.WebSession). In the properties of the WebSession there exist no method for extracting the number of touch points. Can anybody help me getting the number of touch points or has another idea how to solve this issue. Thank you.
My current code looks like this:
public static boolean isTablet(WebSession pWebSession) {
String userAgent = pWebSession.getClientInfo().getUserAgent();
if (userAgent != null && (userAgent.contains("iPad")
|| (userAgent.contains("Android") && !userAgent.contains("Mobile")))
|| (userAgent.contains("PlayBook"))) {//BlackBerry tablet
return true;
}
return false;
}