The constraints of mobile device applications are very different than the traditional web or desktop applications. Unlike a desktop or web application, the screen real estate is very compact and the controls are limited in functionality. These constraints force you to rethink your user experience. Simply building a form with a bunch of buttons isn’t very useful on most mobile devices. In addition, the occasionally connected nature of the device is problematic for any application that relies on web connectivity. Because you can’t guarantee whether the device will have or maintain a connection, the standard practice is to minimize the amount of network traffic expected. Similarly, network connections to mobile devices (even 3G) are slower and more bandwidth constrained than normal broadband. This puts an even larger emphasis on reducing network traffic.
Given these constraints, the first question about architecture involves how the application will be deployed and used. If you are building a consumer application for individual users, you want the entire application contained on the mobile device. However, if you are building for an enterprise, you might consider a three tier application where you can control the security of your credentials and your bandwidth on a server, and minimize the footprint of the mobile application. If you take the three tier approach, you also have to consider what the middle tier will be. You can use some sort of service (for example, build a WCF layer that encapsulates Bing Maps) or build a mobile enabled web application. The choice of architecture depends heavily on how you intend to use the application and the constraints of your target devices.
Self Contained Application
The first architecture approach consists of accessing the Bing Maps Web Services directly from a Windows Mobile application.
.png)
This is the least complicated solution, however there are many things to consider before going this route. Accessing the Bing Maps Web Services directly requires the mobile device to process all the data that is returned from the web services, which in most cases results in slow performance. Another major consideration is that mobile networks are typically more expensive and slower than a standard internet connection. By accessing the Bing Maps Web Services directly, all responses to service requests contain the full service response information. In most cases this is more information than you require. One final shortcoming is that by accessing the Bing Maps Web Services directly, your Bing Maps account credentials would be embedded into the mobile application that you would be distributing.
Multi-tier Application
The multi-tier solution consists of having a mobile device connect to a web service which connects to the Bing Maps Web Services and processes the requests.
.png)
This method is a bit more complicated and requires you to have a server to host your web service. However, there are several benefits of this method. By creating a web service to access the Bing Maps Web Services, you can process the returned results from Bing Maps and only pass the minimal information required to the mobile device. This significantly cuts down on the total amount of data that is transferred to the mobile device, which reduces the overall end user cost of using your application, increasing the performance. Similarly, you can create a temporary cache which can easily handle the case of the mobile device losing connection or having a weak signal.
By creating a web service your Bing Maps credentials reside on your hosted server and not in the client’s application, thus creating a greater level of security. However, you do add complexity in that you have to develop, package, test and deploy a mobile application.
Multi-tier Web Application
The third architecture follows the same principles and gains many of the advantages of building a hosted Web service. However, building a mobile web application offers several other advantages, specifically:
- You can test the application without using a mobile device or emulator.
- You do not have to deploy anything to the mobile devices.
- Almost all mobile devices have browser capability.
- ASP.NET will automatically render the appropriate markup language for the device.
With the advances in mobile devices and the .NET Framework, you don’t even have to build a special mobile web application. As long as your web application uses standard components and avoids JavaScript, most mobile browsers will render it correctly.