We have a Java based application where in we want to detect the device type(mobile or desktop) for the device that is sending the request.
How is it possible?
You can try to use Spring Mobile. There are convenient classes to solve that.
Device currentDevice = DeviceUtils.getCurrentDevice(servletRequest); if(currentDevice.isMobile()) { /* Mobile */ } if(currentDevice.isTablet()) { /* Tablet */ } if(currentDevice.isNormal()) { /* Desktop */ }