concept mobile device in category spring

appears as: mobile devices, mobile device, mobile devices
Spring in Practice

This is an excerpt from Manning's book Spring in Practice.

Up to this point, we’ve focused on using Spring MVC to create normal web applications. But what if you were asked to extend the capabilities of an existing Spring MVC application to provide a more customized user experience for mobile users or to create a completely new application that specifically targets mobile devices? In addition to detecting mobile devices, one of the most concerning problems that mobile web applications face is that both the screen size and capabilities of the each web browser vary significantly among today’s smartphone, PDA, tablet, and other mobile devices.

In the Contact List sample application, we chose to use jQuery Mobile (http://jquerymobile.com/). jQuery Mobile is a touch-optimized web framework for smartphones and tablets that is built on top of jQuery and jQuery UI. Measuring in at 12 KB, the framework is relatively lightweight, a feature that is important for devices that may have limited bandwidth. Based on figures 3.4 and 3.5, you can see how you can turn normal HTML 5 into something that closely resembles a mobile devices look and feel.

Figure 3.4. The Contact List sample application when viewed by a normal browser
Figure 3.5. The Contact List sample application when viewed by a mobile device

Spring Mobile’s DeviceResolvers use information present in an HTTP request to sniff out the presence of a mobile device. To give you an idea of how this works and what this information looks like, let’s look at how a typical HTTP request is made.