Simple Mobile Detection Plugin

Source: How to use:

 //Get the switch from the User State if this is a mobile device $mobile = JApplication::getUserState('cmobile.ismobile', false); if($mobile){   //It's a mobile device, get the paramaters   $device = new JRegistry(JApplication::getUserState('cmobile.device'));   $deviceName = $device->get('name');   if($deviceName == 'ipad'){     //This is an iPad   }   if($deviceName == 'iphone'){     //This is an iPhone   }   if($deviceName == 'android'){     //This is an Android device     //Get the model, if the plugin got it     $model = $device->get('model', false);     //Get the build, if the plugin got it     $build = $device->get('build', false);   } }