Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Mobile Device Detection Basics View modes: 
User avatar
Member
Member
Jerreck - 12/3/2013 10:46:42 AM
   
Mobile Device Detection Basics
I have a few specific questions about how Kentico detects mobile devices and what happens when it has determined a device to be a mobile device.

1) Where in the life-cycle of a page does mobile device detection come into play, and what are the steps of the detection process?

2) What does this code look like, and where is it located in Kentico's solution? I don't want to modify it, I just want to see it so I can know exactly how it works.

3) What are the differences among the Mobile Device Detection web part, device profiles, and device data as mentioned in this page in the docs?

User avatar
Member
Member
Jerreck - 12/3/2013 12:31:11 PM
   
RE:Mobile Device Detection Basics
To clarify, I'm not asking how the Mobile Device Detection web part works. I've read the code behind for it and it makes perfects sense how that works.

I'm mainly asking if there is a difference between the Mobile Device Detection web part and device profiles, and if there is, then how does device detection work for device profiles?

User avatar
Member
Member
Jerreck - 12/4/2013 2:41:09 PM
   
RE:Mobile Device Detection Basics
I believe I have figured out the answer I was looking for. Please correct me if I am wrong.

Kentico has two built-in ways of manipulating the user's session based on what user agent is detected:

1) The Mobile Device Redirection web part

2) Device Profiles

The Mobile Device Redirection web part has logic for not only detecting the user agent string, but also for redirecting the user once their device's user agent has been detected. The code for this web part can be found within CMSWebParts > General > MobileDeviceRedirection.cs.

However, device detection for device profiles are based on the Lite version of the 51Degrees.mobi class library, which uses HttpHandlers to read the user agent string of the user's device.

Once the user agent has been detected, the logic for what to do is handled by Kentico's device profiles module, whose code can be found in the CMSModules > DeviceProfiles directory of the KenticoCMS project.

The function of this code can be boiled down to "if the user agent string matches the device profile for a large device or a small device, then show the layout for a large device or a small device, respectively."

Since device profiles can be customized within the UI of the Portal Engine, this allows us to specify layouts to use for different devices without having to do any programming.

Does that sound about right?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 12/5/2013 11:54:52 PM
   
RE:Mobile Device Detection Basics
Hi,

Yes, that is true.

Mobile device redirection - just redirects the user if a mobile device is detected to a subsection of the site where e.g. responsive design is used.
Device profiles - is more granular (you can have different layouts for different devices) and you do not need a special sub section of the site - duplicating the documents and content.

Best regards,
Juraj Ondrus