Log in

View Full Version : Making Pocket PC Friendly Web Sites


Andy Sjostrom
08-13-2003, 10:00 AM
<div class='os_post_top_link'><a href='http://builder.com.com/5100-6373_14-5056990.html' target='_blank'>http://builder.com.com/5100-6373_14-5056990.html</a><br /><br /></div>Builder.com has an interesting article on how to make a web site Pocket PC friendly, or mobile device friendly for that matter! The article <a href="http://www.builder.com/5100-6373-5056990.html">Pocket PC Web Site Development Tips</a> brings up aspects such as detecting the browser, screen size limitations, scripting and XML support, bandwidth, security, and offline browsing. Pocket PC Thoughts works very nicely on Pocket PCs (nowadays!)! Over at businessanyplace.net we have used browser detection a long time to present the site nicely to mobile devices. If you are interested, you can read on to see some of the code making it possible: <!><br /><br />A variable (IsPPC) is set at the beginning of the page by checking the user agent:<br /><br />&lt;%<br />' Device Indicators<br />Public IsPPC, IsMME, IsThinClient<br />IsPPC = (InStr(Request.ServerVariables("HTTP_USER_AGENT"), "Windows CE") > 0)<br />IsMME = (InStr(Request.ServerVariables("HTTP_USER_AGENT"), "MME") > 0)<br />IsThinClient = (IsPPC Or IsMME)<br />%><br /><br />In the rest of the page, we can use the variable to determine programmatically how specific parts of the page should be formatted. For example, this code segment is located at the very end of a page:<br /><br />&lt;% If Not IsPPC Then %><br />&lt;table cellspacing="0" cellpadding="0" width="758" border="0"><br /> &lt;tr><br /> &lt;td align="middle" colSpan="3">&lt;img src="images/1x1empty.gif" width="100%" height="2">&lt;br>&lt;img <br /> src="images/1x1black.gif" width="758" height="1" vspace="2">&lt;/td><br /> &lt;/tr><br /> &lt;tr><br /> &lt;td valign="top">&lt;% ' left footer %>&lt;/td><br /> &lt;td valign="top">&lt;% ' center footer %>&lt;/td><br /> &lt;td valign="top" align="right">©2001 Andreas Sjöström & Christian Forsberg&lt;br><br /> &lt;% If False Then %>&lt;a href="mailto:[email protected]">Contact us&lt;/a>&lt;% End If %>&lt;/td><br /> &lt;/tr><br />&lt;/table><br />&lt;% Else %><br />&lt;table cellspacing="0" cellpadding="0" width="100%" border="0"><br /> &lt;tr>&lt;td>&lt;img src="images/1x1black.gif" width="100%" height="1" vspace="2">&lt;/td>&lt;/tr><br />&lt;/table><br />&lt;font size="1">©2001 Andreas Sjöström & Christian Forsberg&lt;br>&lt;/font><br />&lt;% End If %>

brntcrsp
08-13-2003, 04:25 PM
You may wish to update the link - seems Com.com has taken over the domain:

http://builder.com.com/5100-6373_14-5056990.html

Janak Parekh
08-13-2003, 04:42 PM
Thanks for the update. :)

--janak

qmrq
08-13-2003, 08:18 PM
Doing this with PHP would be something like..

&lt;?php
// Page formatted for Windows CE
$ce = 'Some part of that should be changed for mobile viewing';
// Page formatted for normal viewing
$notce = 'some normal stuff';
$browser = strpos($_SERVER['HTTP_USER_AGENT'], "Windows CE");
if ($browser !== FALSE)
echo $ce;
else
echo $notce;
?>

Pony99CA
08-14-2003, 01:43 AM
$browser = strpos($_SERVER['HTTP_USER_AGENT'], "Windows CE");
if ($browswer !== FALSE)
Which won't work with that typo. 0X In the IF statement, change "browswer" to "browser".

Steve

qmrq
08-14-2003, 09:03 PM
Typo?! What typo? I don't see any errors Steve.. you must be going crazy. :)

Steven Cedrone
08-14-2003, 09:55 PM
Typo?! What typo? I don't see any errors Steve.. you must be going crazy. :)

Well...

You can fix it in your post, but it's still in his quote... :wink: :lol:

Good try though!!!

Steve

Pony99CA
08-16-2003, 03:59 AM
Typo?! What typo? I don't see any errors Steve.. you must be going crazy. :)
Pay no attention to the "Last edited" line in the post.... :oops:

Steve

qmrq
08-16-2003, 04:01 AM
Exactly. Pay no attention to that at all. :oops:

Pony99CA
08-16-2003, 04:02 AM
You can fix it in your post, but it's still in his quote... :wink: :lol:

Pony99CA is the coolest guy here!

Of course, quotations can always be altered -- not that anybody would do such a thing. :rotfl:

Steve

ukcampbell
05-27-2004, 03:18 PM
Hi,

Thanks for your code to detect Pocket PCs. It was very useful.
Do you have similar to detect SmartPhones?

Kacey Green
05-27-2004, 03:54 PM
You can fix it in your post, but it's still in his quote... :wink: :lol:

Pony99CA is the coolest guy here!

Of course, quotations can always be altered -- not that anybody would do such a thing. :rotfl:

Steve
"Anything you say can and will be misquoted and used against you in a court of law" :)

note: not politics, but a joke I heard

(pony's alias spell checks out to Pontiac :lol: )