i want to know whether it is a iphone or android phone, i used below code for detection, But this displaying as Mobile for both Android or iphone devices.....
But need like Android/iphone/ipad....
public function preExecute() {
...
$context = $this->getContext();
$request = $context->getRequest();
$response = $context->getResponse();
print_r($request->getHttpHeader('User-Agent'));
....
}