<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://devlicio.us/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Christopher Bennage : mobile</title><link>http://devlicio.us/blogs/christopher_bennage/archive/tags/mobile/default.aspx</link><description>Tags: mobile</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>Mobile Development: Detecting Devices &amp; Features</title><link>http://devlicio.us/blogs/christopher_bennage/archive/2011/10/20/mobile-development-detecting-devices-amp-features.aspx</link><pubDate>Thu, 20 Oct 2011 17:50:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:68307</guid><dc:creator>Christopher Bennage</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;em&gt;Take this post cum granlis salis. I&amp;#8217;m trying to figure this stuff out and I&amp;#8217;m thinking out loud.&lt;/em&gt;&lt;/p&gt; &lt;h2&gt;Background&lt;/h2&gt; &lt;p&gt;Whenever a browser makes a request, it includes a string identifying itself to the server. We commonly refer to this as the &lt;em&gt;user agent string&lt;/em&gt;. This string identifies the browser and the platform and the version and a great deal more such nonsense.&lt;/p&gt; &lt;p&gt;&lt;img style="float:right;" src="http://dev.bennage.com/images/posts/tower-babel.jpg" alt="" /&gt;&lt;/p&gt; &lt;p&gt;This sounds great in theory. We should be able to use this data to optimize what&amp;#8217;s being sent to the (mobile) browser. However, there&amp;#8217;s been something of a &lt;a href="http://webaim.org/blog/user-agent-string-history/" title="History of the browser user-agent string by Aaron Andersen"&gt;sordid history for user agent strings&lt;/a&gt;. In retrospect, we&amp;#8217;ve realized that &lt;a href="http://en.wikipedia.org/wiki/User_agent#User_agent_sniffing"&gt;user agent sniffing&lt;/a&gt; is a tool that has often hurt more than it has helped.&lt;/p&gt; &lt;p&gt;We&amp;#8217;ve learned to &lt;em&gt;favor feature detection over browser detection&lt;/em&gt; (or device detection). Take a look at &lt;a href="http://www.modernizr.com/"&gt;modernizr&lt;/a&gt; and &lt;a href="http://haz.io/"&gt;haz.io&lt;/a&gt; for more on the that front. The success of feature detection has also resulted in a shift from server logic to client logic. We detect features on the client but we detect user agent strings on the server, before we send anything to the client.&lt;/p&gt; &lt;p&gt;How does all this play into the mobile web? One of the key mobile features we are interested in is &lt;em&gt;screen size&lt;/em&gt;. Luckily for us, the W3C has blessed us with &lt;a href="http://www.w3.org/TR/css3-mediaqueries/"&gt;media queries&lt;/a&gt;. In a nutshell, media queries allow you to conditionally apply CSS based properties of the display device. This has given rise to something known as &lt;a href="http://www.alistapart.com/articles/responsive-web-design/"&gt;Responsive Web Design&lt;/a&gt;. Responsive Web Design is about having a single set of markup whose layout can &lt;em&gt;respond&lt;/em&gt; to the device&amp;#8217;s display capabilities. Unfortunately, there are a few &lt;a href="http://www.webdesignshock.com/responsive-design-problems/"&gt;rough edges&lt;/a&gt; with this approach.&lt;/p&gt; &lt;h2&gt;Moving Backwards…&lt;/h2&gt; &lt;p&gt;In the mobile world, client-side feature detection has a few drawbacks. It requires extra code to be sent to the browsers and it takes additional processing on the client. It&amp;#8217;s also likely that you&amp;#8217;ll end up sending more than is really needed (or that you&amp;#8217;ll need to make additional requests).&lt;/p&gt; &lt;p&gt;One solution to this conundrum is to use the open source &amp;#8220;database&amp;#8221; called &lt;a href="http://wurfl.sourceforge.net/"&gt;WURLF&lt;/a&gt;. You can query WURL with a user agent string and it will return a set of capabilities. I think of it as &lt;em&gt;feature detection&lt;/em&gt; on the server. Though admittedly it&amp;#8217;s a bit misleading to call it that.&lt;/p&gt; &lt;p&gt;This means your server can ask questions like &amp;#8220;Does this client support HTML5? If no, what do they support?&amp;#8221; before the first response is even sent.&lt;/p&gt; &lt;p&gt;WURLF has &lt;a href="http://scientiamobile.com/"&gt;commercial support&lt;/a&gt; and a &lt;a href="http://wurfl.sourceforge.net/dotNet/"&gt;C# API&lt;/a&gt;. For ASP.NET developers, &lt;a href="http://51degrees.mobi/"&gt;51Degrees&lt;/a&gt; has an open source project called &lt;a href="http://51degrees.codeplex.com/"&gt;Foundation&lt;/a&gt; that is built on top of WURL. It uses an HttpModule to automatically query WURL and populate the &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.httprequest"&gt;Request.Browser&lt;/a&gt;. Setting up WURLF without Foundation takes a little bit more work, but not too much. Both are available on Nuget: &lt;a href="http://www.nuget.org/List/Packages/WURFL_Official_API"&gt;WURL&lt;/a&gt; and &lt;a href="http://nuget.org/List/Packages/51Degrees.mobi"&gt;51Degrees&lt;/a&gt;.&lt;/p&gt; &lt;h2&gt;What should you do?&lt;/h2&gt; &lt;p&gt;I don&amp;#8217;t think that there is a cut and dry answer &lt;em&gt;at the moment&lt;/em&gt;. What you do depends heavily on your target audience. If you are targeting the &lt;a href="http://gs.statcounter.com/#mobile_browser-na-monthly-201009-201109"&gt;North American market&lt;/a&gt; there&amp;#8217;s a good chance you&amp;#8217;ll be okay with a single set of markup, going with a responsive &lt;a href="http://www.lukew.com/ff/entry.asp?933"&gt;mobile-first&lt;/a&gt; design. In other words, there would be no need for something like WURLF.&lt;/p&gt; &lt;p&gt;However, you might need a &lt;em&gt;very broad reach&lt;/em&gt; or you might be targeting a market heavy in &lt;a href="http://en.wikipedia.org/wiki/Feature_phone"&gt;feature phones&lt;/a&gt; or something else that&amp;#8217;s &lt;a href="http://gs.statcounter.com/#mobile_browser-sa-monthly-201009-201109"&gt;very different from North America&lt;/a&gt;. In those cases, it is good to understand your options.&lt;/p&gt;

&lt;em&gt;Comment on this post at &lt;a href="http://dev.bennage.com/blog/2011/10/19/mobile-developent-and-device-detection/"&gt;dev.bennage.com&lt;/a&gt;&lt;/em&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=68307" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/web/default.aspx">web</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/mobile/default.aspx">mobile</category></item><item><title>Being a New Kid on the Mobile Block</title><link>http://devlicio.us/blogs/christopher_bennage/archive/2011/10/10/being-a-new-kid-on-the-mobile-block.aspx</link><pubDate>Mon, 10 Oct 2011 23:38:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:68278</guid><dc:creator>Christopher Bennage</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;The last few weeks I&amp;#8217;ve been trying get a finger on the pulse of &lt;em&gt;mobile web development&lt;/em&gt;. I wanted to identify the thought leaders, understand the big questions, and (perhaps mostly importantly) begin cataloging the practical considerations for building mobile experiences today.&lt;/p&gt; &lt;p&gt;Here&amp;#8217;s where I&amp;#8217;m at so far&amp;#8230;&lt;/p&gt;  &lt;h2&gt;What is &amp;#8216;the mobile web&amp;#8217;?&lt;/h2&gt; &lt;p&gt;&lt;span class="’has-pullquote’"&gt; The definition of &lt;em&gt;mobile web&lt;/em&gt; is quickly evolving. Devices are varied and the distinctions are blurring. If you think it&amp;#8217;s as simple as iOS, Android, &lt;em&gt;and Windows&lt;/em&gt; then you&amp;#8217;ll be surprised. (I do genuinely love my WP7). Personally, I think the distinction between mobile and desktop is fading more and more everyday. When I say &lt;em&gt;mobile web&lt;/em&gt; I am talking about HTML-based applications and not applications that are built natively for their respective platforms. Of course, there is debate over native apps versus web apps: when is one appropriate over the over? etc, etc. This is a question when intend to address in &lt;a href="http://liike.github.com/"&gt;Project Liike&lt;/a&gt;. &lt;/span&gt;&lt;/p&gt; &lt;h2&gt;Who to follow?&lt;/h2&gt; &lt;p&gt;I&amp;#8217;ve been following a mishmash of people, and I must confess that my process of qualifying them has been some haphazard. I&amp;#8217;m compiling a &lt;a href="http://twitter.com/#!/bennage/mobile-web" title="membership subject to change"&gt;list on twitter&lt;/a&gt;. A number of folks on this list are signatories of &lt;a href="http://futurefriend.ly/" title="advocates of standards based mobile web development"&gt;future friend.ly&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Other sources I&amp;#8217;ve been paying attention to are:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://www.alistapart.com/"&gt;A List Apart&lt;/a&gt; – &amp;#8220;For people who make websites.&amp;#8221;&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.smashingmagazine.com/"&gt;Smashing Magainze&lt;/a&gt; – Lots of articles on design, web, and of course mobile.&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.cloudfour.com/blog/"&gt;Cloud Four&lt;/a&gt; – Many recent and thorough posts exploring some of the big questions in mobile.&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.yiibu.com/"&gt;Yiibu&lt;/a&gt; – They have a lot of interesting ideas, and they&amp;#8217;ve done some &lt;a href="http://www.yiibu.com/articles/practical-guide-to-nokia-browsers/"&gt;impressive work&lt;/a&gt; for Nokia.&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;I&amp;#8217;ve also been reading through &lt;a href="http://shop.oreilly.com/product/9780596807795.do"&gt;&lt;em&gt;Programming the Mobile Web&lt;/em&gt;&lt;/a&gt; by &lt;a href="http://twitter.com/#!/firt"&gt;Maximiliano Firtman&lt;/a&gt;. The first few chapters are pretty scary for someone like myself who did not understand how diverse and scattered the mobile world is. (It&amp;#8217;s also funny to see how much has changed since the book was published in 2010.)&lt;/p&gt; &lt;p&gt;Anything you&amp;#8217;d recommend?&lt;/p&gt; &lt;h2&gt;The state of things&lt;/h2&gt; &lt;p&gt;&lt;em&gt;Caveat&lt;/em&gt;: &lt;em&gt;This is just Christopher&amp;#8217;s brain dump. Consider it merely food for thought.&lt;/em&gt;&lt;/p&gt; &lt;ul&gt; &lt;li&gt;There are many &lt;a href="http://techcrunch.com/2011/02/09/html5-versus-native-apps/"&gt;compeling&lt;/a&gt; &lt;a href="http://www.html5rocks.com/en/mobile/nativedebate.html"&gt;reasons&lt;/a&gt; for developing mobile web apps. Not to the complete exclusion of &lt;a href="http://www.webmonkey.com/2010/08/how-do-native-apps-and-web-apps-compare/"&gt;native apps&lt;/a&gt;, but &lt;a href="http://www.phonegap.com/"&gt;maybe?&lt;/a&gt;&lt;/li&gt; &lt;li&gt;You need to understand your target market and the devices that it uses. Don&amp;#8217;t make assumptions. You might be &lt;a href="http://gs.statcounter.com/#mobile_os-ww-monthly-201009-201109"&gt;surprised&lt;/a&gt;.&lt;/li&gt; &lt;li&gt;The space is changing, standards are evolving, solutions are being formulated. However, if you need to you need build an app today, there is still plently of &lt;a href="http://www.w3.org/TR/mobile-bp/" title="Yes, it’s a little old but still mostly good."&gt;pragmatic&lt;/a&gt; &lt;a href="http://mobilewebbestpractices.com/"&gt;advice&lt;/a&gt;.&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;One more thought: don&amp;#8217;t jump to conclusions. You might read about something cool like &lt;a href="http://www.alistapart.com/articles/responsive-web-design/"&gt;&lt;em&gt;Responsive Web Design&lt;/em&gt;&lt;/a&gt;, but such cool and innovative techniques can be &lt;a href="http://www.cloudfour.com/css-media-query-for-mobile-is-fools-gold/" title="CSS Media Query for Mobile is Fool’s Gold"&gt;deceptive&lt;/a&gt;. Research and testing is your friend.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Comment on this post at &lt;a href="http://dev.bennage.com/blog/2011/10/10/being-a-new-kid-on-the-mobile-block/"&gt;dev.bennage.com.&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=68278" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/web/default.aspx">web</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/html5/default.aspx">html5</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/mobile/default.aspx">mobile</category></item></channel></rss>