Connecting Tech Pros Worldwide Help | Site Map

Detecting Mobile Screen Size Methods

Newbie
 
Join Date: Mar 2008
Posts: 1
#1: Mar 4 '08
Hi folks!

I have a question: I am Designing a Wap Site Using XHTML-MP Language,CSS and ASP (Active Server Page), the Problem is how to detect the Screen Size of the Mobile Visiting the site, so as to assure to redirect him to the proper page for viewing the proper image size.

I have read articles about UAPROF and iam been able to extract the x-wap-profile Header by ASP, UAPROF is a URL that points to XML document that contains information about the features and capabilities of a mobile device including the Screen Size

What i need here is how to extract the information from the XML Document to get the Screen Size Information through ASP, i need an example or a methode to do so.

Best Regards
jhardman's Avatar
Moderator
 
Join Date: Jan 2007
Location: logan, utah
Posts: 2,690
#2: Mar 5 '08

re: Detecting Mobile Screen Size Methods


This might not be what you are looking for, but I just use a simple javascript function like this:
Expand|Select|Wrap|Line Numbers
  1. <script language="JavaScript">
  2. <!-- Begin
  3. function rP(inH, inW, frm) {
  4.    inH.value=screen.height;
  5.    inW.value=screen.width;
  6.    frm.submit();
  7. }
  8. // END -->
  9. </script>
inH and inW are hidden form inputs, frm is the form and since there is nothing visible on the page it appears to move instantaneously to a page formatted for it. Let me know if this helps.

Jared
Newbie
 
Join Date: Nov 2008
Posts: 1
#3: Nov 19 '08

re: Detecting Mobile Screen Size Methods


Hi,

You can look at an opensource service like WURFL which has screen size details.

If you just want to plug in to something, you can also use a web service like handsetdetection.com.
Reply