<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>EnvyAndroid.com &#187; Mobile web</title>
	<atom:link href="http://envyandroid.com/archives/category/mobile-web/feed" rel="self" type="application/rss+xml" />
	<link>http://envyandroid.com</link>
	<description></description>
	<lastBuildDate>Sat, 10 Mar 2012 16:37:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Debugging websites on mobile devices with Opera Mobile and Dragonfly</title>
		<link>http://envyandroid.com/archives/527/debugging-websites-mobile-devices-opera-mobile-dragonfly</link>
		<comments>http://envyandroid.com/archives/527/debugging-websites-mobile-devices-opera-mobile-dragonfly#comments</comments>
		<pubDate>Wed, 24 Aug 2011 20:45:35 +0000</pubDate>
		<dc:creator>EnvyAndroid</dc:creator>
				<category><![CDATA[Mobile web]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Dragonfly]]></category>
		<category><![CDATA[Galaxy S2]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[Opera Mobile]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Web Browser]]></category>

		<guid isPermaLink="false">http://envyandroid.com/?p=527</guid>
		<description><![CDATA[I have previously written about how you can debug mobile websites with a tool called Weinre. Now I will explain another way to debug sites, this time, with Opera Mobile, and Opera Dragonfly. I will be demonstrating this on a Galaxy S 2, with Opera Mobile 11.10 on Android  and Opera desktop version 11.50. This&#8230;]]></description>
			<content:encoded><![CDATA[<p>I have <a title="How to easily debug websites on mobile devices with “Weinre”" href="http://envyandroid.com/archives/483/easily-debug-mobile-websites-with-weinre">previously written about</a> how you can debug mobile websites with a tool called Weinre. Now I will explain another way to debug sites, this time, with Opera Mobile, and Opera Dragonfly.</p>
<p>I will be demonstrating this on a Galaxy S 2, with <a href="http://www.opera.com/mobile/">Opera Mobile</a> 11.10 <a href="https://market.android.com/details?id=com.opera.browser">on Android </a> and <a href="http://www.opera.com/">Opera desktop</a> version 11.50.</p>
<p>This is Opera Mobile, not Mini, which is a different browser.</p>
<p>This will not work for iPhone or iPad since Opera Mobile is not allowed into App store since it is too &#8220;similar to safari&#8221;.</p>
<p>As we developers know, it is quite difficult and cumbersome to inspect a websites source code, css, javascript or layout, from a mobile browser, like you can in a desktop browser with tools like Firebug.</p>
<p>Dragonfly is a tool that can be used to debug and edit websites on your mobile device, from your desktop computer.</p>
<p>I will be showing how to connect to your phone, and start debugging away!</p>
<p><span id="more-527"></span></p>
<h2>Dragonfly</h2>
<ul>
<li>Dragonfly is Operas version of Firebug and Chrome developer tools.</li>
<li>It comes bundled with the desktop version of Opera.</li>
<li>It is a webapp, which automatically updates itself.</li>
<li>You can open it by pressing <span class="error">Ctrl + Shift + I</span> or by clicking the main menu -&gt; Page- Developer tools -&gt; Dragonfly</li>
</ul>
<div>You may also want to place the quick access button in your toolbar, to do this,<br />
press <span class="error">Shift + F12 -&gt; Buttons -&gt; Browser View</span>, and then drag the Dragonfly button onto your toolbar, like illustrated below.</div>
<div><a href="http://envyandroid.com/wp/wp-content/uploads/2011/08/1dragonfly-button.png"><img class="alignnone size-thumbnail wp-image-531" title="1dragonfly-button" src="http://envyandroid.com/wp/wp-content/uploads/2011/08/1dragonfly-button-150x150.png" alt="" width="150" height="150" /></a></div>
<h2>Connecting for Remote debugging</h2>
<div>
<ol>
<li>When you have opened Dragonfly on your computer, click on the &#8220;Remote debug configuration&#8221; button, set a port number (default 7001 should work in most cases), and hit apply.<br />
<a href="http://envyandroid.com/wp/wp-content/uploads/2011/08/2remote-debugging.png"><img class="alignnone size-medium wp-image-534" title="2remote-debugging" src="http://envyandroid.com/wp/wp-content/uploads/2011/08/2remote-debugging-300x129.png" alt="" width="300" height="129" /></a></li>
<li>Find the local IP address of your computer</li>
<li>Connect your phone to the same network as your computer, by wifi.</li>
<li>Open Opera Mobile on your phone, and go to <span class="error">about:debug</span> in the url bar.<br />
<a href="http://envyandroid.com/wp/wp-content/uploads/2011/08/1mobile-connect.png"><img class="alignnone size-medium wp-image-532" title="1mobile-connect" src="http://envyandroid.com/wp/wp-content/uploads/2011/08/1mobile-connect-180x300.png" alt="" width="180" height="300" /></a></li>
<li>Enter the ip address and port number of your computer, and hit &#8220;connect&#8221;.</li>
</ol>
<div>If it connects properly, Dragonfly should start loading the html of the currently active website in Opera Mobile, which will be the &#8220;Connect to debugger&#8221; website where we hit the connect button. It will look something like this:</div>
<div><a href="http://envyandroid.com/wp/wp-content/uploads/2011/08/4connected-siden.png"><img class="alignnone size-medium wp-image-536" title="4connected-siden" src="http://envyandroid.com/wp/wp-content/uploads/2011/08/4connected-siden-300x140.png" alt="" width="300" height="140" /></a></div>
<div>If you expand the DOM, and mouse over or click the H1 tag (like I did in the picture), you should see the header beeing selected in Opera Mobile, on you phone!</div>
<div><a href="http://envyandroid.com/wp/wp-content/uploads/2011/08/2mobile-connected.png"><img class="alignnone size-medium wp-image-533" title="2mobile-connected" src="http://envyandroid.com/wp/wp-content/uploads/2011/08/2mobile-connected-180x300.png" alt="" width="180" height="300" /></a></div>
<h2>Doing some editing</h2>
<div>Now I can for example edit the header of the website, by double clicking it, and entering some new text.</div>
<div><a href="http://envyandroid.com/wp/wp-content/uploads/2011/08/5editing-text.png"><img class="alignnone size-medium wp-image-538" title="5editing-text" src="http://envyandroid.com/wp/wp-content/uploads/2011/08/5editing-text-300x140.png" alt="" width="300" height="140" /></a></div>
</div>
<div>And the changes appear on the phone instantly, &#8220;New Header&#8221;:</div>
<div><a href="http://envyandroid.com/wp/wp-content/uploads/2011/08/3mobile-select-header.png"><img class="alignnone size-medium wp-image-535" title="3mobile-select-header" src="http://envyandroid.com/wp/wp-content/uploads/2011/08/3mobile-select-header-180x300.png" alt="" width="180" height="300" /></a></div>
<div>I can also change some color via css to turn the header green:</div>
<div><a href="http://envyandroid.com/wp/wp-content/uploads/2011/08/6editing-color.png"><img class="alignnone size-medium wp-image-540" title="6editing-color" src="http://envyandroid.com/wp/wp-content/uploads/2011/08/6editing-color-300x140.png" alt="" width="300" height="140" /></a></div>
<div>And it is displayed instantly on the phone:</div>
<div><a href="http://envyandroid.com/wp/wp-content/uploads/2011/08/4mobile-editing-header.png"><img class="alignnone size-medium wp-image-537" title="4mobile-editing-header" src="http://envyandroid.com/wp/wp-content/uploads/2011/08/4mobile-editing-header-180x300.png" alt="" width="180" height="300" /></a></div>
<h2>Debugging another website</h2>
<div>Now, this was just for demonstration, you probably want to debug or mess with some other website,  you can do this by going to a new url in the address bar on Opera Mobile. <del>You cannot open other websites in tabs on your phone, to debug another site, you must use the same tab, just change the url.</del> (<strong>edit:</strong> Yes you can! <img src='http://envyandroid.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  see comments below)</div>
<div>If I go to another website, its html will automatically show up in Dragonfly, after the page has loaded, ready for you to mess with!</div>
<div><a href="http://envyandroid.com/wp/wp-content/uploads/2011/08/6mobile-debugging-another-site.png"><img class="alignnone size-medium wp-image-541" title="6mobile-debugging-another-site" src="http://envyandroid.com/wp/wp-content/uploads/2011/08/6mobile-debugging-another-site-180x300.png" alt="" width="180" height="300" /></a><a href="http://envyandroid.com/wp/wp-content/uploads/2011/08/7-another-site.png"><img class="alignnone size-medium wp-image-542" title="7-another-site" src="http://envyandroid.com/wp/wp-content/uploads/2011/08/7-another-site-300x140.png" alt="" width="300" height="140" /></a></div>
<h2>Stopping debugging &amp; some tips</h2>
<div>
<ol>
<li>When you are done debugging websites, you just hit the &#8220;<strong>Cancel remote debug</strong>&#8221; button in Dragonfly.</li>
<li>You can get a javascript console, to inject javascript, read values etc, with the press of a button (see image below)</li>
<li>If you need more space, you can undock Dragonfly to a separate window (see image below)</li>
<li><a href="http://dev.opera.com/articles/view/introduction-to-opera-dragonfly/">Here</a> and <a href="http://www.opera.com/dragonfly/documentation/">here</a> you can find more information on Dragonfly and how to use it.</li>
</ol>
</div>
<div>
<div id="attachment_544" class="wp-caption alignnone" style="width: 215px"><a href="http://envyandroid.com/wp/wp-content/uploads/2011/08/undock-console.png"><img class="size-full wp-image-544" title="undock-console" src="http://envyandroid.com/wp/wp-content/uploads/2011/08/undock-console.png" alt="" width="205" height="82" /></a><p class="wp-caption-text">Console and Undocking</p></div>
</div>
 <img src="http://envyandroid.com/wp/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=527" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://envyandroid.com/archives/527/debugging-websites-mobile-devices-opera-mobile-dragonfly/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to easily debug websites on mobile devices with &#8220;Weinre&#8221;</title>
		<link>http://envyandroid.com/archives/483/easily-debug-mobile-websites-with-weinre</link>
		<comments>http://envyandroid.com/archives/483/easily-debug-mobile-websites-with-weinre#comments</comments>
		<pubDate>Fri, 05 Aug 2011 15:46:06 +0000</pubDate>
		<dc:creator>EnvyAndroid</dc:creator>
				<category><![CDATA[Mobile web]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Dragonfly]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[Safari Mobile]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Web Browser]]></category>
		<category><![CDATA[Webkit]]></category>
		<category><![CDATA[Weinre]]></category>

		<guid isPermaLink="false">http://envyandroid.com/?p=483</guid>
		<description><![CDATA[If you do web development, chances are you sometimes need to fix something on the website adapted to mobile devices such as iPhone and Android. Debugging websites in a browser on a computer is easy with all the good tools available, such as Firebug in Firefox, Webkit inspector in Chrome and  Dragonfly in Opera. But&#8230;]]></description>
			<content:encoded><![CDATA[<p>If you do web development, chances are you sometimes need to fix something on the website adapted to mobile devices such as iPhone and Android.</p>
<p>Debugging websites in a browser on a computer is easy with all the good tools available, such as Firebug in Firefox, Webkit inspector in Chrome and  Dragonfly in Opera. But mobile devices doesn&#8217;t have any such tool. What do you do then?</p>
<p>That was my problem the other day, a div  element on the website rendered for iPhone got the wrong styles, so I had to investigate&#8230;</p>
<p>Which was not easily done from the iPhone Safari browser, to say atleast.</p>
<p>(And the solution was not as easy as just browsing the mobile website on my computer with iOS user agent.)</p>
<p>A buddy of mine had just recently come over a tool called <a href="http://phonegap.github.com/weinre/">weinre</a>. Funny name, yes, but a very handy tool to debug websites on mobile devices!</p>
<h2>About Weinre</h2>
<ul>
<li>Weinre stands for &#8220;Web Inspector Remote&#8221; and is similar to the web inspector in chrome.</li>
<li>It will allow you to use the inspector (run on your computer), on the website rendered on your mobile device!</li>
<li>Changes you do in the inspector, are reflected instantly in the mobile devices browser. (such as changing text, color, dimension etc) just as in FireBug.</li>
<li>You also get a javascript command line.</li>
<li>Weinre is a simple jar file, you run through the command line.</li>
</ul>
<p>It has a lot of documentation on its website, maybe too much, so I thought I would try to cook it down to a few simple steps to get up and running quickly.</p>
<p><span id="more-483"></span></p>
<h2>How to run weinre</h2>
<ol>
<li>Start with downloading weinre <a href="http://phonegap.github.com/weinre/Installing.html">here</a>.</li>
<li>Find your local ip adress by opening a command prompt, and enter ipconfig.</li>
<li>Then enter <span class="error">java -jar weinre.jar -httpPort 8081 -boundHost -all- </span>in the command prompt to start weinre
<p><div id="attachment_499" class="wp-caption alignnone" style="width: 160px"><a href="http://envyandroid.com/wp/wp-content/uploads/2011/08/Untitled-1.png"><img class="size-thumbnail wp-image-499 " title="Untitled-1" src="http://envyandroid.com/wp/wp-content/uploads/2011/08/Untitled-1-150x150.png" alt="" width="150" height="150" /></a><p class="wp-caption-text">weinre running</p></div></li>
<li>With Chrome browser, open<a href="http://127.0.0.1:8081/" target="_blank">http://127.0.0.1:8081/</a>which will take you to weinres interface, which looks like this:
<p><div id="attachment_500" class="wp-caption alignright" style="width: 160px"><a href="http://envyandroid.com/wp/wp-content/uploads/2011/08/Untitled-2.png"><img class="size-thumbnail wp-image-500 " title="Untitled-2" src="http://envyandroid.com/wp/wp-content/uploads/2011/08/Untitled-2-150x150.png" alt="" width="150" height="150" /></a><p class="wp-caption-text">Weinres webinterface</p></div></li>
<li>And then open <a href="http://127.0.0.1:8081/client/" target="_blank">http://127.0.0.1:8081/client/</a> in another tabs. This is where you will do the website inspection, once the mobile device is connected.</li>
<li>On your mobile device, on the same network (wifi on), enter your computers local ip followed by port 8081 in the url.<br />
Something like this: <span class="error">192.168.0.105:8081</span></li>
<li>You should then see the weinre website on your mobile device, like pictured above.</li>
<li>Scroll down on your device, and copy the bookmarklet text:
<pre class="brush: jscript; title: ; notranslate">
javascript:(function(e){e.setAttribute(&quot;src&quot;,&quot;http://192.168.1.105:8081/target/target-script-min.js#anonymous&quot;);document.getElementsByTagName(&quot;body&quot;)[0].appendChild(e);})(document.createElement(&quot;script&quot;));void(0);
</pre>
<p>Where 192.168.1.105 automatically points to the local ip of your computer, so don&#8217;t worry <img src='http://envyandroid.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>The goal is to create a bookmark with this code. On iPhone, create a new bookmark, save it, then go and edit it. Then you can paste in the javascript code above as the bookmarks adress. A little bit complex, but it works.</li>
<li>Go to the website you want to debug, then open the bookmarks, and click our newly created bookmark. this should run the javascript which connects to weinre on your computer.</li>
</ol>
<p>The game is on, and you should now be able to edit the website with the webinspector, that is the last tab we opened in chrome: <a href="http://127.0.0.1:8081/client/" target="_blank">http://127.0.0.1:8081/client/</a> just hit the big green &#8220;Elements&#8221; button on top.</p>
<div id="attachment_502" class="wp-caption alignnone" style="width: 160px"><a href="http://envyandroid.com/wp/wp-content/uploads/2011/08/Untitled-4.png"><img class="size-thumbnail wp-image-502" title="Untitled-4" src="http://envyandroid.com/wp/wp-content/uploads/2011/08/Untitled-4-150x150.png" alt="" width="150" height="150" /></a><p class="wp-caption-text">Press the &quot;Elements&quot; button</p></div>
<p>That button will open the inspector for you to toy around in. If you look closer at this image, you can see me editing the article header of this website, which is loaded on the mobile device.</p>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2011/08/Untitled-5-headerchange.png"><img class="alignnone size-medium wp-image-503" title="Untitled-5-headerchange" src="http://envyandroid.com/wp/wp-content/uploads/2011/08/Untitled-5-headerchange-275x300.png" alt="" width="275" height="300" /></a></p>
<p>Any changes you do in the inspector will reflect on the mobile device (here, iPhone 3GS), just like Firebug works for firefox:</p>
<div id="attachment_496" class="wp-caption alignnone" style="width: 330px"><a href="http://envyandroid.com/wp/wp-content/uploads/2011/08/IMG_0047.png"><img class="size-full wp-image-496" title="IMG_0047" src="http://envyandroid.com/wp/wp-content/uploads/2011/08/IMG_0047.png" alt="" width="320" height="480" /></a><p class="wp-caption-text">Before editing the article header. (The gray box around the header is automatically applied when you hover an item in the web inspector.)</p></div>
<div id="attachment_498" class="wp-caption alignnone" style="width: 330px"><a href="http://envyandroid.com/wp/wp-content/uploads/2011/08/IMG_0049.png"><img class="size-full wp-image-498" title="IMG_0049" src="http://envyandroid.com/wp/wp-content/uploads/2011/08/IMG_0049.png" alt="" width="320" height="480" /></a><p class="wp-caption-text">After editing the header</p></div>
<p>This ingenius tool helped me debug a website I was working on, so I wanted to share it with everyone <img src='http://envyandroid.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Please share this article.</p>
 <img src="http://envyandroid.com/wp/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=483" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://envyandroid.com/archives/483/easily-debug-mobile-websites-with-weinre/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Database Caching 26/35 queries in 0.015 seconds using disk: basic

Served from: envyandroid.com @ 2012-05-20 00:18:28 -->
