Hello,
I'm sorry for a delay.
I can tell you how I usually use it.
Download the main package from that website . One file from there is enough to make it work - "Mobile_Detect.php".
Usually I put it in my Joomla template, near index.php. Then in the index.php I write something like this:
require_once 'Mobile_Detect.php';
$detect = new Mobile_Detect;
$device = 'desktop';
if ($detect->isTablet()) {
$device = 'tablet';
}
if ($detect->isMobile() && !$detect->isTablet()) {
$device = 'mobile';
}
Also, for development purposes, I also add this code as well:
$app = JFactory::getApplication();
$jinput = $app->input;
if ($jinput->get('device')) {
$device = $jinput->get('device', '');
}
This allows me to override detection by adding url parameter. Like www.example.com?device=tablet, or ?device=mobile. It's only needed during development of course.
If you need to use it in an item template, you can use similar code there.