Windows Phone Thoughts - Daily News, Views, Rants and Raves

Check out the hottest Windows Mobile devices at our Expansys store!


Digital Home Thoughts

Loading feed...

Laptop Thoughts

Loading feed...

Android Thoughts

Loading feed...




Go Back   Thoughts Media Forums > WINDOWS PHONE THOUGHTS > Windows Phone Developer

Reply
 
Thread Tools Display Modes
  #1  
Old 08-13-2003, 10:00 AM
Andy Sjostrom
Pontificator
Join Date: Aug 2006
Posts: 1,177
Default Making Pocket PC Friendly Web Sites

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

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 Pocket PC Web Site Development Tips 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:

A variable (IsPPC) is set at the beginning of the page by checking the user agent:

Code:
&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 />
Code:
&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 %>
 
Reply With Quote
  #2  
Old 08-13-2003, 04:25 PM
brntcrsp
Thinker
Join Date: Jul 2003
Posts: 382

You may wish to update the link - seems Com.com has taken over the domain:

http://builder.com.com/5100-6373_14-5056990.html
 
Reply With Quote
  #3  
Old 08-13-2003, 04:42 PM
Janak Parekh
Editor Emeritus
Janak Parekh's Avatar
Join Date: Aug 2006
Posts: 15,171

Thanks for the update.

--janak
 
Reply With Quote
  #4  
Old 08-13-2003, 08:18 PM
qmrq
Thinker
Join Date: Jul 2003
Posts: 443

Doing this with PHP would be something like..

<?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;
?>
 
Reply With Quote
  #5  
Old 08-14-2003, 01:43 AM
Pony99CA
Swami
Pony99CA's Avatar
Join Date: May 2004
Posts: 4,396
Default PHP Bug

Quote:
Originally Posted by qmrq
$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
__________________
Silicon Valley Pocket PC
http://www.svpocketpc.com
 
Reply With Quote
  #6  
Old 08-14-2003, 09:03 PM
qmrq
Thinker
Join Date: Jul 2003
Posts: 443

Typo?! What typo? I don't see any errors Steve.. you must be going crazy.
 
Reply With Quote
  #7  
Old 08-14-2003, 09:55 PM
Steven Cedrone
Moderator
Steven Cedrone's Avatar
Join Date: Aug 2006
Posts: 6,878

Quote:
Originally Posted by qmrq
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
__________________
"My eyes are rolling back in my head so far I can see my grey matter bubbling and frothing from reading this thread....bleh." JD
 
Reply With Quote
  #8  
Old 08-16-2003, 03:59 AM
Pony99CA
Swami
Pony99CA's Avatar
Join Date: May 2004
Posts: 4,396
Default Edit Marks

Quote:
Originally Posted by qmrq
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.... ops:

Steve
__________________
Silicon Valley Pocket PC
http://www.svpocketpc.com
 
Reply With Quote
  #9  
Old 08-16-2003, 04:01 AM
qmrq
Thinker
Join Date: Jul 2003
Posts: 443

Exactly. Pay no attention to that at all. ops:
 
Reply With Quote
  #10  
Old 08-16-2003, 04:02 AM
Pony99CA
Swami
Pony99CA's Avatar
Join Date: May 2004
Posts: 4,396
Default Quotes

Quote:
Originally Posted by Steven Cedrone
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
__________________
Silicon Valley Pocket PC
http://www.svpocketpc.com
 
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:29 PM.