Blue Theme Orange Theme Green Theme Red Theme
 
6 Months Free & No Setup Fees ASP.NET Hosting!
Home | Forums | ASP.NET 2.0 Tutorials | Web Services | How Do I...? | Class Browser | WPF Quick Starts | Advertise with Us
 | Consulting  
Submit an Article Submit a Blog 
 Jump to
Skip Navigation Links
TechnologyExpand Technology
WebsiteExpand Website
Nevron Gauge for SharePoint
Search :       Advanced Search »
Home » Mobile and Embedded » Mobile Web Application Secret

Mobile Web Application Secret

This article gives you a clear idea how an ASP.NET Web Application rendering works differently on hand held devices than running Web Applications on normal machines.

Page Views : 3198
Downloads : 0
Rating :
 Rate it
Level : Intermediate
   Print Read/Post comments Post a comment  Similar Articles  
   Email to a friend  Bookmark  Author's other articles  
 
Nevron Gauge for SharePoint
Become a Sponsor
 Tag Cloud
 Latest Jobs
More ... 
 Latest Interview Questions
More ... 

In the mobile world we are coming across different variety of mobile devices like some mobiles are capable to render rich graphics, few are able to render low quality graphics and others capable to display text only. Developing application targets to these devices are became a nightmare (prior to DotNet mobile development), developers were writing additional code  to render same application for different devices and it was not so easy to do. Now .NET mobile development makes the work more easier and relax the developers from understanding the target mobile device capability and gives guarantee to run the same application under different mobile platforms without writing any additional code. But again the question is HOW IS IT POSSIBLE? Well the short answer is everything is possible in DotNet and long answer you need to understand the flow of communicating and rendering process  between the web application and mobile devices.

This article gives you a clear idea how the same web application (DotNet based)  rendering differently based on device capability for example a mobile web page (lets call it as "birthday tracker")  contains a calendar control to track birthday, if your  mobile device capable to displays high graphics then you will see the calendar control in your mobile screen or if not the same control will display according to its capability (may be in a text format) and the interesting point is developers are relax from writing additional code to make the application compatibility with the target device. Checking the type of target mobile device, its capability  and making the application compatibility for the mobile devices is the responsibility of DotNet, developers  need to focus only on the functionality. Lets explore how DotNet detecting, converting the data  and rendering  based on device capability.

The main advantage of DotNet mobile application  controls ( placed on web page) are render itself automatically based on the mobile device capability. This process involves two major components. 

  • ASP.NET Mobile Control : These controls are very much familiar to us  like button,text box etc and specially design to work with mobile devices.

  • Device Adapter :  The prime job of the adapter is generates outputs from the controls and map to markup language which the device can understand  such as HTML, cHTML, WML and XHTML

These Two component works together to process the rendering  the same application's data in multiple devices. At present DotNet supports 200+ mobile devices, configuration of these devices are define in machine.config file.

Now  examine a case study how it works when you are requesting a web page from a PocketPC (PDA). PocketPC  will communicate with web server through  HTTP request. This request will process in three stage. The First stage involve in identify the type of device in this case a PocketPC and its capability like image, browser capability and  types of markup language supports, the information about the device capability is configure in Machine.config file  and the web application refers machine.config to identify the device capability and other information about device. If we look at the HTTP request coming from a mobile device contains three major section like URL,User Agent and Header Information as illustrate below.

[Figure 1: Process involves in browsing web page from PocketPC ]

The User Agent string contains the device info and this string will scan with machine.config to identify the details about the requested mobile device. The URL section contains the requested page. Once the page identify application server looks for the instance of the requested page. If the requested page is not yet instantiated then the requested web page (.aspx) will first parse then compiles by the compiler and then the compiled page stores in assembly cache finally server will create a new instance of the cached page. The parsing and compile process is one time activity the subsequent request for the same page will be instantiated from the cache irrespective of any mobile devices. This process leverage the performance of  accessing of mobile web page.

The Second stage involves in page rendering process. Once  the page has instantiated the controls (mobile controls) of the page also instantiated and the execution process starts based on the user's inputs. After the execution the data has to be render based on the device capability, this is taking care by the device adapters associated with the device and controls. The device adapters generate markup language compatibility with the device for the output in this scenario HTML output and send it to the device (PocketPC).

Now lets examine another case study how it works when you  request  a page from a cell phone. In this scenario the cell phone mobile browser sends the WAP request to WAP gateway. This gateway provided by the cell phone service providers as illustrate below.

[Figure 2: Process involves in browsing web page from cell phone ]

Now the WAP gateway translate this into a HTTP request and passes it  web server over internet. The HTTP request contains URL, User Agent and Header Information, the process of execution the page is same as we discussed earlier in our case study for PocketPC. The main point is instead of generate a HTML output now its generates a WML output because cell phones mobile browser can understands only WML. Once the WML output has generated web server send the output as HTTP response to the WAP gateway and WAP gateway translate it to WAP response and pass it to cell phone.

This is how the mobile web application working in different mobile devices. The DotNet mobile development makes our work very flexible and leverage productivity .Microsoft is doing lots of enhancements  in mobile development because today's business running on mobile. I am going to update you all about mobile development in my coming articles.

Comment Request!
Thank you for reading this post. Please post your feedback, question, or comments about this post Here.
Login to add your contents and source code to this article
 [Top] Rate this article
 
 About the author
 
Anand Kumar
I am having 3 yrs of experience on .NET environment .My core expertise is developing robust service components using ATL COM ,Remoting and Web Service and very much passionate about Microsoft Patterns and Practices and .NET performance . Apart from my regular work I am actively participating various Microsoft User Groups and sharing my knowledge and articles.
Looking for C# Consulting?
C# Consulting is founded in 2002 by the founders of C# Corner. Unlike a traditional consulting company, our consultants are well-known experts in .NET and many of them are MVPs, authors, and trainers. We specialize in Microsoft .NET development and utilize Agile Development and Extreme Programming practices to provide fast pace quick turnaround results. Our software development model is a mix of Agile Development, traditional SDLC, and Waterfall models.
Click here to learn more about C# Consulting.
 
Introducing MaxV - one click. infinite control. Hyper-V Hosting from MaximumASP.
Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Dynamic PDF
ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
Nevron Chart for .NET 2010.1 Now Available
The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
ASP.NET 4 Hosting
Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites – Click Here!
 
 Post a Feedback, Comment, or Question about this article
Subject:
Comment:
Nevron Gauge for SharePoint
Become a Sponsor
 Comments

 © 2012  contents copyright of their authors. Rest everything copyright Mindcracker. All rights reserved.