I wanted to find out the entire version of the iPad (excluding iPhone, iPod) from the user agent string, currently during testing I got the following line
Mozilla/5.0 (iPad; CPU OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B206 Safari/7534.48.3
Question: Will the following code work fine for all iPads?
String userAgentStr = request.getHeader("User-agent"); if (userAgentStr.contains("iPad")) {
EDIT:
I use the Dolphin browser from the iPad, but I get the following UA line:
Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en_US) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8C148 Safari/6533.18.5
Similarly, iBrowser from the iPad UA line:
Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206
So my above code breaks ...
source share