<?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>Droid Hacks</title>
	<atom:link href="http://droidhacks.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://droidhacks.com</link>
	<description>Tips and Tricks for Android Users</description>
	<lastBuildDate>Wed, 10 Jun 2009 02:39:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Android Scripting Environment</title>
		<link>http://droidhacks.com/2009/06/android-scripting-environment/</link>
		<comments>http://droidhacks.com/2009/06/android-scripting-environment/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 02:39:39 +0000</pubDate>
		<dc:creator>Lead Hacker</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[lua]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://droidhacks.com/?p=49</guid>
		<description><![CDATA[Google has recently released a scripting environment for Android that allows you to write Python, Lua, or BeanShell scripts that interface with Android functionality. From the project page:

Handle intents
Start activities
Make phone calls
Send text messages
Scan bar codes
Poll location and sensor data
Use text-to-speech

]]></description>
			<content:encoded><![CDATA[<p>Google has recently released a <a href="http://code.google.com/p/android-scripting/">scripting environment for Android</a> that allows you to write Python, Lua, or BeanShell scripts that interface with Android functionality. From the project page:</p>
<ul>
<li>Handle intents</li>
<li>Start activities</li>
<li>Make phone calls</li>
<li>Send text messages</li>
<li>Scan <a rel="nofollow" href="http://code.google.com/p/zxing/">bar codes</a></li>
<li>Poll location and sensor data</li>
<li>Use <a rel="nofollow" href="http://code.google.com/p/eyes-free/">text-to-speech</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://droidhacks.com/2009/06/android-scripting-environment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting WebView To Load New Pages</title>
		<link>http://droidhacks.com/2009/06/getting-webview-to-load-new-pages/</link>
		<comments>http://droidhacks.com/2009/06/getting-webview-to-load-new-pages/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 19:31:16 +0000</pubDate>
		<dc:creator>Lead Hacker</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[sdk]]></category>
		<category><![CDATA[webview]]></category>

		<guid isPermaLink="false">http://droidhacks.com/?p=47</guid>
		<description><![CDATA[There are a bunch of examples of using WebView to display HTML content loaded from the web in an Android app, including the sample from Google for the WebView class. However the ones I found generally don&#8217;t load new pages on their own. I can load up Google, but if you click on anything in [...]]]></description>
			<content:encoded><![CDATA[<p>There are a bunch of examples of using <a href="http://developer.android.com/reference/android/webkit/WebView.html">WebView</a> to display HTML content loaded from the web in an Android app, including the <a href="http://developer.android.com/guide/tutorials/views/hello-webview.html">sample from Google for the WebView class</a>. However the ones I found generally don&#8217;t load new pages on their own. I can load up Google, but if you click on anything in the app it launches a browser and takes the user out of the app. The answer to the problem is in the additional points on that Hello, WebView page &#8211; you need to set a new WebViewClient to handle the URL load requests. Their example is very helpful, but I prefer to do the override with an anonymous inner class:</p>
<pre>public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    WebView webview = new WebView(this);
    webview.getSettings().setJavaScriptEnabled(true);
    webview.setWebViewClient(new WebViewClient() {
        @Override public boolean shouldOverrideUrlLoading(WebView view, String url) {
            view.loadUrl(url);
    	    return true;
    	}
    });
    webview.loadUrl("http://google.com");
    setContentView(webview);
}</pre>
<p>However, if you follow a link to an image it downloads instead of opens in the view. That&#8217;s the same thing the built in browser does, but wasn&#8217;t the behavior I expected. I&#8217;ll have to figure out how to handle that a bit better.</p>
]]></content:encoded>
			<wfw:commentRss>http://droidhacks.com/2009/06/getting-webview-to-load-new-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monitoring Network Traffic Using OS X</title>
		<link>http://droidhacks.com/2009/06/monitoring-network-traffic-using-os-x/</link>
		<comments>http://droidhacks.com/2009/06/monitoring-network-traffic-using-os-x/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 23:19:31 +0000</pubDate>
		<dc:creator>Lead Hacker</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[wifi]]></category>
		<category><![CDATA[wireshark]]></category>

		<guid isPermaLink="false">http://droidhacks.com/?p=45</guid>
		<description><![CDATA[Here&#8217;s a tip for monitoring network traffic from your Android phone using OS X. The same thing works for iPhone (or any other mobile device you can configure to use a wifi connection). I frequently use it to see how some bit of client/server interaction is done.

Install Wireshark
Follow the instructions in the readme to also [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a tip for monitoring network traffic from your Android phone using OS X. The same thing works for iPhone (or any other mobile device you can configure to use a wifi connection). I frequently use it to see how some bit of client/server interaction is done.</p>
<ul>
<li>Install <a href="http://www.wireshark.org/">Wireshark</a></li>
<li>Follow the instructions in the readme to also install the ChmodBPF script</li>
<li>Under Sharing area of the OS X settings app configure your system to use an ethernet connection and share it out to wifi clients</li>
<li>Now configure your device to connect to the wifi network provided by your system, test to make sure it works</li>
<li>Startup Wireshark and set it to capture traffic (wifi is en1 on MacBook Pro systems, what I normally use)</li>
</ul>
<p>And that&#8217;s it, you should now get quite readable dumps of what applications are doing to communicate. Lots of interesting things you can learn digging into how folks structure their client/server interaction.</p>
]]></content:encoded>
			<wfw:commentRss>http://droidhacks.com/2009/06/monitoring-network-traffic-using-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Long Press on the Home Key</title>
		<link>http://droidhacks.com/2009/05/long-press-on-the-home-key/</link>
		<comments>http://droidhacks.com/2009/05/long-press-on-the-home-key/#comments</comments>
		<pubDate>Fri, 29 May 2009 18:58:15 +0000</pubDate>
		<dc:creator>Lead Hacker</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[home]]></category>
		<category><![CDATA[launcher]]></category>

		<guid isPermaLink="false">http://droidhacks.com/?p=41</guid>
		<description><![CDATA[Intuitive to Nokia users, but I don&#8217;t think folks coming from other platforms have picked it up. If you press and hold the home key you get a list of recent apps, which makes switching around a lot easier if you&#8217;re bouncing back and forth. Here&#8217;s what the app list looks like when it comes [...]]]></description>
			<content:encoded><![CDATA[<p>Intuitive to Nokia users, but I don&#8217;t think folks coming from other platforms have picked it up. If you press and hold the home key you get a list of recent apps, which makes switching around a lot easier if you&#8217;re bouncing back and forth. Here&#8217;s what the app list looks like when it comes up:</p>
<p><img class="aligncenter size-full wp-image-42" title="running_apps" src="http://droidhacks.com/wp-content/uploads/2009/05/running_apps.png" alt="running_apps" width="320" height="480" /></p>
]]></content:encoded>
			<wfw:commentRss>http://droidhacks.com/2009/05/long-press-on-the-home-key/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Launcher Dock</title>
		<link>http://droidhacks.com/2009/05/launcher-dock/</link>
		<comments>http://droidhacks.com/2009/05/launcher-dock/#comments</comments>
		<pubDate>Thu, 28 May 2009 16:02:28 +0000</pubDate>
		<dc:creator>Lead Hacker</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[home]]></category>
		<category><![CDATA[launcher]]></category>
		<category><![CDATA[settings]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://droidhacks.com/?p=34</guid>
		<description><![CDATA[Another widget I&#8217;m running now that I have Cupcake installed is &#8220;Launcher Dock&#8221;. It&#8217;s a 1&#215;1 widget that holds launchers for up to 8 apps. I put some of my less frequently launched (but still relatively frequently used) apps in there so that I can have all their icons on the main screen.  This is [...]]]></description>
			<content:encoded><![CDATA[<p>Another widget I&#8217;m running now that I have Cupcake installed is &#8220;Launcher Dock&#8221;. It&#8217;s a 1&#215;1 widget that holds launchers for up to 8 apps. I put some of my less frequently launched (but still relatively frequently used) apps in there so that I can have all their icons on the main screen.  This is a shot of my main screen with a configured Launcher Dock by the bottom right corner, just above the San Mateo weather widget:</p>
<p><img class="aligncenter size-full wp-image-35" title="launcher_dock_1" src="http://droidhacks.com/wp-content/uploads/2009/05/launcher_dock_1.png" alt="launcher_dock_1" width="320" height="480" />When you tap the widget once it brings up a selector with launchers for each of the apps you&#8217;ve added plus an icon to start the widget configuration interface. Here&#8217;s what mine looks like after tapping on the widget:</p>
<p><img class="aligncenter size-full wp-image-36" title="launcher_dock_2" src="http://droidhacks.com/wp-content/uploads/2009/05/launcher_dock_2.png" alt="launcher_dock_2" width="320" height="480" />And what the configuration interface looks like if you tap on that center icon:</p>
<p><img class="aligncenter size-full wp-image-37" title="launcher_dock_3" src="http://droidhacks.com/wp-content/uploads/2009/05/launcher_dock_3.png" alt="launcher_dock_3" width="320" height="480" />I think it&#8217;s a pretty slick widget. Great way to increase launcher density if you have a few widgets taking up some space. And it looks pretty good there on the home screen.</p>
]]></content:encoded>
			<wfw:commentRss>http://droidhacks.com/2009/05/launcher-dock/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Compiling C Code for Android Using OS X</title>
		<link>http://droidhacks.com/2009/05/compiling-c-code-for-android-using-os-x/</link>
		<comments>http://droidhacks.com/2009/05/compiling-c-code-for-android-using-os-x/#comments</comments>
		<pubDate>Wed, 27 May 2009 17:40:09 +0000</pubDate>
		<dc:creator>Lead Hacker</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[adb]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[native]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://droidhacks.com/?p=24</guid>
		<description><![CDATA[I wanted to try out compiling some native C code for use on my device, but I wanted to do it using my OS X machine. I found this post about using the prebuilt toolchain over at Android Tricks, but figured I would write up some additional details for those who might also be looking.

Follow [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to try out compiling some native C code for use on my device, but I wanted to do it using my OS X machine. I found <a href="http://android-tricks.blogspot.com/2009/02/hello-world-c-program-on-using-android.html">this post about using the prebuilt toolchain over at Android Tricks</a>, but figured I would write up some additional details for those who might also be looking.</p>
<ol>
<li>Follow the <a href="http://source.android.com/download">instructions to download and build Android from source</a>. Follow the whole thing (I had to create a case-sensitive disk image and all), including the actual build step. Otherwise you won&#8217;t have the libraries necessary and agcc will error out when you try to run it.</li>
<li>Add the prebuilt/darwin-x86/toolchain/arm-eabi-4.2.1/bin subdirectory of where ever you built the source to your PATH, add it to your .bash_profile if you want.</li>
<li>Download the <a href="http://plausible.org/andy/agcc">agcc wrapper script</a>, put it somewhere in your path, and make it executable.</li>
</ol>
<p>Now you should be ready to compile a program and download it to your phone. This was my test app:</p>
<pre>#include &lt;stdio.h&gt;

int main( int argc, char **argv ) {
  printf("Hello from Droid Hacks!\n");
  return 0;
}</pre>
<p>And you should be able to compile it with &#8220;agcc hello.c -o hello&#8221; and end up with a hello executable:</p>
<pre>~ &gt; agcc hello.c -o hello
~ &gt; file hello
hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), not stripped
~ &gt;</pre>
<p>And you can move the file across to the phone and run it. You&#8217;ll have to make a directory to push it into. The sdcard is marked as noexec, so you can&#8217;t run stuff from there. And the data directory has more restrictive permissions. So you&#8217;ll have to su and create a directory on the data partition, and relax the perms on that directory:</p>
<pre>~ &gt; adb shell
$ su
# mkdir /data/droidtest
# chmod 777 /data/droidtest
# exit
$ exit
~ &gt; adb push hello /data/droidtest
418 KB/s (6747 bytes in 0.015s)
~ &gt; adb shell
$ cd /data/droidtest
$ ls -l
-rwxrwxrwx shell    shell        6747 2009-05-27 08:56 hello
$ ./hello
Hello from Droid Hacks!
$</pre>
<p>And of course you can run the same thing from the terminal on your device as well:<img class="aligncenter size-full wp-image-26" title="terminal_c_app_rotated" src="http://droidhacks.com/wp-content/uploads/2009/05/terminal_c_app_rotated.png" alt="terminal_c_app_rotated" width="480" height="320" /></p>
]]></content:encoded>
			<wfw:commentRss>http://droidhacks.com/2009/05/compiling-c-code-for-android-using-os-x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Root Access Terminal Under Cupcake</title>
		<link>http://droidhacks.com/2009/05/root-access-terminal-under-cupcake/</link>
		<comments>http://droidhacks.com/2009/05/root-access-terminal-under-cupcake/#comments</comments>
		<pubDate>Tue, 26 May 2009 20:03:03 +0000</pubDate>
		<dc:creator>Lead Hacker</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[adb]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://droidhacks.com/?p=18</guid>
		<description><![CDATA[I imaged my development phone with the Android 1.5 images from HTC. I was able to su to root when I connected to the phone using &#8220;adb shell&#8221;, but wasn&#8217;t able to get root when using the terminal app on the phone itself. There&#8217;s nothing that keeps you from setting up a mechanism to get [...]]]></description>
			<content:encoded><![CDATA[<p>I imaged my development phone with the <a href="http://www.htc.com/www/support/android/adp.html">Android 1.5 images from HTC</a>. I was able to su to root when I connected to the phone using &#8220;adb shell&#8221;, but wasn&#8217;t able to get root when using the terminal app on the phone itself. There&#8217;s nothing that keeps you from setting up a mechanism to get root from the handset though. Just do this from an adb shell session after you su to root:</p>
<ul>
<li>mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system</li>
<li>cd /system/bin</li>
<li>cat sh &gt; usu</li>
<li>chmod 4755 usu</li>
</ul>
<p>Some of the instructions I found online suggested just calling the new binary su, but I was concerned about that overriding the default su depending on what path is getting used. So I just created a whole name &#8220;user su&#8221; which won&#8217;t reject the handset user when I try to change to root:</p>
<p style="text-align: center;"><img class="size-full wp-image-20 aligncenter" title="terminal_root_rotated" src="http://droidhacks.com/wp-content/uploads/2009/05/terminal_root_rotated.png" alt="terminal_root_rotated" width="480" height="320" /></p>
]]></content:encoded>
			<wfw:commentRss>http://droidhacks.com/2009/05/root-access-terminal-under-cupcake/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Toggle Settings</title>
		<link>http://droidhacks.com/2009/05/toggle-settings/</link>
		<comments>http://droidhacks.com/2009/05/toggle-settings/#comments</comments>
		<pubDate>Tue, 26 May 2009 07:05:18 +0000</pubDate>
		<dc:creator>Lead Hacker</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[bluetooth]]></category>
		<category><![CDATA[brightness]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[gps]]></category>
		<category><![CDATA[settings]]></category>
		<category><![CDATA[timeout]]></category>
		<category><![CDATA[toggle]]></category>
		<category><![CDATA[wifi]]></category>

		<guid isPermaLink="false">http://droidhacks.com/?p=3</guid>
		<description><![CDATA[Normally I have a few quick toggle applications sitting on my home screen to quickly switch on and off Bluetooth, Wifi, GPS, etc. It really saves a ton of battery life switching off hardware when it&#8217;s not in use. I just ran across the free Toggle Settings app from cooolmagic. It has all the hardware [...]]]></description>
			<content:encoded><![CDATA[<p>Normally I have a few quick toggle applications sitting on my home screen to quickly switch on and off Bluetooth, Wifi, GPS, etc. It really saves a ton of battery life switching off hardware when it&#8217;s not in use. I just ran across the free Toggle Settings app from cooolmagic. It has all the hardware switches, some cool status info (like what wifi network you&#8217;re connected to), and new toggles for stuff like auto-sync. Very useful, and it looks pretty slick. Just search for &#8220;Toggle Settings&#8221; in the market and you should find both the 1.1 and 1.5 versions of the app. Here&#8217;s a quick rundown of the controls:</p>
<ul>
<li>Turn on and off airline mode</li>
<li>Turn on and off autosync</li>
<li>Turn on and off bluetooth</li>
<li>Turn on and off GPS</li>
<li>Turn on and off Wifi, and show what network you&#8217;re connected to if you are connected</li>
<li>Control the brightness level and screen timeout, or disable screen timeout completely</li>
<li>Turn on and off silent mode</li>
<li>Control the volume</li>
</ul>
<p><img class="alignnone size-full wp-image-10" title="toggle_settings_1" src="http://droidhacks.com/wp-content/uploads/2009/05/toggle_settings_1.png" alt="toggle_settings_1" width="320" height="480" /><img class="alignnone size-full wp-image-11" title="toggle_settings_2" src="http://droidhacks.com/wp-content/uploads/2009/05/toggle_settings_2.png" alt="toggle_settings_2" width="320" height="480" /></p>
]]></content:encoded>
			<wfw:commentRss>http://droidhacks.com/2009/05/toggle-settings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
