« Back

Device detection in Liferay

Company Blogs September 11, 2012 By Julio Camarero Staff

I have started playing with device detection when coding Liferay apps and I have found very useful the Device API in Liferay 6.1. 

 

This API allows you to detect the capabilities of the device which is accessing the portal (the size, operating system, if it has touch screen, camera, compass... etc) and then you make your apps behave different depending on the device. For example, you can add some behaviour only for iphones, or androids, only for small screens... 

 

I have just started a wiki page showing some examples on how to use this API, feel free to add more to this wiki page: http://www.liferay.com/community/wiki/-/wiki/Main/Device+detection+capabilities

 

There are many more things, specifically for the front end related with mobile development, but I will talk about those in another blog entry.

 

See you soon!

 

Threaded Replies Author Date
Hi Julio, Thank you so much for putting up... Ahmed Hasan September 12, 2012 11:11 AM
Thank you Ahmed! Let us know any feedback you... Julio Camarero September 14, 2012 9:29 AM
Nice feature. It would be nice that the portal... Jonas Yuan September 15, 2012 1:42 PM

Hi Julio,

Thank you so much for putting up this article at the most appropriate time. We @mPowerGlobal are currently working on a major implementation where the application should intelligently detect the user agent of the client. We used "user agent api" which is hosted on google code. I feel the one provided by Liferay will come handy for this purpose. Keep up the good work.
Posted on 9/12/12 11:11 AM.
Thank you Ahmed! Let us know any feedback you have about it when you try it! emoticon
Posted on 9/14/12 9:29 AM in reply to Ahmed Hasan.
Nice feature. It would be nice that the portal could provide JavaScript calling device's native functions like printer, camera, etc.
Posted on 9/15/12 1:42 PM.