<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8371221544034078032</id><updated>2012-01-27T01:52:42.467-08:00</updated><category term='DynDNS'/><category term='PHP'/><category term='PirateBox'/><category term='PAW'/><category term='Google TV'/><category term='NFC'/><category term='CacheStumbler'/><category term='Geocaching'/><category term='Cloud-X'/><category term='SSL'/><category term='Windows'/><category term='Android'/><category term='DavDrive'/><title type='text'>Fun2Code</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>33</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-1968907943783407845</id><published>2012-01-26T01:58:00.000-08:00</published><updated>2012-01-26T02:00:37.568-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PirateBox'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='PAW'/><title type='text'>Changing the PirateBox Location</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-DPsMG-hSJlA/TtelbLdR0NI/AAAAAAAAAIY/9GZt9z1zASY/s1600/icon_no_alpha.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-DPsMG-hSJlA/TtelbLdR0NI/AAAAAAAAAIY/9GZt9z1zASY/s1600/icon_no_alpha.png" /&gt;&lt;/a&gt;&lt;/div&gt;This post gives a quick overview what has to be done to move the PirateBox installation to a different directory.&lt;br /&gt;&lt;br /&gt;By default the PirateBox HTML files are located in the directory &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/sdcard/paw/html/app/plugins/piratebox_plugin/html&lt;/span&gt; and uploaded files are stored in the folder uploads inside the HTML directory.&lt;br /&gt;&lt;br /&gt;I'll demonstrate what to do to move the PirateBox to a different directory (in my example &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/sdcard/piratebox_ext&lt;/span&gt;). You can of course also use a directory on an external SD card.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Copying the HTML Directory&lt;/span&gt;&lt;br /&gt;First thing to do ist to create the new folder &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/sdcard/pireatebox_ext&lt;/span&gt;.&lt;br /&gt;Now copy the directory /&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;sdcard/paw/html/app/plugins/piratebox_plugin/html&lt;/span&gt; to the new location &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/sdcard/pireatebox_ext&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;As a next step we will edit the PAW server configuration.&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;br /&gt;Changing the PAW Configuration&lt;/span&gt;&lt;br /&gt;The configuration file used for PirateBox is named &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;handlers.xml&lt;/span&gt; and it's located inside the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/sdcard/paw/html/app/plugins/piratebox_plugin/conf&lt;/span&gt; directory.&lt;br /&gt;Edit this file and replace each occurence of &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/sdcard/paw/html/app/plugins/piratebox_plugin&lt;/span&gt; with &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/sdcard/piraebox_ext&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Changing the Web Pages&lt;/span&gt;&lt;br /&gt;Last step to do is to edit the files &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;list.xhtml&lt;/span&gt; and &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;pb.xhtml&lt;/span&gt; inside the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/sdcard/piratebox_ext/html&lt;/span&gt; directory.&lt;br /&gt;In each file there is one line that defines the upload directory.&lt;br /&gt;Again, change each occurence of &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/sdcard/paw/html/app/plugins/piratebox_plugin&lt;/span&gt; to &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/sdcard/piraebox_ext&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;That's it ... on next startup the new PirateBox location should be used.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-1968907943783407845?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/1968907943783407845/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2012/01/changing-piratebox-location.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/1968907943783407845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/1968907943783407845'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2012/01/changing-piratebox-location.html' title='Changing the PirateBox Location'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-DPsMG-hSJlA/TtelbLdR0NI/AAAAAAAAAIY/9GZt9z1zASY/s72-c/icon_no_alpha.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-667357437876621874</id><published>2011-12-22T03:16:00.000-08:00</published><updated>2012-01-03T04:47:31.587-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='PAW'/><category scheme='http://www.blogger.com/atom/ns#' term='NFC'/><title type='text'>NFC - NDEF Support</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-h8q4Xyg0N9M/ThsJLMwA89I/AAAAAAAAAFk/bfNmPEHkw2s/s1600/icon.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-h8q4Xyg0N9M/ThsJLMwA89I/AAAAAAAAAFk/bfNmPEHkw2s/s1600/icon.png" /&gt;&lt;/a&gt;&lt;/div&gt;NDEF messages are the standard way to write information to NFC tags on Android. &lt;br /&gt;The latest version of PAW (0.84) has support for text, URI, smart poster and mime media NDEF messages.&lt;br /&gt;The classes and their methods are described in the &lt;i&gt;PAW Functions&lt;/i&gt; documentation within the PAW web application.&lt;br /&gt;NFC support is now also available in &lt;a href="http://fun2code-blog.blogspot.com/2010/09/paw-runtime.html" target="_blank"&gt;PAW Runtime&lt;/a&gt;.&lt;br /&gt;To show how the new functionality can be used (and to give you the possibility to play with NFC tags), a &lt;a href="http://paw-android.fun2code.de/plugins/" target="_blank"&gt;NFC reader/writer plugin&lt;/a&gt; is available for PAW. This plugin is also available in the newest add-on package for PAW Runtime.&lt;br /&gt;&lt;br /&gt;Here are some screenshots... &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Plugin&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-QZ3rkswpEKU/TvMNEHX3vwI/AAAAAAAAAKE/mxRzX3hVZdk/s1600/nfc_plugin.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="311" src="http://1.bp.blogspot.com/-QZ3rkswpEKU/TvMNEHX3vwI/AAAAAAAAAKE/mxRzX3hVZdk/s320/nfc_plugin.png" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;NFC Plugin&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-E5QH6Xnq9o0/TvMOAJgONMI/AAAAAAAAAKc/wdi6AVIVVac/s1600/tag.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-E5QH6Xnq9o0/TvMOAJgONMI/AAAAAAAAAKc/wdi6AVIVVac/s320/tag.png" width="180" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Plugin requesting NFC Tag&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-MwdfMDBqT4I/TvMNWN_os5I/AAAAAAAAAKQ/7LmABG5nzy0/s1600/tag.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt; &lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Runtime&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-GQ51NpOlOwQ/TvMOUMl6CWI/AAAAAAAAAKo/PjkCDPTlVdo/s1600/runtime_menu.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/-GQ51NpOlOwQ/TvMOUMl6CWI/AAAAAAAAAKo/PjkCDPTlVdo/s320/runtime_menu.png" width="180" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;PAW Runtime with NFC Reader/Writer&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-lvOtXMMUAe8/TvMOhDvkDGI/AAAAAAAAAK0/I-t_yzqPzrQ/s1600/runtime_nfc.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/-lvOtXMMUAe8/TvMOhDvkDGI/AAAAAAAAAK0/I-t_yzqPzrQ/s320/runtime_nfc.png" width="180" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Runtime version&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;span id="goog_1364101995"&gt;&lt;/span&gt;&lt;span id="goog_1364101996"&gt;&lt;/span&gt;&lt;br /&gt;This will be the last update of PAW this year and possibly the last blog entry.&lt;br /&gt;To all of you ... Merry Christmas and a Happy New Year :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-667357437876621874?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/667357437876621874/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2011/12/nfc-ndef-support.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/667357437876621874'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/667357437876621874'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2011/12/nfc-ndef-support.html' title='NFC - NDEF Support'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-h8q4Xyg0N9M/ThsJLMwA89I/AAAAAAAAAFk/bfNmPEHkw2s/s72-c/icon.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-1118383924251879196</id><published>2011-12-15T10:24:00.000-08:00</published><updated>2012-01-27T01:52:42.483-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='NFC'/><title type='text'>ICS: Getting NFC Tags to Work</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-eTHsK1Wab1w/TvJInoIGLVI/AAAAAAAAAJ4/vHvOEq_jV6E/s1600/nfc_tag_small.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-eTHsK1Wab1w/TvJInoIGLVI/AAAAAAAAAJ4/vHvOEq_jV6E/s1600/nfc_tag_small.png" /&gt;&lt;/a&gt;&lt;/div&gt;Since December I'm a happy owner of a Galaxy Nexus :)&lt;br /&gt;NFC seemed like an interesting thing, so I started to integrate NFC support into PAW.&lt;br /&gt;&lt;br /&gt;First thing I did was to order some Mifare Classic 1K tags from &lt;a href="http://www.tagsfordroid.com/" target="_blank"&gt;tagsfordroid.com&lt;/a&gt;.&lt;br /&gt;They arrived fairly quickly and delivery was free of charge.&lt;br /&gt;&lt;table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-B5R11KHf_5U/TuouuRq6caI/AAAAAAAAAJk/Ke02bejWKvw/s1600/tags.png" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-B5R11KHf_5U/TuouuRq6caI/AAAAAAAAAJk/Ke02bejWKvw/s1600/tags.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;NFC Tags&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;To try things out I installed a lot of NFC reader and writer apps. To my dismay none of them seemed to work.&lt;br /&gt;They could read the tags but could not write them. Having no idea how NFC worked, I was fairly disappointed :(&lt;br /&gt;&lt;br /&gt;Searching the web I found out that this seems to be a bug in ICS:&lt;br /&gt;&lt;a href="http://code.google.com/p/android/issues/detail?id=22258" target="_blank"&gt;http://code.google.com/p/android/issues/detail?id=22258&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Googles sais that there will be a fix provided, but when, no one can tell.&lt;br /&gt;So I tried to get it working myself...&lt;br /&gt;&lt;br /&gt;If you would like to test the things below, install the &lt;a href="https://market.android.com/details?id=de.fun2code.android.pawserver" target="_blank"&gt;latest PAW version&lt;/a&gt; (0.80) from the Android Market.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Disclaimer:&lt;/span&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;This solution is only working for Mifare Classic 1K tags!&lt;br /&gt;If you try as described you do it at your own risk!&lt;br /&gt;It's not my fault if your tags do not work afterwards!&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;&lt;span style="color: #e06666;"&gt;Read the updates at the end of the post first! &lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;The Problem&lt;/span&gt;&lt;br /&gt;The problem (as reported in the bug report) seems to be that the tech reported by the tag do not contain&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;android.nfc.tech.Ndef&lt;/span&gt; which is necessary to write NDEF messages.&lt;br /&gt;&lt;br /&gt;You can try this with the following code that you can insert into the BenShell Console of the PAW web application:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:javascript"&gt;import de.fun2code.android.pawserver.AndroidInterface;&lt;br /&gt;import android.nfc.NfcAdapter;&lt;br /&gt;&lt;br /&gt;intent = AndroidInterface.getNfcIntent(5); // 5 secs timeout&lt;br /&gt;if(intent != null) {&lt;br /&gt;&amp;nbsp; tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);&lt;br /&gt;&amp;nbsp; print(tag);&lt;br /&gt;}&lt;br /&gt;else {&lt;br /&gt;&amp;nbsp; print("No Tag found!");&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If the result is &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;TAG: Tech [android.nfc.tech.MifareClassic, android.nfc.tech.NfcA]&lt;/span&gt; writing NDEF messages will not work!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;The Possible Fix&lt;/span&gt;&lt;br /&gt;As mentioned above I have no expirience with NFC, so I tried to find a solution that worked without having to know NFC or the Mifare tags in detail.&lt;br /&gt;&lt;br /&gt;I searched the web and found some Mifare Classic 1K dumps at the &lt;a href="http://code.google.com/p/nfc-tools/source/browse/trunk/dumps/mifare-classic" target="_blank"&gt;nfc-tools&lt;/a&gt; site.&lt;br /&gt;After downloading a dump I tried to write it to the tag. Interesting enough it seemd to work :)&lt;br /&gt;&lt;br /&gt;After writing the dump, the above script reported:&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;TAG: Tech [android.nfc.tech.MifareClassic, android.nfc.tech.NfcA, android.nfc.tech.Ndef]&lt;/div&gt;&lt;br /&gt;So here are the step by step instructions:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Download the dump file from the nfc-tools site: &lt;a href="http://nfc-tools.googlecode.com/svn/trunk/dumps/mifare-classic/mfc_1k__url_nfc-tools.mfd" target="_blank"&gt;mfc_1k__url_nfc-tools.mfd&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Save the dump file to the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/sdcard&lt;/span&gt; of your android device.&lt;/li&gt;&lt;li&gt;Start PAW and open the BeanShell console.&lt;/li&gt;&lt;li&gt;Copy/paste the following script into the console:&lt;br /&gt;&lt;pre class="brush:javascript"&gt;/*&lt;br /&gt;Mifare Classic - Write dump&lt;br /&gt;*/&lt;br /&gt;import de.fun2code.android.pawserver.AndroidInterface;&lt;br /&gt;import android.nfc.NfcAdapter;&lt;br /&gt;import android.nfc.NdefRecord;&lt;br /&gt;import android.nfc.NdefMessage;&lt;br /&gt;import android.nfc.tech.*;&lt;br /&gt;import android.os.Bundle;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;intent = AndroidInterface.getNfcIntent(5); // 5 secs timeout&lt;br /&gt;print(intent);&lt;br /&gt;if(intent != null) {&lt;br /&gt;  tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);&lt;br /&gt;  print(tag);&lt;br /&gt;  &lt;br /&gt;  if(nfc != null) {&lt;br /&gt;      nfc = MifareClassic.get(tag);&lt;br /&gt;      nfc.connect();&lt;br /&gt;    print("Is connected: " + nfc.isConnected());&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;     fis = new FileInputStream("/sdcard/mfc_1k__url_nfc-tools.mfd");&lt;br /&gt;     &lt;br /&gt;     b = new byte[16];&lt;br /&gt;&lt;br /&gt;     errors = 0;&lt;br /&gt;    &lt;br /&gt;    sectors = nfc.getSectorCount();&lt;br /&gt;    blocksPerSector = nfc.getBlockCountInSector(0);&lt;br /&gt;    &lt;br /&gt;    for(sector=0; sector&amp;lt;sectors; sector++) {&lt;br /&gt;      print("Sector " + sector);&lt;br /&gt;      &lt;br /&gt;      for(block=0; block &amp;lt; blocksPerSector; block++) {&lt;br /&gt;        logicBlock = nfc.sectorToBlock(sector) + block;&lt;br /&gt;        $$.print("  Block: " + block + " ... ");&lt;br /&gt;&lt;br /&gt;        fis.read(b);&lt;br /&gt;&lt;br /&gt;        if(sector == 0 &amp;amp;&amp;amp; block == 0) {&lt;br /&gt;           print("Manufacturer block ... skipped");&lt;br /&gt;           continue;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        try {&lt;br /&gt;          nfc.authenticateSectorWithKeyA(sector, MifareClassic.KEY_DEFAULT);&lt;br /&gt;          nfc.writeBlock(logicBlock, b);&lt;br /&gt;          print("ok");&lt;br /&gt;        }&lt;br /&gt;        catch(e) {&lt;br /&gt;            print("error");&lt;br /&gt;            errors++;&lt;br /&gt;        }&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    fis.close();&lt;br /&gt;    nfc.close();&lt;br /&gt;      print("--------------------------------------------------------------------------");&lt;br /&gt;      print("Errors: " + errors);&lt;br /&gt;      print("Dump written!");&lt;br /&gt;   }&lt;br /&gt;   else {&lt;br /&gt;      print("Tag not supported!");&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;else {&lt;br /&gt;  print("No Tag found!");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Start the script and as soon as the PAW app is in foreground, place the tag at the back of the phone and leaf it there until the script is finished.&lt;/li&gt;&lt;/ol&gt;After that the tag is hopefully working.&lt;br /&gt;&lt;br /&gt;Good luck and happy hacking :)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Update:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Ndef.getMaxSize()&lt;/span&gt; returns only 92 bytes that can be written to a NDEF message. I don't think that's normal :(&lt;br /&gt;&lt;br /&gt;You can check this yourself with the following code:&lt;br /&gt;&lt;pre class="brush:javascript"&gt;import de.fun2code.android.pawserver.AndroidInterface;&lt;br /&gt;import android.nfc.NfcAdapter;&lt;br /&gt;import android.nfc.tech.Ndef;&lt;br /&gt; &lt;br /&gt;intent = AndroidInterface.getNfcIntent(5); // 5 secs timeout&lt;br /&gt;if(intent != null) {&lt;br /&gt;  tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);&lt;br /&gt;  print("Max NDEF message size: " + Ndef.get(tag).getMaxSize() + " bytes");&lt;br /&gt;}&lt;br /&gt;else {&lt;br /&gt;  print("No Tag found!");&lt;br /&gt;}&amp;nbsp;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Update 2:&lt;/span&gt;&lt;br /&gt;The latest &lt;b&gt;&lt;i&gt;NFC TagWriter by NXP&lt;/i&gt;&lt;/b&gt; is able to format unformatted tags and fixes the problem.&lt;br /&gt;Here is the Android Market link: &lt;a href="https://market.android.com/details?id=com.nxp.nfc.tagwriter" target="_blank"&gt;NFC TagWriter by NXP &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-1118383924251879196?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/1118383924251879196/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2011/12/ics-getting-nfc-tags-to-work.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/1118383924251879196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/1118383924251879196'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2011/12/ics-getting-nfc-tags-to-work.html' title='ICS: Getting NFC Tags to Work'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-eTHsK1Wab1w/TvJInoIGLVI/AAAAAAAAAJ4/vHvOEq_jV6E/s72-c/nfc_tag_small.png' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-952182150949377770</id><published>2011-12-01T08:30:00.000-08:00</published><updated>2012-01-26T01:59:06.364-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PirateBox'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='PAW'/><title type='text'>PirateBox on Android</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-DPsMG-hSJlA/TtelbLdR0NI/AAAAAAAAAIY/9GZt9z1zASY/s1600/icon_no_alpha.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-DPsMG-hSJlA/TtelbLdR0NI/AAAAAAAAAIY/9GZt9z1zASY/s1600/icon_no_alpha.png" /&gt;&lt;/a&gt;&lt;/div&gt;A while ago &lt;i&gt;psundegroud&lt;/i&gt; created the thread &lt;a href="http://forum.xda-developers.com/showthread.php?t=935157" target="_blank"&gt;[TUT]Roll Your Own PirateBox! PirateBoxMobile&lt;/a&gt;. At that time my only rooted device was an old &lt;i&gt;Samsung Galaxy I7500&lt;/i&gt; running Android 1.6. We managed to get this working. The two main issues were that &lt;a href="http://code.google.com/p/android-wifi-tether/" target="_blank"&gt;WiFi Tether&lt;/a&gt; was needed, which didn't run on all Android devices and that only Ad-Hoc mode was available. The missing Infrastructure mode prevented most Androids from seeing the PirateBox hotspot.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-yGIepwkPkmE/TtelkoyHASI/AAAAAAAAAIg/hWSjTZQnRx4/s1600/piratebox_adam.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" height="150" src="http://3.bp.blogspot.com/-yGIepwkPkmE/TtelkoyHASI/AAAAAAAAAIg/hWSjTZQnRx4/s200/piratebox_adam.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;Meanwhile I have a rooted &lt;i&gt;Notion Ink Adam&lt;/i&gt; running &lt;i&gt;AdamComb v0.3&lt;/i&gt;. So I tried to get PirateBox running by using the built in tether app. Built in tethering uses Infrastructure mode, which solves above mentioned problem.&lt;br /&gt;&lt;br /&gt;On my Adam this is really working fine and I hope that it will also run on other Android units.&lt;br /&gt;I'll divide the post in two parts. The first part describes the technical details, so if someone has problems in getting this to work this might be helpful for further testing.&lt;br /&gt;&lt;br /&gt;Along with setting up the scripts I have also written a plugin for PAW which should make setup really easy.&lt;br /&gt;If you are not interested in the technical details you can right jump to the &lt;a href="http://www.blogger.com/post-edit.g?blogID=8371221544034078032&amp;amp;postID=952182150949377770#install_plugin"&gt;Installing the Plugin&lt;/a&gt; section.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Techical Details&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Setting up the PirateBox during boot is done by PAW startup scripts.&lt;br /&gt;&lt;br /&gt;The main tasks of these scripts are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Killing dnsmasq and restarting it with changed parameters, so that DNS requests always respond with the IP of the Android device.&lt;/li&gt;&lt;li&gt;Configuring iptables so that requests to port 80 are redirected to the port PAW is listening on, because PAW can not operate on privileged ports.&lt;/li&gt;&lt;li&gt;Change the PAW configuration to use the PirateBox Handler, which ensures that all unknown request are forwarded to the base URL (piratebox.org/).&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;The startup scripts are located in the subfolders &lt;span style="font-family: 'Courier New',Courier,monospace;"&gt;0&lt;/span&gt; and &lt;span style="font-family: 'Courier New',Courier,monospace;"&gt;1&lt;/span&gt; of the directory &lt;span style="font-family: 'Courier New',Courier,monospace;"&gt;/sdcard/paw/etc/init&lt;/span&gt;. These folders represent PAW runlevels. Runlevel 0 is before the server starts and after server shutdown and 1 is after server start and before the server shuts down. Scripts beginning with &lt;span style="font-family: 'Courier New',Courier,monospace;"&gt;S_&lt;/span&gt; will be called on startup and scripts starting with &lt;span style="font-family: 'Courier New',Courier,monospace;"&gt;K_&lt;/span&gt;&amp;nbsp;will be run at shutdown.&lt;br /&gt;&lt;br /&gt;So here is a short summary what these scripts are doing.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New',Courier,monospace;"&gt;0/S_PirateBox.bsh&lt;/span&gt;:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Checks if tethering is running. If not none of the steps below will be performed.&lt;/li&gt;&lt;li&gt;Kills the "original" dnsmasq process and starts a new one.&lt;/li&gt;&lt;li&gt;Executesiptables commands to get port redirection working.&lt;/li&gt;&lt;li&gt;Replaces the original PAW configuration with the PirateBox configuration.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New',Courier,monospace;"&gt;1/S_SpirateBox.bsh&lt;/span&gt;:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Checks if tethering is running. If not none of the steps below will be performed.&lt;/li&gt;&lt;li&gt;Restores the original PAW configuration.&lt;/li&gt;&lt;li&gt;Displays a PirateBox notification.&lt;/li&gt;&lt;li&gt;Sets the max upload limit to 200MB.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New',Courier,monospace;"&gt;1/K_S_SpirateBox.bsh&lt;/span&gt;:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Clears the PirateBox notification.&lt;/li&gt;&lt;li&gt;Kills dnsmasq process.&lt;/li&gt;&lt;li&gt;Stops tetherig and restarts WiFi.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New',Courier,monospace;"&gt;0/K_S_SpirateBox.bsh&lt;/span&gt;:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Removes iptables rules for port redirection.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;If you run into problems have a look at these scripts and try to run the commands inside the scripts individually.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=8371221544034078032&amp;amp;postID=952182150949377770&amp;amp;from=pencil" name="install_plugin"&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Installing the Plugin&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-GyhGdVR0Szk/Tteq7bW-y1I/AAAAAAAAAIo/ONgyvByyXZQ/s1600/Bildschirmfoto+am+2011-12-01+17%253A26%253A00.png" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="200" src="http://1.bp.blogspot.com/-GyhGdVR0Szk/Tteq7bW-y1I/AAAAAAAAAIo/ONgyvByyXZQ/s200/Bildschirmfoto+am+2011-12-01+17%253A26%253A00.png" width="184" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;PAW Plug-in Menu&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;Installing the plugin is easy. I've put it on the PAW plugin page, so you'll find it within the PAW web application or you can direct download it from the &lt;a href="http://paw-android.fun2code.de/plugins/" target="_blank"&gt;PAW Plugin Page&lt;/a&gt;.&lt;br /&gt;After download extract the ZIP file to the &lt;span style="font-family: 'Courier New',Courier,monospace;"&gt;/sdcard/paw/html/app/plugins&lt;/span&gt; directory of your Android device.&lt;br /&gt;Now after re-entering the PAW web application, the PirateBox plugin should be visible in the &lt;i&gt;Plugins &lt;/i&gt;menu.&lt;br /&gt;&lt;br /&gt;If the plugin setup screen shows a warning in red, the installation is likely to fail, because some prerequisites are missing.&lt;br /&gt;If no warnings are displayed, press the Install button. You can also try to setup a PirateBox Access Point (AP) automatically. I'm not sure, if this is working on all devices. If it's not working, please create an AP manually.&lt;br /&gt;To uninstall the plugin, press the Uninstall button.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-oCOTLnb0-Tc/Ttesuco138I/AAAAAAAAAI4/km0TtuoLGCM/s1600/plugin+_screenshot.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="400" src="http://1.bp.blogspot.com/-oCOTLnb0-Tc/Ttesuco138I/AAAAAAAAAI4/km0TtuoLGCM/s400/plugin+_screenshot.png" width="397" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;PirateBox Plugin&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;It is important to note, that PirateBox will only be started if tethering is active before PAW starts up.&lt;br /&gt;Otherwise the normal PAW configuration will be applied. So you can choose between these two configurations.&lt;br /&gt;&lt;br /&gt;I hope that's not just working on my Adam but on many other devices as well.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Screenshost&lt;/span&gt;&lt;br /&gt;Here are some screenshots from my setup...&lt;br /&gt;&lt;br /&gt;&lt;table cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-dik0n6Lv7DA/Ttetm7S4LkI/AAAAAAAAAJA/TYeAHRzZvUg/s1600/piratebox_on_2.png" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-dik0n6Lv7DA/Ttetm7S4LkI/AAAAAAAAAJA/TYeAHRzZvUg/s1600/piratebox_on_2.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;PirateBox Startup&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;table cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-G4s14qiiY-Y/TteuCa7vX_I/AAAAAAAAAJI/oxcXLs26lAI/s1600/Bildschirmfoto+am+2011-12-01+17%253A21%253A31.png" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="202" src="http://4.bp.blogspot.com/-G4s14qiiY-Y/TteuCa7vX_I/AAAAAAAAAJI/oxcXLs26lAI/s320/Bildschirmfoto+am+2011-12-01+17%253A21%253A31.png" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Connected to PirateBox&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;table cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/--QGEWQb3opI/TteuXz9PhdI/AAAAAAAAAJQ/v4Arynggh4Y/s1600/web_nexus_one.png" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="400" src="http://1.bp.blogspot.com/--QGEWQb3opI/TteuXz9PhdI/AAAAAAAAAJQ/v4Arynggh4Y/s400/web_nexus_one.png" width="240" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;PirateBox on Nexus One&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-MJLstuayCiM/TteuvyWyg2I/AAAAAAAAAJY/txxUOOnoz1I/s1600/Bildschirmfoto+am+2011-12-01+17%253A23%253A10.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="357" src="http://4.bp.blogspot.com/-MJLstuayCiM/TteuvyWyg2I/AAAAAAAAAJY/txxUOOnoz1I/s400/Bildschirmfoto+am+2011-12-01+17%253A23%253A10.png" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;PirateBox in Chromium&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-size: large;"&gt;Video&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here is a video that shows the PirateBox in action...&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://i.ytimg.com/vi/BHhaM2L6HLA/0.jpg" height="266" width="320"&gt;&lt;param name="movie" value="http://www.youtube.com/v/BHhaM2L6HLA?version=3&amp;f=user_uploads&amp;c=google-webdrive-0&amp;app=youtube_gdata" /&gt;&lt;param name="bgcolor" value="#FFFFFF" /&gt;&lt;embed width="640" height="532"  src="http://www.youtube.com/v/BHhaM2L6HLA?version=3&amp;f=user_uploads&amp;c=google-webdrive-0&amp;app=youtube_gdata" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Update&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Since version 0.3 of the plugin, PirateBox is also working on rooted Galaxy Nexus devices running Ice Cream Sandwich.&lt;br /&gt;Here is a video...&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://i.ytimg.com/vi/0zEmx5W0lFE/0.jpg" height="532" width="640"&gt;&lt;param name="movie" value="http://www.youtube.com/v/0zEmx5W0lFE?version=3&amp;f=user_uploads&amp;c=google-webdrive-0&amp;app=youtube_gdata" /&gt;&lt;param name="bgcolor" value="#FFFFFF" /&gt;&lt;embed width="640" height="532"  src="http://www.youtube.com/v/0zEmx5W0lFE?version=3&amp;f=user_uploads&amp;c=google-webdrive-0&amp;app=youtube_gdata" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-952182150949377770?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/952182150949377770/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2011/12/piratebox-on-android.html#comment-form' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/952182150949377770'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/952182150949377770'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2011/12/piratebox-on-android.html' title='PirateBox on Android'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-DPsMG-hSJlA/TtelbLdR0NI/AAAAAAAAAIY/9GZt9z1zASY/s72-c/icon_no_alpha.png' height='72' width='72'/><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-4823273510534821315</id><published>2011-11-24T23:57:00.000-08:00</published><updated>2011-11-24T23:59:49.884-08:00</updated><title type='text'>Running PAW on Port 80</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-h8q4Xyg0N9M/ThsJLMwA89I/AAAAAAAAAFk/bfNmPEHkw2s/s1600/icon.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-h8q4Xyg0N9M/ThsJLMwA89I/AAAAAAAAAFk/bfNmPEHkw2s/s1600/icon.png" /&gt;&lt;/a&gt;&lt;/div&gt;PAW is only running on ports above 1023, because restricted ports are not permitted for normal apps.&lt;br /&gt;For root users there is a solution by using &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;iptables&lt;/span&gt; via the&lt;i&gt; &lt;a href="https://market.android.com/details?id=com.noshufou.android.su" target="_blank"&gt;Superuser&lt;/a&gt;&lt;/i&gt; app.&lt;br /&gt;&lt;br /&gt;I'm not sure if the below mentioned solution is working on all rooted devices.&lt;br /&gt;Here is my configuration: &lt;i&gt;Notion Ink Adam&lt;/i&gt; running &lt;i&gt;AdamComb v0.3&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;If this works for you can easily be tested by copying the below code into the &lt;i&gt;BeanShell Console&lt;/i&gt; of the PAW web application:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:javascript"&gt;import de.fun2code.android.pawserver.util.*;&lt;br /&gt;&lt;br /&gt;execRootShell(String[] commands) {&lt;br /&gt;  shellCmd = "su -c sh";&lt;br /&gt;&lt;br /&gt;  sh = Runtime.getRuntime().exec(shellCmd);&lt;br /&gt;  os = sh.getOutputStream();&lt;br /&gt;&lt;br /&gt;  for(cmd : commands) {&lt;br /&gt;    os.write((cmd + "\n").getBytes());&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  os.write(("exit\n").getBytes());&lt;br /&gt;  os.flush();&lt;br /&gt;  sh.waitFor();  &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/* ---- Config -------- */&lt;br /&gt;ip = Utils.getLocalIpAddress();&lt;br /&gt;redirectFrom = 80;&lt;br /&gt;redirectTo = 8080;&lt;br /&gt;action = "ADD"; // Can be ADD or DELETE&lt;br /&gt;/* -------------------- */&lt;br /&gt;&lt;br /&gt;action = "-" + action.substring(0, 1);&lt;br /&gt;&lt;br /&gt;String[] iptablesCmds = new String[] {&lt;br /&gt;  "iptables -t nat " + action + " OUTPUT -d 127.0.0.1 -p tcp --dport " + redirectFrom + " -j REDIRECT --to-ports " + redirectTo,&lt;br /&gt;  "iptables -t nat " + action + " OUTPUT -d " + ip + " -p tcp --dport " + redirectFrom + " -j REDIRECT --to-ports " + redirectTo,&lt;br /&gt;  "iptables -t nat " + action + " PREROUTING -d " + ip + " -p tcp --dport " + redirectFrom + " -j REDIRECT --to-ports " + redirectTo&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;execRootShell(iptablesCmds);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;After executing the code, PAW should respond to requests on port 80.&lt;br /&gt;If not, this solution seems not to be working on your configuration.&lt;br /&gt;&lt;br /&gt;To forward port 8080 to port 80 every time PAW starts up, create a file called &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;S_forward.bsh&lt;/span&gt; inside the &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;/sdcard/paw/etc/init/0&lt;/span&gt; directory.&lt;br /&gt;In order to stop the forwarding when the PAW service shuts down, create an additinal file called &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;K_forward.bsh&lt;/span&gt; and copy the same code.&lt;br /&gt;You only have to change the line&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt; action = "ADD";&lt;/span&gt; to &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;action = "DELETE";&lt;/span&gt; to stop the forwarding.&lt;br /&gt;&lt;br /&gt;Hope that's not just working on the Adam...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-4823273510534821315?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/4823273510534821315/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2011/11/running-paw-on-port-80.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/4823273510534821315'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/4823273510534821315'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2011/11/running-paw-on-port-80.html' title='Running PAW on Port 80'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-h8q4Xyg0N9M/ThsJLMwA89I/AAAAAAAAAFk/bfNmPEHkw2s/s72-c/icon.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-5623299604903060337</id><published>2011-11-24T01:46:00.000-08:00</published><updated>2011-11-24T01:54:14.561-08:00</updated><title type='text'>PHP Plug-in Update</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-gbKA6TXpDU0/TbCCXePG0LI/AAAAAAAAAEw/sw7KNDOhrXo/s1600/php_icon.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-gbKA6TXpDU0/TbCCXePG0LI/AAAAAAAAAEw/sw7KNDOhrXo/s1600/php_icon.png" /&gt;&lt;/a&gt;&lt;/div&gt;My cross compiled version of the PHP CGI was not working so well and I didn't manage to fix it.&lt;br /&gt;&lt;br /&gt;Fortunately Klaas Biker informed my that Iulian Virtejanu has cross compiled a PHP CGI version that seems to work significantly better.&lt;br /&gt;Here is Iulian's blog entry: &lt;a href="http://hex.ro/wp/blog/php-and-lighttpd-for-android/" target="_blank"&gt;PHP and Lighttpd for Android&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Iulian gave me the permission to use it in PAW, so I have updated the PHP Plug-in to version 0.3.&lt;br /&gt;&lt;br /&gt;There is one known issue:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;system(...)&lt;/span&gt; does not work.&lt;br /&gt;It is because &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;system('pwd')&lt;/span&gt; actually invokes a hardcoded &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/bin/sh -c 'pwd'&lt;/span&gt; - and &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/bin/sh&lt;/span&gt; is not available on Android.&lt;br /&gt;Iulian has submitted a bug report to PHP:&lt;a href="https://bugs.php.net/bug.php?id=60081&amp;amp;edit=2" target="_blank"&gt; https://bugs.php.net/bug.php?id=60081&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you find more bugs, please let me know. I will forward them.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-5623299604903060337?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/5623299604903060337/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2011/11/php-plug-in-update.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/5623299604903060337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/5623299604903060337'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2011/11/php-plug-in-update.html' title='PHP Plug-in Update'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-gbKA6TXpDU0/TbCCXePG0LI/AAAAAAAAAEw/sw7KNDOhrXo/s72-c/php_icon.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-7020299473398676850</id><published>2011-10-31T02:05:00.000-07:00</published><updated>2011-10-31T02:05:04.502-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='PAW'/><title type='text'>Building PHP from Scratch</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-gbKA6TXpDU0/TbCCXePG0LI/AAAAAAAAAEw/sw7KNDOhrXo/s1600/php_icon.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-gbKA6TXpDU0/TbCCXePG0LI/AAAAAAAAAEw/sw7KNDOhrXo/s1600/php_icon.png" /&gt;&lt;/a&gt;&lt;/div&gt;This post by &lt;i&gt;Rahul Amaram&lt;/i&gt; describes how to build PHP for Android from&amp;nbsp;scratch and how it can later be used within PAW.&lt;br /&gt;I've added links to the needed files at the end of the post.&lt;br /&gt;&lt;br /&gt;Thanks to Rahul for putting this together!&lt;br /&gt;&lt;br /&gt;Here is Rahul's documentation...&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;It is suggested to use a VM for compilation so that you can take snapshots at regular intervals. Also as per google recommendation, it is suggested to use a VM with at least 8 GB RAM/swap and 12 GB of free hard disk.&lt;br /&gt;&lt;br /&gt;Install Ubuntu 10.04 64-bit (select username as "joschi") on a VM.&lt;br /&gt;&lt;br /&gt;After booting ubuntu, login as joschi.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Download and extract android-php&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ cd&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ wget -c "http://paw-android.fun2code.de/download/android-php.zip"&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ sudo apt-get install unzip&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ unzip android-php.zip&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;First initialize build environment. For donut, java 5 is needed. Also compiling with gcc/g++ 4.4 was throwing errors during compilation. Therefore we use gcc/g++ 4.3 for compilation.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ sudo apt-get install python-software-properties&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu hardy main multiverse"&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu hardy-updates main multiverse"&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ sudo apt-get update &lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ sudo apt-get install sun-java5-jdk&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ sudo apt-get install git-core gnupg flex bison gperf build-essential \&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;libxml2-utils&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ sudo apt-get install g++-4.3-multilib&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Download Android source&lt;/b&gt;&lt;br /&gt;This will be about 3 GB.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ mkdir ~/bin&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ PATH=~/bin:$PATH&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo &amp;gt; ~/bin/repo&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ chmod a+x ~/bin/repo&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ mkdir ~/android-donut-src&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ cd ~/android-donut-src&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ repo init -u https://android.googlesource.com/platform/manifest -b android-1.6_r2&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ repo sync&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It is a good idea to take snapshot of the VM here.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Build Android&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ cd /usr/bin&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ sudo ln -sf cpp-4.3 cpp&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ sudo ln -sf g++-4.3 g++&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ sudo ln -sf gcc-4.3 gcc&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ sudo ln -sf gcov-4.3 gcov&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ sudo ln -sf cpp-4.3 x86_64-linux-gnu-cpp&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ sudo ln -sf g++-4.3 x86_64-linux-gnu-g++&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ sudo ln -sf gcc-4.3 x86_64-linux-gnu-gcc&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ cd ~/android-donut-src&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ source build/envsetup.sh&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ lunch generic-eng&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ make -j4&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It is a good idea to take another snapshot of the VM here.&lt;br /&gt;&lt;br /&gt;Next build android-php. The patch is applied in order to avoid the error "undefined reference to `__sync_fetch_and_add_4'" during compilation.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ cd ~/android-php&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ rm -rf ~/android-donut-src/bionic/libc/include/&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ unzip -d ~/android-donut-src/bionic/libc/ bionic_libc_include.zip&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ patch php-5.3.6/ext/standard/php_crypt_r.c &amp;lt; ~/sync_fetch_and_add.patch&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ ./build_php_5.3.sh&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Finally copy php-5.3.6/sapi/cgi/php-cgi to /mnt/sdcard/paw/html/app/plugins/php_plugin/bin/ on your android phone (be sure to backup the existing php-cgi file), and install PHP using the PAW Web App.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;References:&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://source.android.com/source/index.html"&gt;http://source.android.com/source/index.html&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="https://bugs.php.net/bug.php?id=55707"&gt;https://bugs.php.net/bug.php?id=55707&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;hr /&gt;&lt;b&gt;Files:&lt;/b&gt;&lt;br /&gt;&lt;a href="http://paw-android.fun2code.de/download/android-php.zip"&gt;android-php.zip&lt;/a&gt;&lt;br /&gt;&lt;a href="http://paw-android.fun2code.de/download/sync_fetch_and_add.patch"&gt;sync_fetch_and_add.patch&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-7020299473398676850?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/7020299473398676850/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2011/10/building-php-from-scratch.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/7020299473398676850'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/7020299473398676850'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2011/10/building-php-from-scratch.html' title='Building PHP from Scratch'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-gbKA6TXpDU0/TbCCXePG0LI/AAAAAAAAAEw/sw7KNDOhrXo/s72-c/php_icon.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-4167912734352913100</id><published>2011-10-19T08:35:00.000-07:00</published><updated>2011-10-19T23:23:05.863-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cloud-X'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Setting up a Cloud Print Printer using the Cloud-X API</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-P7TGW1M-oBc/TpaIcIY_z9I/AAAAAAAAAH8/cSYafj_0J84/s1600/icon.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-P7TGW1M-oBc/TpaIcIY_z9I/AAAAAAAAAH8/cSYafj_0J84/s1600/icon.png" /&gt;&lt;/a&gt;&lt;/div&gt;The &lt;a href="http://cloud-x.fun2code.de/" target="_blank"&gt;Cloud-X Java API&lt;/a&gt; makes it easy to set up a Google Cloud Print aware printer. In the latest API version Cloud Print push notifications are supported.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The below sample code shows the registration of a new printer (if not already present) and how to listen to push notifications.&lt;br /&gt;For the sake of simplicity this is straight forward code, so there might be cleaner ways to do is ;)&lt;br /&gt;&lt;br /&gt;Here is the sample code with comments:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:javascript"&gt;/*&lt;br /&gt;  * Process print job&lt;br /&gt;  */&lt;br /&gt; public static void processJobs(CloudPrintConnection gcp, Printer printer) {&lt;br /&gt;  try {&lt;br /&gt;   List&amp;lt;Job&amp;gt; jobs = gcp.fetch(printer);&lt;br /&gt;   if (jobs != null) {&lt;br /&gt;    for (Job job : jobs) {&lt;br /&gt;     System.out.println("Processing job " + job.getId() + " ("&lt;br /&gt;       + job.getTitle() + ")");&lt;br /&gt;     gcp.deletJob(job);&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;  } catch (Exception e) {&lt;br /&gt;   e.printStackTrace();&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public static void main(String[] args) {&lt;br /&gt;  try {&lt;br /&gt;   String printProxy = "testprinter-" + NetworkUtil.getMacAddress();&lt;br /&gt;&lt;br /&gt;   /*&lt;br /&gt;    * Our printer&lt;br /&gt;    */&lt;br /&gt;   final Printer printer = new Printer();&lt;br /&gt;   printer.setProxy(printProxy);&lt;br /&gt;   printer.setName("Test Printer");&lt;br /&gt;   printer.setStatus("Online");&lt;br /&gt;&lt;br /&gt;   final CloudPrintConnection gcp = new CloudPrintConnection();&lt;br /&gt;   gcp.connect(username, password, "cloudprint",&lt;br /&gt;     "Cloud Print Test Client", null);&lt;br /&gt;&lt;br /&gt;   /*&lt;br /&gt;    * Register printer if not already present&lt;br /&gt;    */&lt;br /&gt;   List&amp;lt;Printer&amp;gt; printers = gcp.list(printProxy);&lt;br /&gt;   if (printers.size() == 0) {&lt;br /&gt;    System.out.println("Registering Printer with Proxy "&lt;br /&gt;      + printProxy);&lt;br /&gt;    gcp.register(printer, null);&lt;br /&gt;   } else {&lt;br /&gt;    printer.setId(printers.get(0).getId());&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   /*&lt;br /&gt;    * Refetch all printer info&lt;br /&gt;    */&lt;br /&gt;   gcp.printer(printer);&lt;br /&gt;&lt;br /&gt;   System.out.println("Printer Name: " + printer.getName());&lt;br /&gt;   System.out.println("Printer ID: " + printer.getId());&lt;br /&gt;   System.out.println("---------------------------------------------");&lt;br /&gt;&lt;br /&gt;   processJobs(gcp, printer);&lt;br /&gt;&lt;br /&gt;   /*&lt;br /&gt;    * Wait for push notifications&lt;br /&gt;    */&lt;br /&gt;   PushReceiver pr = new PushReceiver("Cloud-X API - Push Receiver");&lt;br /&gt;   pr.addListener(new PushListener() {&lt;br /&gt;&lt;br /&gt;    @Override&lt;br /&gt;    public void onReceive(String printerId) {&lt;br /&gt;     if (printerId.equals(printer.getId())) {&lt;br /&gt;      processJobs(gcp, printer);&lt;br /&gt;     }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @Override&lt;br /&gt;    public void onConnect() {&lt;br /&gt;      System.out.println("Connected to Google Talk!");&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @Override&lt;br /&gt;    public void onDisconnect() {&lt;br /&gt;      // Do nothing&lt;br /&gt;    }&lt;br /&gt;   });&lt;br /&gt;&lt;br /&gt;   pr.connectPlain(username, password);&lt;br /&gt;&lt;br /&gt;  } catch (Exception e) {&lt;br /&gt;   e.printStackTrace();&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-4167912734352913100?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/4167912734352913100/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2011/10/setting-up-cloud-print-printer-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/4167912734352913100'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/4167912734352913100'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2011/10/setting-up-cloud-print-printer-using.html' title='Setting up a Cloud Print Printer using the Cloud-X API'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-P7TGW1M-oBc/TpaIcIY_z9I/AAAAAAAAAH8/cSYafj_0J84/s72-c/icon.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-6480763839736622703</id><published>2011-10-13T00:02:00.000-07:00</published><updated>2011-10-13T00:02:00.328-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cloud-X'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Cloud-X - Sharing Files through the Cloud</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-P7TGW1M-oBc/TpaIcIY_z9I/AAAAAAAAAH8/cSYafj_0J84/s1600/icon.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-P7TGW1M-oBc/TpaIcIY_z9I/AAAAAAAAAH8/cSYafj_0J84/s1600/icon.png" /&gt;&lt;/a&gt;&lt;/div&gt;We just released the first alpha version of Cloud-X.&lt;br /&gt;Cloud-X uses  Google Cloud Print to share files between different users and devices.  Along with the PC and Android app the Java API to access Google Cloud  Print is also released.&lt;br /&gt;&lt;br /&gt;This is a very early version, so there might be bugs.&lt;br /&gt;The Android app and an online and stand alone PC version can be found at the following site:&lt;br /&gt;&lt;a class="ot-anchor" href="http://cloud-x.fun2code.de/" target="_blank"&gt;http://cloud-x.fun2code.de&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Comments welcome!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-6480763839736622703?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/6480763839736622703/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2011/10/cloud-x-sharing-files-through-cloud.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/6480763839736622703'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/6480763839736622703'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2011/10/cloud-x-sharing-files-through-cloud.html' title='Cloud-X - Sharing Files through the Cloud'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-P7TGW1M-oBc/TpaIcIY_z9I/AAAAAAAAAH8/cSYafj_0J84/s72-c/icon.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-7157021646769215993</id><published>2011-09-19T07:11:00.000-07:00</published><updated>2011-09-19T10:42:50.163-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DynDNS'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='PAW'/><title type='text'>PAW and DynDNS</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-h8q4Xyg0N9M/ThsJLMwA89I/AAAAAAAAAFk/bfNmPEHkw2s/s1600/icon.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-h8q4Xyg0N9M/ThsJLMwA89I/AAAAAAAAAFk/bfNmPEHkw2s/s1600/icon.png" /&gt;&lt;/a&gt;&lt;/div&gt;From time to time I get requests from users who would like to have a DynDNS integration into PAW.&lt;br /&gt;I thought about it ... but it just doesn't make much sense, because there are &lt;a href="https://market.android.com/search?q=dyndns&amp;amp;so=1&amp;amp;c=apps" target="_blank"&gt;enough apps&lt;/a&gt; in the Android Market that do exactly this.&lt;br /&gt;So I will not provide a plug-in or another means of DynDNS integration, but for those of you who would like to experiment here is a basic BeanShell implementation of the &lt;a href="http://dyn.com/support/developers/api/" target="_blank"&gt;DynDNS API&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:javascript"&gt;import org.apache.http.impl.client.DefaultHttpClient;&lt;br /&gt;import org.apache.http.*;&lt;br /&gt;import org.apache.http.client.methods.*;&lt;br /&gt;import org.apache.http.util.*;&lt;br /&gt;import org.apache.http.auth.*;&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt;    Host, username and password settings&lt;br /&gt;*/&lt;br /&gt;hostname = "";&lt;br /&gt;user = "";&lt;br /&gt;password = "";&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt;    Get IP number&lt;br /&gt;*/&lt;br /&gt;client = new DefaultHttpClient();  &lt;br /&gt;getURL = "http://checkip.dyndns.com/";&lt;br /&gt;get = new HttpGet(getURL);&lt;br /&gt;responseGet = client.execute(get);  &lt;br /&gt;resEntityGet = responseGet.getEntity();&lt;br /&gt;&lt;br /&gt;if (resEntityGet != null) {&lt;br /&gt;  // Extract IP number&lt;br /&gt;  ip = EntityUtils.toString(resEntityGet).replaceAll(".*?([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}).*", "$1").replaceAll("[\n\r]", "");&lt;br /&gt;  print("IP: " + ip);&lt;br /&gt; &lt;br /&gt; /*&lt;br /&gt;    Send DynDNS update request&lt;br /&gt; */&lt;br /&gt;  updateURL= "https://members.dyndns.org/nic/update?hostname=" + hostname + "&amp;amp;myip=" + ip + "&amp;amp;wildcard=NOCHG&amp;amp;mx=NOCHG&amp;amp;backmx=NOCHG";&lt;br /&gt;  get = new HttpGet(updateURL);&lt;br /&gt;  client.getCredentialsProvider().setCredentials(new AuthScope(null, -1),&lt;br /&gt;new UsernamePasswordCredentials(user, password));&lt;br /&gt;  responseGet = client.execute(get);  &lt;br /&gt;  resEntityGet = responseGet.getEntity();&lt;br /&gt;  &lt;br /&gt;  response = EntityUtils.toString(resEntityGet);&lt;br /&gt;  success = response.startsWith("good");&lt;br /&gt;  &lt;br /&gt;  // Print result&lt;br /&gt;  print("Response: " + response);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Hostname, username and password have to be inserted into the script.&lt;br /&gt;&lt;br /&gt;This implementation is not complete but should be a good start for further development.&lt;br /&gt;To start the script automatically when PAW starts, put it in the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;paw/autostart&lt;/span&gt; or &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;paw/etc/rc.*&lt;/span&gt; folder.&lt;br /&gt;&lt;br /&gt;The API is quite easy and it should not take too long to get a complete implementation up and running ...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-7157021646769215993?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/7157021646769215993/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2011/09/paw-and-dyndns.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/7157021646769215993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/7157021646769215993'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2011/09/paw-and-dyndns.html' title='PAW and DynDNS'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-h8q4Xyg0N9M/ThsJLMwA89I/AAAAAAAAAFk/bfNmPEHkw2s/s72-c/icon.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-2136568538325949886</id><published>2011-09-15T21:31:00.000-07:00</published><updated>2011-09-15T21:33:04.381-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DavDrive'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='PAW'/><category scheme='http://www.blogger.com/atom/ns#' term='Google TV'/><title type='text'>PAW and DavDrive on Google TV</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-VL9jdslFHJM/TnLPpDlWNuI/AAAAAAAAAHc/kf6HtfqFdSs/s1600/googletv_icon.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-VL9jdslFHJM/TnLPpDlWNuI/AAAAAAAAAHc/kf6HtfqFdSs/s1600/googletv_icon.png" /&gt;&lt;/a&gt;&lt;/div&gt;So now that the Google TV emulator is out and my Linux box supports KVM I tried PAW and DavDrive.&lt;br /&gt;&lt;br /&gt;The only problem I had was that &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/sdcard&lt;/span&gt; was mounted read only and thus PAW could not extract its content and DavDrive could not write files.&lt;br /&gt;To solve this issue I opened an &lt;i&gt;ADB Shell&lt;/i&gt; and remounted the root file system via &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;mount -o remount,rw /&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Aport from that everything worked fine. Compared to the Honeycomb emulation the Google TV emulation was quite fast.&lt;br /&gt;&lt;br /&gt;Below are screen-shots of the two apps running on Google TV.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-uSPw8Ls1OpM/TnLQdCTNJYI/AAAAAAAAAHg/UvtJx3wgSjw/s1600/googletv_paw_small.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="206" src="http://1.bp.blogspot.com/-uSPw8Ls1OpM/TnLQdCTNJYI/AAAAAAAAAHg/UvtJx3wgSjw/s400/googletv_paw_small.png" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;PAW running on Goolge TV&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-bHnL8zov2Wo/TnLQgRbnwqI/AAAAAAAAAHk/aKfiyh3l404/s1600/googletv_davdrive_small.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="250" src="http://3.bp.blogspot.com/-bHnL8zov2Wo/TnLQgRbnwqI/AAAAAAAAAHk/aKfiyh3l404/s400/googletv_davdrive_small.png" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;DavDrive running on Google TV&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-2136568538325949886?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/2136568538325949886/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2011/09/paw-and-davdrive-on-google-tv.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/2136568538325949886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/2136568538325949886'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2011/09/paw-and-davdrive-on-google-tv.html' title='PAW and DavDrive on Google TV'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-VL9jdslFHJM/TnLPpDlWNuI/AAAAAAAAAHc/kf6HtfqFdSs/s72-c/googletv_icon.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-5170772344012709460</id><published>2011-08-31T12:14:00.000-07:00</published><updated>2011-09-13T02:43:20.605-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='PAW'/><title type='text'>PAW - I18N &amp; Native Mapper</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-h8q4Xyg0N9M/ThsJLMwA89I/AAAAAAAAAFk/bfNmPEHkw2s/s1600/icon.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-h8q4Xyg0N9M/ThsJLMwA89I/AAAAAAAAAFk/bfNmPEHkw2s/s1600/icon.png" /&gt;&lt;/a&gt;&lt;/div&gt;It might seem that there is no process concerning PAW, but actually I'm quite busy :)&lt;br /&gt;My plans are to release a 1.0 version this year. In October PAW will be two years under development and I think it's time to leave beta.&lt;br /&gt;&lt;br /&gt;Things I'm currently working on are internationalization and what I call Native Mapping.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Internationalization&lt;/span&gt;&lt;br /&gt;Currently I'm translating the web interface into German. This will result in a Java properties file with key and value pairs.&lt;br /&gt;After this is finished it should be quite easy to make a translation for any language.&lt;br /&gt;Translation takes much longer than I thought and I'm sure there will be a lot of mistakes in the first version.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Native Mapper&lt;/span&gt;&lt;br /&gt;The PAW BeanShell approach has the advantage of being very flexible but when it comes to performance it's really slow.&lt;br /&gt;As I showed in a previous blog post BeanShell is considerably slower than the same native code.&lt;br /&gt;The Native Mapper is an approach to solve this dilemma.&lt;br /&gt;&lt;br /&gt;The Mapper is comparable to a Servlet mapping in a JEE environment. The Native Mapper is implemented as Brazil Handler that sits in front of the BeanShell Handler and redirects URLs to native code (DEXed classes).&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-tN07jMiRohI/Tl6ADegaDRI/AAAAAAAAAHM/R179YX1Hqms/s1600/native_mapper.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="400" src="http://1.bp.blogspot.com/-tN07jMiRohI/Tl6ADegaDRI/AAAAAAAAAHM/R179YX1Hqms/s400/native_mapper.png" width="351" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Handler Chain&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;span id="goog_359781862"&gt;&lt;/span&gt;&lt;span id="goog_359781863"&gt;&lt;/span&gt;The next version of PAW will use the mapper to speed up the generation of graphics inside the web application. This includes the generation of icons, contact images, album covers and the load graph.&lt;br /&gt;Because some versions of HoneyComb have the problem that the DEX classloader is not working the original BeanShell code is also available. So if the Native Mapper fails to initialize (because the DEX classes are not available), the old BeanShell code is used.&lt;br /&gt;&lt;br /&gt;A good example to show the possible speed-up when the Native Mapper is used is the &lt;i&gt;Installed Apps&lt;/i&gt; page of the web application. On my Nexus One it shows 131 icons. Without Native Mapper this takes 90 seconds, with Native Mapper only 10.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-nYT3Ix9Uwyo/Tl6G8VMbljI/AAAAAAAAAHQ/qBtkVsPc-rY/s1600/native_mapper_speed.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="352" src="http://3.bp.blogspot.com/-nYT3Ix9Uwyo/Tl6G8VMbljI/AAAAAAAAAHQ/qBtkVsPc-rY/s400/native_mapper_speed.png" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Speed Test (time in seconds)&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;I hope to release the new version in the next couple of weeks ... stay tuned :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-5170772344012709460?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/5170772344012709460/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2011/08/paw-i18n-native-mapper.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/5170772344012709460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/5170772344012709460'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2011/08/paw-i18n-native-mapper.html' title='PAW - I18N &amp; Native Mapper'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-h8q4Xyg0N9M/ThsJLMwA89I/AAAAAAAAAFk/bfNmPEHkw2s/s72-c/icon.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-910484406760751727</id><published>2011-07-18T09:56:00.000-07:00</published><updated>2011-07-19T08:14:13.974-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DavDrive'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>DavDrive - Litmus Compliance Test</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-EPqQj8AiuWk/TePInpVNOyI/AAAAAAAAAFQ/2vUwQxaUE4Y/s1600/icon.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-EPqQj8AiuWk/TePInpVNOyI/AAAAAAAAAFQ/2vUwQxaUE4Y/s1600/icon.png" /&gt;&lt;/a&gt;&lt;/div&gt;DavDrive works reasonably well with Linux, Mac and Windows clients. To make DavDrive more RFC 2518 compliant the &lt;a href="http://www.webdav.org/neon/litmus/"&gt;Litmus&lt;/a&gt; compliance test was used.&lt;br /&gt;Litmus contains a variety of tests. Because DavDrive implements only a subset of the RFC specification only three tests are relevant: &lt;b&gt;basic&lt;/b&gt;, &lt;b&gt;copymove&lt;/b&gt; and &lt;b&gt;http&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-UHO2qUtwXu4/TiRd4KSS-PI/AAAAAAAAAGQ/Ol49ha97W6U/s1600/litmus_old_new.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="260" src="http://2.bp.blogspot.com/-UHO2qUtwXu4/TiRd4KSS-PI/AAAAAAAAAGQ/Ol49ha97W6U/s400/litmus_old_new.png" width="400" /&gt; &lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Litmus Test Results (left DavDrive 1.40, right DavDrive 1.41)&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;The upcoming DavDrive version 1.41 passes all three tests without failure.&lt;br /&gt;This involved a significant code change, so intensive testing is necessary before publishing the new version.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-910484406760751727?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/910484406760751727/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2011/07/davdrive-litmus-compliance-test.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/910484406760751727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/910484406760751727'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2011/07/davdrive-litmus-compliance-test.html' title='DavDrive - Litmus Compliance Test'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-EPqQj8AiuWk/TePInpVNOyI/AAAAAAAAAFQ/2vUwQxaUE4Y/s72-c/icon.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-5561796988016589729</id><published>2011-07-12T13:00:00.000-07:00</published><updated>2011-07-17T10:22:39.865-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='PAW'/><title type='text'>PAW - Dynamic Handlers and Filters</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-h8q4Xyg0N9M/ThsJLMwA89I/AAAAAAAAAFk/bfNmPEHkw2s/s1600/icon.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-h8q4Xyg0N9M/ThsJLMwA89I/AAAAAAAAAFk/bfNmPEHkw2s/s1600/icon.png" /&gt;&lt;/a&gt;&lt;/div&gt;In addition to dynamically loading DEXed classes the latest PAW version provides the possibility to use external so called dynamic Handlers and Filters.&lt;br /&gt;&lt;br /&gt;Handlers and Filters are components of the underlying Brazil framework. Handlers are responsible for handling HTTP request. Filters in addition can process the output provided by an handler. In principle PAW consists of a number of handlers that are called in a row until a Handler feels responsible to handle the request.&lt;br /&gt;There is a special Handler, the so called &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;FilterHandler&lt;/span&gt;. This Handler can wrap a Handler and directs the output of that Handler to a list of Filters which process the response before it is provided to a Web Browser.&lt;br /&gt;&lt;br /&gt;I'll demonstrate this on a small but useful filter that stamps all images inside a defined directory with the PAW logo. Such a technique is often used on sites that provide screenshots and want to automatically decorate them with a logo.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-vDu9qfIjI54/ThycvjquRsI/AAAAAAAAAFw/CICYEkqXyO4/s1600/stamp_before_after.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="266" src="http://4.bp.blogspot.com/-vDu9qfIjI54/ThycvjquRsI/AAAAAAAAAFw/CICYEkqXyO4/s400/stamp_before_after.png" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Image without and with Filter applied.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;b&gt;Note:&lt;/b&gt;&lt;br /&gt;In this example only the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;AndroidDynamicFilter&lt;/span&gt; is used. There is also&amp;nbsp; a &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;AndroidDynamicHandler&lt;/span&gt; available which can be used if a custom Handler is needed. For this example the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;AndroidDynamicHandler&lt;/span&gt; class is not needed.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Note on Honeycomb:&lt;/b&gt; As mentioned in an earlier post, this might not work on Android 3.x because of a &lt;a href="http://code.google.com/p/android/issues/detail?id=15893"&gt;bug&lt;/a&gt; in Honeycomb.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Prerequisites&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;What you will need to build the Filter:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.eclipse.org/"&gt;Eclipse IDE&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://developer.android.com/sdk/index.html"&gt;Android SDK&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://paw-project.sourceforge.net/downloads/brazil-2.3.jar"&gt;Brazil JAR&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size: large;"&gt;Creating a Java Project&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When Eclipse is running, we can create a standard Java project.&lt;br /&gt;The Java build path should include the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;brazil.jar&lt;/span&gt; &lt;span style="font-size: x-small;"&gt;(I've renamed it from &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;brazil-2.3.jar&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size: x-small;"&gt;to &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;brazil.jar&lt;/span&gt;)&lt;/span&gt; and the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;android.jar&lt;/span&gt; file. The &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;android.jar&lt;/span&gt; files can be found in the installation directory of the Android SDK (&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;platforms/android-*&lt;/span&gt;).&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-KUizSZC8rOI/ThtE_MK5nJI/AAAAAAAAAFo/eMz1lnFizUA/s1600/build_path.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-KUizSZC8rOI/ThtE_MK5nJI/AAAAAAAAAFo/eMz1lnFizUA/s1600/build_path.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Java Build Path&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="clear: both;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;The Filter Class&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;After creating the project create a source folder (if not available) and create a new package called &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;dextest.filter&lt;/span&gt;.&lt;br /&gt;Inside that package we will create the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;StampFilter&lt;/span&gt; class.&lt;br /&gt;&lt;br /&gt;The structure should look something like this:&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-25Epn86aT64/ThtGLGhYmgI/AAAAAAAAAFs/wy3rXwcIIqk/s1600/project_structure.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-25Epn86aT64/ThtGLGhYmgI/AAAAAAAAAFs/wy3rXwcIIqk/s1600/project_structure.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Project Structure&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="clear: both;"&gt;&lt;/div&gt;Before creating the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;StampFilter&lt;/span&gt; class just a view words how a filter works.&lt;br /&gt;A Filter has three important methods:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;init() &lt;/span&gt;- This initializes the Filter and is called on Filter startup &lt;span style="font-size: x-small;"&gt;(when PAW starts)&lt;/span&gt;. This returns &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;true&lt;/span&gt; on success and &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;false&lt;/span&gt; on failure.&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;shouldFilter()&lt;/span&gt; - Is called on each Handler output and decides weather the response is to be filtered or not. Returns &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;true&lt;/span&gt; if the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;filter()&lt;/span&gt; method should be called, &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;false&lt;/span&gt; otherwise.&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;filter()&lt;/span&gt; - This is the actual filter method. It processes the content form the Handler and returns it.&lt;/li&gt;&lt;/ul&gt;Below is the code of the Filter class:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:java"&gt;package dextest.filter;&lt;br /&gt;&lt;br /&gt;import java.io.ByteArrayOutputStream;&lt;br /&gt;import java.io.File;&lt;br /&gt;import java.io.FileInputStream;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;import java.util.Properties;&lt;br /&gt;&lt;br /&gt;import android.graphics.Bitmap;&lt;br /&gt;import android.graphics.BitmapFactory;&lt;br /&gt;import android.graphics.Canvas;&lt;br /&gt;&lt;br /&gt;import sunlabs.brazil.filter.Filter;&lt;br /&gt;import sunlabs.brazil.server.Request;&lt;br /&gt;import sunlabs.brazil.server.Server;&lt;br /&gt;import sunlabs.brazil.util.http.MimeHeaders;&lt;br /&gt;&lt;br /&gt;public class StampFilter implements Filter {&lt;br /&gt; private String prefix;&lt;br /&gt;&lt;br /&gt; private static final String STAMP_FILE = "stampFile";&lt;br /&gt;&lt;br /&gt; private static final String IMAGE_DIRECTORY_URL = "imageDirctoryUrl";&lt;br /&gt;&lt;br /&gt; private String stampFile;&lt;br /&gt; private String imageDirectoryUrl;&lt;br /&gt;&lt;br /&gt; public boolean init(Server server, String prefix) {&lt;br /&gt;  this.prefix = prefix;&lt;br /&gt;&lt;br /&gt;  Properties props = server.props;&lt;br /&gt;&lt;br /&gt;  stampFile = props.getProperty(prefix + STAMP_FILE, null);&lt;br /&gt;  imageDirectoryUrl = props.getProperty(prefix + IMAGE_DIRECTORY_URL, null);&lt;br /&gt;&lt;br /&gt;  if (stampFile != null &amp;amp;&amp;amp; imageDirectoryUrl != null) {&lt;br /&gt;   if (!new File(stampFile).exists()) {&lt;br /&gt;    server.log(Server.LOG_ERROR, prefix, STAMP_FILE&lt;br /&gt;      + " does not exist!");&lt;br /&gt;    return false;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   if (!new File(imageDirectoryUrl).isDirectory()) {&lt;br /&gt;    server.log(Server.LOG_ERROR, prefix, IMAGE_DIRECTORY_URL&lt;br /&gt;      + " is not a directory!");&lt;br /&gt;    return false;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   return true;&lt;br /&gt;  } else {&lt;br /&gt;   server.log(Server.LOG_ERROR, prefix, "Missing parameter(s)");&lt;br /&gt;   return false;&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public boolean shouldFilter(Request request, MimeHeaders headers) {&lt;br /&gt;  String type = headers.get("Content-Type");&lt;br /&gt;  return type != null &amp;amp;&amp;amp; type.startsWith("image/png") &amp;amp;&amp;amp; new File(request.url).getParent().equals(imageDirectoryUrl);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public byte[] filter(Request request, MimeHeaders headers, byte[] content) {&lt;br /&gt;  try {&lt;br /&gt;   return stampImage(content);&lt;br /&gt;  }&lt;br /&gt;  catch(Exception e) {&lt;br /&gt;   request.log(Server.LOG_ERROR, prefix, "Exception: " + e.getMessage());&lt;br /&gt;   return content;&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * This is the request object before the content was fetched&lt;br /&gt;  */&lt;br /&gt; public boolean respond(Request request) throws IOException {&lt;br /&gt;  return false;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; byte[] getImageBytes(String image) throws IOException {&lt;br /&gt;  File f = new File(image);&lt;br /&gt;  byte[] bBitmap = new byte[(int) f.length()];&lt;br /&gt;  FileInputStream fis = new FileInputStream(f);&lt;br /&gt;  fis.read(bBitmap);&lt;br /&gt;  fis.close();&lt;br /&gt;  return bBitmap;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; private byte[] stampImage(byte[] imageBytes) throws IOException {&lt;br /&gt;  byte[] stampBytes = getImageBytes(stampFile);&lt;br /&gt;  Bitmap stampBitmap = BitmapFactory.decodeByteArray(stampBytes, 0, stampBytes.length);&lt;br /&gt;&lt;br /&gt;  Bitmap imageBitmap = BitmapFactory.decodeByteArray(imageBytes, 0, imageBytes.length);&lt;br /&gt;  imageBitmap = imageBitmap.copy(imageBitmap.getConfig(), true);&lt;br /&gt;&lt;br /&gt;  Canvas canvas = new Canvas(imageBitmap);&lt;br /&gt;  canvas.drawBitmap(stampBitmap, imageBitmap.getWidth() - stampBitmap.getWidth(), imageBitmap.getHeight() - stampBitmap.getHeight(), null);&lt;br /&gt;&lt;br /&gt;  ByteArrayOutputStream bos = new ByteArrayOutputStream();&lt;br /&gt;  imageBitmap.compress(Bitmap.CompressFormat.PNG, 0 /*ignored for PNG*/, bos);&lt;br /&gt;&lt;br /&gt;  return bos.toByteArray();&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;}&amp;nbsp;&lt;/pre&gt;&lt;br /&gt;In the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;init()&lt;/span&gt; method you can see that the Filter excepts two parameters. One is called &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;stampFile&lt;/span&gt;, the other &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;imageDirectoryUrl&lt;/span&gt;. The &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;stampFile&lt;/span&gt; parameter specifies the file (absolute path) of the image that is placed on top of the original image. The &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;imageDirectoryUrl &lt;/span&gt;parameter specifies the URL for which the filter is applied.&lt;br /&gt;The&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt; init()&lt;/span&gt; method does check if the parameters are present and if they are valid. The parameters are read from the configuration by using &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;props.getProperty()&lt;/span&gt;. The &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;prefix&lt;/span&gt; is basically the name of the Filter.&lt;br /&gt;&lt;br /&gt;The &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;shouldFilter()&lt;/span&gt; method checks if the file requested is a PNG and if the file is served from the URL that should be filtered.&lt;br /&gt;&lt;br /&gt;Filtering is actually done in the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;filter()&lt;/span&gt; method. This method will not be discussed in detail, because it uses standard Android functionality to do the stamping.&lt;br /&gt;&lt;br /&gt;After compiling the Filter, create a JAR file called &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;filterTest.jar&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Creating the DEXed Filter JAR&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now we can use the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;dx&lt;/span&gt; command from the Android SDK to create a DEXed JAR file:&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;./dx --dex --output=/tmp/&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;filterTest_dex.jar&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt; --positions=lines &lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;filterTest.jar&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now copy the resulting &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;filterTest_dex.jar&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt; &lt;/span&gt;JAR file over to your Android device and store ist directly on the SD Card (&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/sdcard&lt;/span&gt;).&lt;br /&gt;&lt;br /&gt;Here is the ready to use JAR file:&amp;nbsp; &lt;a href="http://paw-android.fun2code.de/download/filterTest_dex.jar"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;filterTest_dex.jar&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;The Stamp Image&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In principle you can use any PNG image for stamping the images.&lt;br /&gt;Here is an example:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-6kblNgC6dxg/ThyfH7LnLoI/AAAAAAAAAF0/iPjp9lXtCSw/s1600/paw_powered.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-6kblNgC6dxg/ThyfH7LnLoI/AAAAAAAAAF0/iPjp9lXtCSw/s1600/paw_powered.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="clear: both;"&gt;&lt;/div&gt;Store it directly under &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/sdcard/paw_powered.png&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Modifying the PAW Configuration&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The next step is to modify the PAW configuration. The two important files are &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;handler.xml&lt;/span&gt; and &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;filter.xml&lt;/span&gt;. Both files are located inside the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;paw/conf &lt;/span&gt;directory.&lt;br /&gt;The &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;handler.xml&lt;/span&gt; defines the Handles and the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;filter.xml&lt;/span&gt; defines the Filters used by PAW.&lt;br /&gt;We will start with the filter configuration. For that open the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;filter.xml&lt;/span&gt; file and add the following Filter definition inside the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;lt;filters&amp;gt; &amp;lt;/filters&amp;gt;&lt;/span&gt; tags:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:xml"&gt;&amp;lt;filter status="active" type="custom"&amp;gt;&lt;br /&gt;    &amp;lt;name&amp;gt;Stamp Filter&amp;lt;/name&amp;gt;&lt;br /&gt;    &amp;lt;description&amp;gt;Stamp Filter&amp;lt;/description&amp;gt;&lt;br /&gt;    &amp;lt;removable&amp;gt;true&amp;lt;/removable&amp;gt;&lt;br /&gt;    &amp;lt;id&amp;gt;stamp&amp;lt;/id&amp;gt;&lt;br /&gt;    &amp;lt;files /&amp;gt;&lt;br /&gt;    &amp;lt;params&amp;gt;&lt;br /&gt;      &amp;lt;param name="stamp.class" value="org.paw.filter.AndroidDynamicFilter" /&amp;gt;&lt;br /&gt;      &amp;lt;param name="stamp.filterClass" value="dextest.filter.StampFilter" /&amp;gt;&lt;br /&gt;      &amp;lt;param name="stamp.filterJars" value="/sdcard/filterTest_dex.jar" /&amp;gt;&lt;br /&gt;      &amp;lt;param name="stamp.stampFile" value="/sdcard/paw_powered.png" /&amp;gt;&lt;br /&gt;      &amp;lt;param name="stamp.imageDirctoryUrl" value="/stamp" /&amp;gt;&lt;br /&gt;    &amp;lt;/params&amp;gt;&lt;br /&gt;  &amp;lt;/filter&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;PAW knows two filter types &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;httpProxy&lt;/span&gt; and &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;custom&lt;/span&gt;. HttpProxy filters are only important when PAW is used as a proxy server. In our case the StampFilter is a &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;custom&lt;/span&gt; Filter.&lt;br /&gt;The parameters define the Filter class to use, the location of the DEX file, the stamp image and the URL (the directory) where the images that should be stamped are located (we will create hat directory below).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now comes the Handler part. Our new Handler definition will replace the existing File Handler definition and use the defined StampFilter. So edit the file &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;handle.xml&lt;/span&gt; and replace the existing File Handler with the following XML code:&lt;br /&gt;&lt;pre class="brush:xml"&gt;&amp;lt;handler status="active"&amp;gt;&lt;br /&gt;    &amp;lt;name&amp;gt;File Handler&amp;lt;/name&amp;gt;&lt;br /&gt;    &amp;lt;description&amp;gt;&amp;lt;/description&amp;gt;&lt;br /&gt;    &amp;lt;removable&amp;gt;true&amp;lt;/removable&amp;gt;&lt;br /&gt;    &amp;lt;id&amp;gt;filehandlerWrapper&amp;lt;/id&amp;gt;&lt;br /&gt;    &amp;lt;files /&amp;gt;&lt;br /&gt;    &amp;lt;params&amp;gt;&lt;br /&gt;      &amp;lt;param name="filehandlerWrapper.class" value="sunlabs.brazil.filter.FilterHandler" /&amp;gt;&lt;br /&gt;      &amp;lt;param name="filehandlerWrapper.handler" value="filehandler" /&amp;gt;&lt;br /&gt;      &amp;lt;param name="filehandlerWrapper.filters" value="stamp" /&amp;gt;&lt;br /&gt;&lt;br /&gt;      &amp;lt;param name="filehandler.class" value="sunlabs.brazil.server.FileHandler" /&amp;gt;&lt;br /&gt;      &amp;lt;param name="filehandler.root" value="/sdcard/paw/html" /&amp;gt;&lt;br /&gt;      &amp;lt;param name="filehandler.defaults" value="index.html" /&amp;gt;&lt;br /&gt;    &amp;lt;/params&amp;gt;&lt;br /&gt;  &amp;lt;/handler&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;After that restart the PAW app and let's start testing :)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Using the Filter&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For testing, let's create the directory for the images that should be stamped as defined in the Filter definition. For that create a directory called &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/sdcard/paw/html/stamp&lt;/span&gt; and place some PNG images inside it. For a test, you can also put some other image files (e.g. JPG) in that directory. These should not be modified.&lt;br /&gt;Now enter the Url &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;http://&amp;lt;ip number&amp;gt;:8080/stamp&lt;/span&gt; into the address bar of your browser and select a PNG image.&lt;br /&gt;&lt;br /&gt;The resulting image should include the stamp image in the lower right corner.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-5561796988016589729?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/5561796988016589729/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2011/07/paw-dynamic-handlers-and-filters.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/5561796988016589729'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/5561796988016589729'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2011/07/paw-dynamic-handlers-and-filters.html' title='PAW - Dynamic Handlers and Filters'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-h8q4Xyg0N9M/ThsJLMwA89I/AAAAAAAAAFk/bfNmPEHkw2s/s72-c/icon.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-523799048456465899</id><published>2011-07-11T08:08:00.000-07:00</published><updated>2011-07-11T08:33:27.695-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='PAW'/><title type='text'>PAW - Dynamic  DEX Class Loading</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-h8q4Xyg0N9M/ThsJLMwA89I/AAAAAAAAAFk/bfNmPEHkw2s/s1600/icon.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-h8q4Xyg0N9M/ThsJLMwA89I/AAAAAAAAAFk/bfNmPEHkw2s/s1600/icon.png" /&gt;&lt;/a&gt;&lt;/div&gt;With PAW developers have the possibility to create dynamic pages using BeanSell scripts.&lt;br /&gt;This is nice because pages can be developed very fast. On the downside BeanShell is not the fastest scripting language on the planet due to its heavy use of Java reflection. This was demonstrated in an &lt;a href="http://fun2code-blog.blogspot.com/2010/09/paw-performance.html"&gt;earlier blog entry&lt;/a&gt;&amp;nbsp; where BeanShell code is between 10 and 50 times slower than the native equivalent.&lt;br /&gt;&lt;br /&gt;One note beforehand:&amp;nbsp; Dynamic DEX class loading is currently not working on Honeycomb. This is due to a bug in the in the DexClassLaoder. Google has aknowledged the &lt;a href="http://code.google.com/p/android/issues/detail?id=15893"&gt;bug&lt;/a&gt;. This bug should be fixed in upcoming Honeycomb releases.&lt;br /&gt;&lt;br /&gt;PAW now introduces a new directory called &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;webconf/dex&lt;/span&gt; wich can contain JAR and APK files in DEX format. On server startup all files which are present in hat directory will be added to a new classloader. This classloader can be retrieved by calling &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;getDexClassloader()&lt;/span&gt; on the service object. To make life easier the command &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;useDexClasses()&lt;/span&gt; can be used in BeanShell pages.&lt;br /&gt;&lt;br /&gt;To&amp;nbsp; convert an existing JAR file into a DEXed one the following dex command from the Android SDK &lt;span style="font-size: x-small;"&gt;(normally located in the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;platform-tools&lt;/span&gt; directory)&lt;/span&gt; can be used:&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;./dx --dex --output=output.jar --positions=lines input.jar &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you would like to keep the existing classes inside the JAR file, the additional option &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;--keep-classes&lt;/span&gt; can be used. With this option the same JAR file can be used on Android or a PC running standard Java.&lt;br /&gt;&lt;br /&gt;After the DEXed JAR file has been created it can be copied to the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;webconf/dex&lt;/span&gt; folder of the PAW installation.&lt;br /&gt;&lt;br /&gt;Now to use the new classes you can either restart PAW or issue the following&amp;nbsp; command from the BeanShell Console:&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span class="js-variable"&gt;server&lt;/span&gt;&lt;span class="js-punctuation"&gt;.&lt;/span&gt;&lt;span class="js-property"&gt;props&lt;/span&gt;&lt;span class="js-punctuation"&gt;.&lt;/span&gt;&lt;span class="js-property"&gt;get&lt;/span&gt;&lt;span class="js-punctuation"&gt;(&lt;/span&gt;&lt;span class="js-string"&gt;"serviceContext"&lt;/span&gt;&lt;span class="js-punctuation"&gt;)&lt;/span&gt;&lt;span class="js-punctuation"&gt;.&lt;/span&gt;&lt;span class="js-property"&gt;buildDexClassLoader&lt;/span&gt;&lt;span class="js-punctuation"&gt;(&lt;/span&gt;&lt;span class="js-punctuation"&gt;)&lt;/span&gt;&lt;span class="js-punctuation"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;span class="js-punctuation"&gt;If the new classes should be used inside a BeanShell XHTML page the following command has to be executed:&lt;/span&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span class="js-punctuation"&gt;useDexClasses()&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;span class="js-punctuation"&gt;That basically tells BeanShell to use the new classloader.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="font-size: large;"&gt;Example&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation"&gt;Here is a very simple Java class that sums up two Intergers:&lt;/span&gt;&lt;br /&gt;&lt;pre class="brush:java"&gt;package dextest;&lt;br /&gt;&lt;br /&gt;public class Math {&lt;br /&gt; public static int sum(int i, int j) {&lt;br /&gt;  return i + j;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span class="js-punctuation"&gt;After expopting the class as JAR file it can be converted into DEXed format using the following command &lt;span style="font-size: x-small;"&gt;(the JAR file &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;dextest.jar&lt;/span&gt; is located in the&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt; /tmp&lt;/span&gt; directory)&lt;/span&gt; :&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;./dx --dex --output=/tmp/dextest_dex.jar --positions=lines dextest.jar &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="js-punctuation"&gt;The resulting &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;dextest_dex.jar&lt;/span&gt; JAR file is now placed inside the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;webconf/dex&lt;/span&gt; folder and PAW is restarted.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="js-punctuation"&gt;Now we can use the new class within the BeanShell Console like this:&lt;/span&gt;&lt;br /&gt;&lt;pre class="brush:java"&gt;useDexClasses();&lt;br /&gt;&lt;br /&gt;import dextest.Math;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;print(Math.sum(1, 3));&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-523799048456465899?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/523799048456465899/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2011/07/paw-dynamic-dex-class-loading.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/523799048456465899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/523799048456465899'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2011/07/paw-dynamic-dex-class-loading.html' title='PAW - Dynamic  DEX Class Loading'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-h8q4Xyg0N9M/ThsJLMwA89I/AAAAAAAAAFk/bfNmPEHkw2s/s72-c/icon.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-8048943281472216380</id><published>2011-06-06T08:32:00.000-07:00</published><updated>2011-06-06T08:32:41.909-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='DavDrive'/><title type='text'>Windows Performance and Filesize Limit</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-Ew6quCcciBA/TdIx9w9EuPI/AAAAAAAAAFM/kc23seNUM6E/s1600/64-windows7.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-Ew6quCcciBA/TdIx9w9EuPI/AAAAAAAAAFM/kc23seNUM6E/s1600/64-windows7.png" /&gt;&lt;/a&gt;&lt;/div&gt;This weekend I had the chance to test DavDrive's performance when running Widows 7 (32bit).&lt;br /&gt;I tested with Windows Explorer and &lt;a href="http://www.bitkinex.com/"&gt;BitKinex&lt;/a&gt;. The latter gave me a nice performance graph. My test file was a video file that was approx. 900MB in size.&lt;br /&gt;The first things I notices was that Windows 7 seems to have a file size limit when it comes to WebDAV downloads. Therefore I immediately continued to test with BitKinex because I had no clue how to fix the size limit by that time. You'll find the solution for this after the BitKinex test.&lt;br /&gt;BitKiney worked like charm. The graph shows the download speed.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-fY8tcl6CEqY/Tezye6fTd5I/AAAAAAAAAFg/Ocenvj3PboA/s1600/bitkinex_win7_transfer_speed.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-fY8tcl6CEqY/Tezye6fTd5I/AAAAAAAAAFg/Ocenvj3PboA/s1600/bitkinex_win7_transfer_speed.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;DavDrive - BitKinex Performance&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;Speed was quite good (1,48 MB/s) and by far not as bad as many users have reported when using DavDrive on Windows.&lt;br /&gt;So if you fix your &lt;a href="http://fun2code-blog.blogspot.com/2011/05/windows-7-webdav-performance.html"&gt;Internet Explorer settings&lt;/a&gt; and the size limit, DavDrive should run fine and with reasonable speed on Windows.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Windows Size Limit &lt;/span&gt;&lt;br /&gt;To fix the size limit you have to use the registry editor and edit the following key:&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters\FileSizeLimitInBytes&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-8048943281472216380?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/8048943281472216380/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2011/06/windows-performance-and-filesize-limit.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/8048943281472216380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/8048943281472216380'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2011/06/windows-performance-and-filesize-limit.html' title='Windows Performance and Filesize Limit'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-Ew6quCcciBA/TdIx9w9EuPI/AAAAAAAAAFM/kc23seNUM6E/s72-c/64-windows7.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-5777984763686367761</id><published>2011-05-30T09:53:00.000-07:00</published><updated>2011-06-07T05:08:35.276-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DavDrive'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>DavDrive - Tablet Support</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-EPqQj8AiuWk/TePInpVNOyI/AAAAAAAAAFQ/2vUwQxaUE4Y/s1600/icon.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-EPqQj8AiuWk/TePInpVNOyI/AAAAAAAAAFQ/2vUwQxaUE4Y/s1600/icon.png" /&gt;&lt;/a&gt;&lt;/div&gt;There is a new version of DavDrive (1.39) and the full version got some enhanced tablet support.&lt;br /&gt;The main screen now presents the usual start button on the left and a list that contains the log entries on the right.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-zB3GTNFBXww/TePIyfRqMJI/AAAAAAAAAFU/1L_K0bbUkRQ/s1600/device.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="234" src="http://3.bp.blogspot.com/-zB3GTNFBXww/TePIyfRqMJI/AAAAAAAAAFU/1L_K0bbUkRQ/s400/device.png" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;DavDrive 1.39&lt;/td&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;In default mode the list only shows uploads and downloads so not to confuse the normal user too much. You can switch the display by pressing the small arrow in the activities title bar to display all entries.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-7jXcr2GIPMU/TePJ8T1f1SI/AAAAAAAAAFY/9I7owi_2t7g/s1600/device_menu.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="64" src="http://2.bp.blogspot.com/-7jXcr2GIPMU/TePJ8T1f1SI/AAAAAAAAAFY/9I7owi_2t7g/s400/device_menu.png" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Log View Selection&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;When clicking on these entries a dialog box with some more protocol details is displayed. If the file is present it can be opened.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-iRwcUIS3qkc/TePK0vvV9qI/AAAAAAAAAFc/rG9NdrmzEn8/s1600/device2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="219" src="http://4.bp.blogspot.com/-iRwcUIS3qkc/TePK0vvV9qI/AAAAAAAAAFc/rG9NdrmzEn8/s400/device2.png" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Log Entry Details&lt;/td&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;The tablet support is not only for Honeycomb but for all others X-large screens. So other tablet users running Android 2.x should also benefit from the changes.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Log Broadcasts&lt;/span&gt;&lt;br /&gt;Another new feature is that the log activities are broadcasted, which means that other programs/activities can listen to these broadcasts and react on these events.&lt;br /&gt;&lt;br /&gt;For those interested, here are the details.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Intent Action:&lt;/b&gt; de.fun2code.android.webdrive.history.intent.add&lt;br /&gt;&lt;br /&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Extra&lt;/th&gt;&lt;th&gt;Type&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Method&lt;/td&gt;&lt;td style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;String&lt;/td&gt;&lt;td&gt;Mehthod name in uppercase.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Timestamp&lt;/td&gt;&lt;td style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Long&lt;/td&gt;&lt;td&gt;Time in millis.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Resource&lt;/td&gt;&lt;td style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;String&lt;/td&gt;&lt;td&gt;Complete resource (file) name.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Success&lt;/td&gt;&lt;td style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Boolean&lt;/td&gt;&lt;td&gt;True on success, otherwise false.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Code&lt;/td&gt;&lt;td style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Integer&lt;/td&gt;&lt;td&gt;HTTP result code.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Message&lt;/td&gt;&lt;td style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;String&lt;/td&gt;&lt;td&gt;Additional message.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-5777984763686367761?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/5777984763686367761/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2011/05/davdrive-tablet-support.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/5777984763686367761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/5777984763686367761'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2011/05/davdrive-tablet-support.html' title='DavDrive - Tablet Support'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-EPqQj8AiuWk/TePInpVNOyI/AAAAAAAAAFQ/2vUwQxaUE4Y/s72-c/icon.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-464501576818512997</id><published>2011-05-17T03:05:00.000-07:00</published><updated>2011-05-17T03:05:55.753-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='DavDrive'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Windows 7 WebDAV Performance</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-Ew6quCcciBA/TdIx9w9EuPI/AAAAAAAAAFM/kc23seNUM6E/s1600/64-windows7.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-Ew6quCcciBA/TdIx9w9EuPI/AAAAAAAAAFM/kc23seNUM6E/s1600/64-windows7.png" /&gt;&lt;/a&gt;&lt;/div&gt;This bugged me for a while...&lt;br /&gt;DavDrive's WebDAV performance seems o.k. on almost all platforms, except for Windows 7 (and especially the 64 bit version).&lt;br /&gt;I have no Windows 7 at home, so I could not really test.&lt;br /&gt;&lt;br /&gt;Today I stumbled over a &lt;a href="http://oddballupdate.com/2009/12/18/fix-slow-webdav-performance-in-windows-7/" target="_blank"&gt;blog entry by Chief Oddball&lt;/a&gt; which suggests a fix.&lt;br /&gt;To make it short, here is the possible fix (quoted form the blog entry):&lt;br /&gt;&lt;blockquote&gt;&lt;ol&gt;&lt;li&gt;&lt;i&gt;In Internet Explorer, open the Tools menu, then click Internet Options.&lt;/i&gt;&lt;/li&gt;&lt;li&gt;&lt;i&gt;Select the Connections tab.&lt;/i&gt;&lt;/li&gt;&lt;li&gt;&lt;i&gt;Click the LAN Settings button.&lt;/i&gt;&lt;/li&gt;&lt;li&gt;&lt;i&gt;Uncheck the “Automatically detect settings” box.&lt;/i&gt;&lt;/li&gt;&lt;li&gt;&lt;i&gt;Click OK until you’re out of dialog hell.&lt;/i&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/blockquote&gt;I'm really interested if this is working.&lt;br /&gt;Comments welcome!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-464501576818512997?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/464501576818512997/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2011/05/windows-7-webdav-performance.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/464501576818512997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/464501576818512997'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2011/05/windows-7-webdav-performance.html' title='Windows 7 WebDAV Performance'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-Ew6quCcciBA/TdIx9w9EuPI/AAAAAAAAAFM/kc23seNUM6E/s72-c/64-windows7.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-5353709239103318645</id><published>2011-04-21T12:46:00.000-07:00</published><updated>2011-05-05T00:09:52.426-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='PAW'/><title type='text'>PAW Server &amp; PHP</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-gbKA6TXpDU0/TbCCXePG0LI/AAAAAAAAAEw/sw7KNDOhrXo/s1600/php_icon.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-gbKA6TXpDU0/TbCCXePG0LI/AAAAAAAAAEw/sw7KNDOhrXo/s1600/php_icon.png" /&gt;&lt;/a&gt;&lt;/div&gt;In this post I would like to write about what is coming up next in PAW development.&lt;br /&gt;PAW supports BeanShell code to create dynamic pages. BeanShell is well suited for Android, because it integrates will into the OS by supporting the Android Java API.&lt;br /&gt;&lt;br /&gt;The foundation of PAW is Brazil a web application framework which was developed by SUN (now Oracle). Although not widely used the framework has the advantage of being very small and flexible.&lt;br /&gt;What I was thinking about for a while was to add PHP support. PHP is widely used &amp;nbsp;around the net. PHP's reputation is questionable and that are people who love and others who hate it. But it's&amp;nbsp;undoubtedly one of the most used frameworks when it comes to web development.&lt;br /&gt;&lt;br /&gt;PHP basically comes in two flawors, a CLI and a CGI version. To integrate PHP into the context of a web server the CGI version is needed.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Android PHP Project&lt;/span&gt;&lt;br /&gt;Knowing that there is a CLI version provided by the Android PHP Project I headed over to their forum asking if they could provide a CGI version in addition to the CLI version.&lt;br /&gt;&lt;br /&gt;Unfortunately the guys &lt;a href="https://groups.google.com/group/php-for-android/browse_thread/thread/79d0b5f856189675/5ce1aa155bd4f8a0?hl=de#5ce1aa155bd4f8a0" target="_blank"&gt;told me&lt;/a&gt; that a CGI version will not be provided by the project because it's not needed and pointed me to a page which describes shortly how to setup the&amp;nbsp;tool-chain&amp;nbsp;to do a&amp;nbsp;cross compile&amp;nbsp;of PHP.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Cross Compiling&lt;/span&gt;&lt;br /&gt;So I tried to compile PHP myself. I have a Linux box at home so I'm quite familiar with doing configure/make and all this things but the last time I dug into C sources and header files is approx. 10 years back. So this was quite a challenge. Finally I got it working, but I think I did a lousy job. So if somebody can do it better, please go ahead and send me the php-cgi binary.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;The CGI Handler&lt;/span&gt;&lt;br /&gt;After I had the binary I extended and changed the CGI handler that is included with Brazil to work with Android. Due to some changes in the Brazil source that I have done concerning upload size limits the original handler could not be used. In the process I also tried to add SL4A support. I haven't tested this until know, but I hope it will be working.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;SL4A Support&lt;/span&gt;&lt;br /&gt;SL4A support is a little bit tricky, because one has to know the port the SL4A is listening to. So I looked around how to get hold of the port and found out that the port is reported in the logcat.&lt;br /&gt;So on startup of the handler (on start of the PAW service) the handler looks into logcat and tries to find the SL4A host name and port number. These values are associated with the &lt;span class="Apple-style-span" style="font-family: 'Courier New',Courier,monospace;"&gt;AP_HOST&lt;/span&gt; and &lt;span class="Apple-style-span" style="font-family: 'Courier New',Courier,monospace;"&gt;AP_PORT&lt;/span&gt; environment variables. So SL4A the server has to be started shortly before PAW starts up.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;The Plugin&lt;/span&gt;&lt;br /&gt;PHP will be available as plugin shortly after the next release of PAW (which should be in the next month). PAW will then come with the new handler. Providing PHP as plugin has the advantage that PAW itself does not grow (much) in size. PHP is approx. 3 MB in size and so relatively large.&lt;br /&gt;The plugin can be downloaded from an external website and extracted into the PAW plugin folder.&lt;br /&gt;A new page showing available plugins will be included into the next PAW release.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-Xtwu59gRC3Y/TbCFWoMJOhI/AAAAAAAAAE0/687XmYDibCs/s1600/pugins_menu_entry.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-Xtwu59gRC3Y/TbCFWoMJOhI/AAAAAAAAAE0/687XmYDibCs/s1600/pugins_menu_entry.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Plugins in the Add-Ons menu&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;After extracting the plugin it should be visible under PAW's plugin menu.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-L0hsjCnT3Nk/TbCFnFrhsyI/AAAAAAAAAE4/mTO1ocvGeRc/s1600/plugins_php_menu.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-L0hsjCnT3Nk/TbCFnFrhsyI/AAAAAAAAAE4/mTO1ocvGeRc/s1600/plugins_php_menu.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Plugin in the Plug-ins menu&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;Installation of PHP should be a one click action and after a restart of PAW PHP should be available.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-nl_pQYihgi0/TbCF0Fy9nDI/AAAAAAAAAE8/4CLUuJnoHqs/s1600/php_install.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="387" src="http://2.bp.blogspot.com/-nl_pQYihgi0/TbCF0Fy9nDI/AAAAAAAAAE8/4CLUuJnoHqs/s400/php_install.png" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;PHP Installation&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;PHP has been tested using a Google Nexus One and a Notion Ink Adam. The result of &lt;span class="Apple-style-span" style="font-family: 'Courier New',Courier,monospace;"&gt;phpinfo()&lt;/span&gt; can be viewed &lt;a href="http://paw-android.fun2code.de/blog/phpinfo/phpinfo.php.html" target="_blank"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;This is work in progress but it looks promising although not all PHP pages will be working but basic stuff should.&lt;br /&gt;&lt;br /&gt;So stay tuned, I hope to finish this in a couple of weeks :)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Note:&lt;/b&gt;&lt;br /&gt;PAW for Android 0.58 is now available at the Android Market.&lt;br /&gt;The PHP plug-in is also available.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-5353709239103318645?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/5353709239103318645/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2011/04/paw-server-php.html#comment-form' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/5353709239103318645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/5353709239103318645'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2011/04/paw-server-php.html' title='PAW Server &amp; PHP'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-gbKA6TXpDU0/TbCCXePG0LI/AAAAAAAAAEw/sw7KNDOhrXo/s72-c/php_icon.png' height='72' width='72'/><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-1998034084632542513</id><published>2011-03-23T10:11:00.000-07:00</published><updated>2011-03-29T10:38:26.484-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Geocaching'/><category scheme='http://www.blogger.com/atom/ns#' term='CacheStumbler'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Cache Stumbler Beta</title><content type='html'>Cache Stumbler is a widget that is intended to assist people in finding traditional Geocaches.It is not geared at die hard Geocachers but at people that would like to know which traditional Caches are in reach and how to reach them.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Cache Stumbler tries to answer the question: &lt;i&gt;"Where is the next Cache?"&lt;/i&gt;&lt;/blockquote&gt;&lt;br /&gt;The widgets shows the name, direction, distance etc. of the nearest cache without the need to register to &lt;i&gt;geocaching.com&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://lh5.googleusercontent.com/-zKknGkIkZkI/TYoo3HKuz4I/AAAAAAAAAEo/iskH9KimeaA/s1600/cachestumbler_widget.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="47" src="https://lh5.googleusercontent.com/-zKknGkIkZkI/TYoo3HKuz4I/AAAAAAAAAEo/iskH9KimeaA/s200/cachestumbler_widget.png" width="200" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Cache Stumbler Widget&lt;/td&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;Details of the cache are available by tapping on the widget.&lt;br /&gt;&lt;br /&gt;The menu offers the possibility to show the cache on the map, share the cache and mark the cache as found or not-found. When a cache is marked as found/not-found it will be ignored in the future.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://lh6.googleusercontent.com/-EdYCZrRFwVM/TYopJVPes2I/AAAAAAAAAEs/tikMwnWFlPg/s1600/cachestumbler_details.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="400" src="https://lh6.googleusercontent.com/-EdYCZrRFwVM/TYopJVPes2I/AAAAAAAAAEs/tikMwnWFlPg/s400/cachestumbler_details.png" width="240" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Cache Stumbler Details&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;This is a beta version, so things might not work very reliably or might not work at all.&lt;br /&gt;If some people find it useful I might consider publishing it in the Android market.&lt;br /&gt;&lt;br /&gt;Find below the download link, if you would like to try it out. It case of errors it would be nice to get a bug report (preferably with a logcat output attached). Logcat output can be sent by using the app &lt;a href="https://market.android.com/details?id=org.jtb.alogcat"&gt;aLogcat&lt;/a&gt; available from the Android Market.&lt;br /&gt;&lt;br /&gt;Bug report mail address: &lt;i&gt;cachestumbler [at] fun2code.de &lt;/i&gt; &lt;br /&gt;&lt;br /&gt;Comments are of course welcome :)&lt;br /&gt;&lt;br /&gt;Have fun...&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Edit:&lt;/b&gt;&lt;br /&gt;Cache Stumbler is now available at the &lt;a href="https://market.android.com/details?id=de.fun2code.android.cachestumbler"&gt;Android Market&lt;/a&gt;!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-1998034084632542513?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/1998034084632542513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2011/03/cache-stumbler-beta.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/1998034084632542513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/1998034084632542513'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2011/03/cache-stumbler-beta.html' title='Cache Stumbler Beta'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='https://lh5.googleusercontent.com/-zKknGkIkZkI/TYoo3HKuz4I/AAAAAAAAAEo/iskH9KimeaA/s72-c/cachestumbler_widget.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-4213953624034106596</id><published>2011-02-27T06:17:00.000-08:00</published><updated>2011-02-27T06:19:36.299-08:00</updated><title type='text'>PAW Server Widget and App2SD</title><content type='html'>Unfortunately there is a bug in Android concerning the handling of widgets in combination with App2SD. For more information see the following bug report: &lt;a href="http://code.google.com/p/android/issues/detail?id=8555" target="_blank"&gt;Widget from Apps installing in SDCARD in Froyo not show up&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Because of PAW’s size it makes sense to move the app to SD Card. To fix the above issue, here is the widget as separate APK (only 17kB in size).&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Downloads:&lt;/strong&gt; &lt;br /&gt;&lt;a href="http://paw-android.fun2code.de/download/PAW_Server_Widget.apk"&gt;PAW Server Widget&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-4213953624034106596?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/4213953624034106596/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2011/02/paw-server-widget-and-app2sd.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/4213953624034106596'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/4213953624034106596'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2011/02/paw-server-widget-and-app2sd.html' title='PAW Server Widget and App2SD'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-7128936019697109790</id><published>2011-01-28T00:10:00.000-08:00</published><updated>2011-01-30T23:38:44.170-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='PAW'/><title type='text'>PAW - MP3 Player</title><content type='html'>The next version of PAW (0.56) will feature a MP3 player.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_XOAuFrsAEJ4/TUJ1T9RB4AI/AAAAAAAAAEc/58PCMHhyEoE/s1600/paw_mp3player.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="350" src="http://4.bp.blogspot.com/_XOAuFrsAEJ4/TUJ1T9RB4AI/AAAAAAAAAEc/58PCMHhyEoE/s400/paw_mp3player.png" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;PAW - MP3 Player&lt;/td&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;The information used by the player is extracted from the Android device's media database. The coverart will be presented by using the &lt;a href="http://www.jcoverflip.com/" target="_blank"&gt;jCoverflip&lt;/a&gt; jQuery plugin.&lt;br /&gt;For playback the very lightweight (9k) &lt;a href="http://flash-mp3-player.net/" target="_blank"&gt;Flash MP3 Player&lt;/a&gt; is used.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For those of you who want to try a preview of the player or/and want to have a look at the xhtml source you'll find the download at the end of the post.&lt;br /&gt;Just extract the ZIP file to the root of your SDCard (&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/sdcard&lt;/span&gt;). After that you should find a new entry &lt;i&gt;&lt;b&gt;MP3 Player&lt;/b&gt;&lt;/i&gt; in the &lt;i&gt;&lt;b&gt;Media&lt;/b&gt;&lt;/i&gt; menu.&lt;br /&gt;&lt;br /&gt;Have fun...&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Downloads:&lt;/b&gt;&lt;br /&gt;&lt;a href="http://paw-android.fun2code.de/download/paw_mp3player_preview.zip"&gt;PAW - MP3 Player Preview&lt;/a&gt; &lt;span style="font-size: x-small;"&gt;(ZIP file)&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-7128936019697109790?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/7128936019697109790/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2011/01/paw-mp3-player.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/7128936019697109790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/7128936019697109790'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2011/01/paw-mp3-player.html' title='PAW - MP3 Player'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_XOAuFrsAEJ4/TUJ1T9RB4AI/AAAAAAAAAEc/58PCMHhyEoE/s72-c/paw_mp3player.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-4922873528189214172</id><published>2011-01-13T11:31:00.000-08:00</published><updated>2011-01-17T11:20:45.725-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='PAW'/><title type='text'>APK Upload and Installation</title><content type='html'>After reading this post at &lt;a href="http://forum.xda-developers.com/showthread.php?t=909498"&gt;XDA Developers&lt;/a&gt; I would like to show how APK installation can easily be done with PAW Server without the need of an Internet connection.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_XOAuFrsAEJ4/TS9SaKr3p7I/AAAAAAAAAEY/FuxD7IPR_4U/s1600/send_apk_to_android.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_XOAuFrsAEJ4/TS9SaKr3p7I/AAAAAAAAAEY/FuxD7IPR_4U/s1600/send_apk_to_android.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;PAW Content Sharing - Send to Android&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;With the new Content Sharing functions this is very easy and can be done in four simple steps:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Go to the &lt;i&gt;&lt;b&gt;System &amp;gt; Share&lt;/b&gt;&lt;/i&gt; &lt;i&gt;&lt;b&gt;Content&lt;/b&gt;&lt;/i&gt; menu entry.&lt;/li&gt;&lt;li&gt;Select the &lt;i&gt;&lt;b&gt;APK&lt;/b&gt;&lt;/i&gt; file for upload.&lt;/li&gt;&lt;li&gt;Select the&lt;i&gt;&lt;b&gt; Use Open URI&lt;/b&gt;&lt;/i&gt; radio button.&lt;/li&gt;&lt;li&gt;Press the &lt;i&gt;&lt;b&gt;Send Data &lt;/b&gt;&lt;/i&gt;button.&lt;/li&gt;&lt;/ol&gt;Now the installation process should start automatically on your Android Device :)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Note:&lt;/b&gt; The standard file upload size is 2 MB. This can be changed in the server settings to any size.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-4922873528189214172?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/4922873528189214172/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2011/01/apk-upload-and-installation.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/4922873528189214172'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/4922873528189214172'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2011/01/apk-upload-and-installation.html' title='APK Upload and Installation'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_XOAuFrsAEJ4/TS9SaKr3p7I/AAAAAAAAAEY/FuxD7IPR_4U/s72-c/send_apk_to_android.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-9177709141166831278</id><published>2010-12-20T08:15:00.000-08:00</published><updated>2010-12-21T01:43:41.642-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='PAW'/><title type='text'>Sharing .... the Android Way</title><content type='html'>In the upcoming PAW Server for Android release there will be the possibility to share content between Android device and browser by using the integrated Android functionality of sharing content (images, contacts etc.).&lt;br /&gt;Some apps provide a share or send to feature which pops up a selection dialog from which the app that should receives the content can be selected.&lt;br /&gt;&lt;br /&gt;With the new PAW release it will be possible to receive and send content by using this functionality.&lt;br /&gt;&lt;br /&gt;When the share functionality is enabled in PAW (which will be the default), PAW Server will be visible in the selection menu of any app providing the share feature.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_XOAuFrsAEJ4/TQ99GDizdDI/AAAAAAAAAEA/JHYK5EIVEmM/s1600/share_gallery.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/_XOAuFrsAEJ4/TQ99GDizdDI/AAAAAAAAAEA/JHYK5EIVEmM/s320/share_gallery.png" width="192" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Share menu in Gallery&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;After selecting the PAW Server menu entry an icon will be displayed in the PAW statusbar to signal that shared content is available:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_XOAuFrsAEJ4/TQ9-ktu9V5I/AAAAAAAAAEE/S4UuuCQydpM/s1600/share_statusbar.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_XOAuFrsAEJ4/TQ9-ktu9V5I/AAAAAAAAAEE/S4UuuCQydpM/s1600/share_statusbar.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Statusbar&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;After clicking on the icon (or the System-&amp;gt;Share Content menu) the share page will be displayed, which presents the shared data in a table. When the download link is clicked, the shared content will be downloaded by the browser.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_XOAuFrsAEJ4/TQ9_P0O-l2I/AAAAAAAAAEM/SKHqMo_A6bw/s1600/share_webpage.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_XOAuFrsAEJ4/TQ9_P0O-l2I/AAAAAAAAAEM/SKHqMo_A6bw/s1600/share_webpage.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Share from web page&lt;/td&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_XOAuFrsAEJ4/TQ9_AOcsKlI/AAAAAAAAAEI/mIeiyezZ36U/s1600/share_webpage.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;It will be also possible to send files to the Android device by uploading a file and calling the Android share or open URI function. With that it is for example possible to upload APK files and install them in one go without the hassle of uploading the file first and then running it in a separate step.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_XOAuFrsAEJ4/TQ9_P0O-l2I/AAAAAAAAAEM/SKHqMo_A6bw/s1600/share_webpage.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_XOAuFrsAEJ4/TQ9_uGBrdeI/AAAAAAAAAEQ/MpoPndkvzCc/s1600/share_upload_webpage.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_XOAuFrsAEJ4/TQ9_uGBrdeI/AAAAAAAAAEQ/MpoPndkvzCc/s1600/share_upload_webpage.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Upload from web page&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;For programmers there will be the possibility to access the shared content from within a web application. The shared data will be stored in the server scope of the PAW server.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://i.ytimg.com/vi/mBZZNXHhgss/0.jpg" height="266" width="320"&gt;&lt;param name="movie" value="http://www.youtube.com/v/mBZZNXHhgss?f=user_uploads&amp;c=google-webdrive-0&amp;app=youtube_gdata" /&gt;&lt;param name="bgcolor" value="#FFFFFF" /&gt;&lt;embed width="640" height="532" src="http://www.youtube.com/v/mBZZNXHhgss?f=user_uploads&amp;c=google-webdrive-0&amp;app=youtube_gdata" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-9177709141166831278?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/9177709141166831278/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2010/12/sharing-android-way.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/9177709141166831278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/9177709141166831278'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2010/12/sharing-android-way.html' title='Sharing .... the Android Way'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_XOAuFrsAEJ4/TQ99GDizdDI/AAAAAAAAAEA/JHYK5EIVEmM/s72-c/share_gallery.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-3675887331427200248</id><published>2010-12-14T09:33:00.000-08:00</published><updated>2010-12-14T10:34:23.439-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='PAW'/><title type='text'>Flash MP3 Player</title><content type='html'>This post demonstrates how the Android &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;MediaStore&lt;/span&gt; can be used to play MP3 files directly from the device. As player front-end the &lt;a href="http://www.flashmp3player.org/" target="_blank"&gt;Flash MP3 Player&lt;/a&gt; is used.&lt;br /&gt;&lt;br /&gt;For those of you not interested in the code, there is a ready to install ZIP file at the end of the post.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_XOAuFrsAEJ4/TQeokhoiiHI/AAAAAAAAAD0/CXF7R9QuI5U/s1600/flash_mp3_player.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/_XOAuFrsAEJ4/TQeokhoiiHI/AAAAAAAAAD0/CXF7R9QuI5U/s320/flash_mp3_player.png" width="315" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Flash MP3 Player&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;All the files are mainly taken directly from the &lt;i&gt;flashmp3player.org&lt;/i&gt; website.&lt;br /&gt;&lt;br /&gt;Three changes were made:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;In the index.html the reference to &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;flashmp3player.php&lt;/span&gt; has been changed to&amp;nbsp; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;flashmp3player.xhtml&lt;/span&gt;.&lt;/li&gt;&lt;li&gt;The file &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;flashmp3player.xhtml&lt;/span&gt; has been implemented.&lt;/li&gt;&lt;li&gt;The file &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;get_file.xhtml&lt;/span&gt; has been copied from the PAW &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;app&lt;/span&gt; directory and the PAW access control has been removed. This file provides access to files that are not located within the html root directory of the server. This is a potential security risk, so make sure to protect the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;flashmp3player&lt;/span&gt; folder with a password.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;The implementation of &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;flashmp3player.xhtml&lt;/span&gt; uses the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;MediaStore&lt;/span&gt; to extract the information about artist, title and file and constructs a XML file for the Flash MP3 Player.&lt;br /&gt;&lt;br /&gt;An example XML file looks like this:&lt;br /&gt;&lt;pre class="brush:xml"&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;playlist&amp;gt;&lt;br /&gt;&amp;lt;song id="120"  title="Beat The Bastards" artist="Accept" src="get_file.xhtml?file=%2Fmnt%2Fsdcard%2FMusic%2FAccept%20-%20Blood%20Of%20The%20Nations%2F01%20-%20Beat%20The%20Bastards.mp3" /&amp;gt;&lt;br /&gt;&amp;lt;song id="121"  title="Teutonic Terror" artist="Accept" src="get_file.xhtml?file=%2Fmnt%2Fsdcard%2FMusic%2FAccept%20-%20Blood%20Of%20The%20Nations%2F02%20-%20Teutonic%20Terror.mp3" /&amp;gt;&lt;br /&gt;&amp;lt;song id="122"  title="The Abyss" artist="Accept" src="get_file.xhtml?file=%2Fmnt%2Fsdcard%2FMusic%2FAccept%20-%20Blood%20Of%20The%20Nations%2F03%20-%20The%20Abyss.mp3" /&amp;gt;&lt;br /&gt;&amp;lt;song id="123"  title="Blood Of The Nations" artist="Accept" src="get_file.xhtml?file=%2Fmnt%2Fsdcard%2FMusic%2FAccept%20-%20Blood%20Of%20The%20Nations%2F04%20-%20Blood%20Of%20The%20Nations.mp3" /&amp;gt;&lt;br /&gt;&amp;lt;/playlist&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Below is the code of the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;flashmp3player.xhtml&lt;/span&gt; file:&lt;br /&gt;&lt;pre class="brush:java"&gt;&amp;lt;bsh&amp;gt;&lt;br /&gt;import android.net.Uri;&lt;br /&gt;&lt;br /&gt;uri = android.provider.MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;&lt;br /&gt;&lt;br /&gt;String[] tags = new String[] {&lt;br /&gt;android.provider.MediaStore.Audio.Media._ID,&lt;br /&gt;android.provider.MediaStore.Audio.Media.TITLE,&lt;br /&gt;android.provider.MediaStore.Audio.Media.ARTIST,&lt;br /&gt;android.provider.MediaStore.Audio.Media.ALBUM,&lt;br /&gt;android.provider.MediaStore.Audio.Media.DATA&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;service = server.props.get("serviceContext");&lt;br /&gt;&lt;br /&gt;cursor = service.getContentResolver().query(uri, tags, null, null, android.provider.MediaStore.Audio.Media.ARTIST + "," + android.provider.MediaStore.Audio.Media.ALBUM);&lt;br /&gt;&lt;br /&gt;print("&amp;lt;?xml version=\"1.0\" encoding=\"utf-8\"?&amp;gt;");&lt;br /&gt;print("&amp;lt;playlist&amp;gt;");&lt;br /&gt;cursor.moveToFirst();&lt;br /&gt;&lt;br /&gt;do{&lt;br /&gt;&lt;br /&gt;  id = cursor.getString(cursor.getColumnIndexOrThrow(android.provider.MediaStore.Audio.Media._ID)).replaceAll("\"", "");&lt;br /&gt;  artist = cursor.getString(cursor.getColumnIndexOrThrow(android.provider.MediaStore.Audio.Media.ARTIST)).replaceAll("\"", "");&lt;br /&gt;  title = cursor.getString(cursor.getColumnIndexOrThrow(android.provider.MediaStore.Audio.Media.TITLE)).replaceAll("\"", "");&lt;br /&gt;  file = cursor.getString(cursor.getColumnIndexOrThrow(android.provider.MediaStore.Audio.Media.DATA));&lt;br /&gt;  file = "get_file.xhtml?file=" + Uri.encode(file);&lt;br /&gt;&lt;br /&gt;  if(file.endsWith(".mp3")) { &lt;br /&gt; print("&amp;lt;song id=\"" + id + "\"  title=\"" + title + "\" artist=\"" + artist + "\" src=\"" + file + "\" /&amp;gt;");&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;while(cursor.moveToNext());&lt;br /&gt;cursor.close();&lt;br /&gt;print("&amp;lt;/playlist&amp;gt;");&lt;br /&gt;&amp;lt;/bsh&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Downloads:&lt;/b&gt;&lt;br /&gt;&lt;a href="http://paw-android.fun2code.de/download/paw_flashmp3player.zip"&gt;paw_flashmp3player.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Installation:&lt;/b&gt;&lt;br /&gt;Unzip into the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/sdcard&lt;/span&gt; folder of your Android device.&lt;br /&gt;Access &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;http:&amp;lt;ip&amp;gt;&lt;/span&gt;&lt;ip&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;:8080/&lt;/span&gt; on your device. The &lt;i&gt;MP3 Player&lt;/i&gt; entry should be available in the list of applications.&lt;/ip&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="color: red;"&gt;&lt;b&gt;Attention:&lt;/b&gt; There are no access restrictions on the installation directory!&lt;/div&gt;&lt;span style="color: red;"&gt;So use this only for a short period of time or password protect the directory by defining a password (PAW Menu -&amp;gt; Server -&amp;gt; Directory Protection).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Uninstall:&lt;/b&gt;&lt;br /&gt;Delete the folder &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/sdcard/paw/html/flashmp3player&lt;/span&gt; and the file &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/sdcard/paw/webconf/apps/x02_flashmp3player.conf&lt;/span&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-3675887331427200248?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/3675887331427200248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2010/12/flash-mp3-player.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/3675887331427200248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/3675887331427200248'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2010/12/flash-mp3-player.html' title='Flash MP3 Player'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_XOAuFrsAEJ4/TQeokhoiiHI/AAAAAAAAAD0/CXF7R9QuI5U/s72-c/flash_mp3_player.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-8177227543949413142</id><published>2010-12-14T09:00:00.000-08:00</published><updated>2010-12-14T10:30:03.491-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='PAW'/><title type='text'>File Upload</title><content type='html'>Since PAW 0.51 file upload sizes are no longer restricted. This restriction has been removed by changing the code of the underlying Brazil framework.&lt;br /&gt;This post shows how file upload can be implemented.&lt;br /&gt;&lt;br /&gt;A ready to install ZIP file containig all the code is available at the end of the post.&lt;br /&gt;&lt;br /&gt;Since PAW 0.51 requests with content-type &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;multipart/form-data&lt;/span&gt; are handled differently. The post request parameters are not handled automatically and processing is left to the application. The InputStream of the request can be accessed by using the instance variabel &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;request.in&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;The example consists of two files. One is the html file containing the form which allows the upload of two files.&lt;br /&gt;The second file is the xhtml file containing the code to save the uploaded files to the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/sdcard&lt;/span&gt; directory of the Android device.&lt;br /&gt;&lt;br /&gt;To make the handling of the multipart form data easier the class &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;MultipartStream&lt;/span&gt; from the &lt;i&gt;Apache Commons Fileupload&lt;/i&gt; package has been added to PAW.&lt;br /&gt;Actually this is an old version of the class which has no dependencies at all.&lt;br /&gt;&lt;br /&gt;The html which contains the form is quite simple:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:html"&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;  &amp;lt;title&amp;gt;File Upload&amp;lt;/title&amp;gt;&lt;br /&gt;  &amp;lt;link rel="stylesheet" href="css/default.css"&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;  &amp;lt;h2&amp;gt;File Upload Demo&amp;lt;/h2&amp;gt;&lt;br /&gt;  &amp;lt;p&amp;gt;&lt;br /&gt;  Uploads files to /sdcard...&lt;br /&gt;  &amp;lt;/p&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;form action="fup.xhtml" method="post" enctype="multipart/form-data" &amp;gt;&lt;br /&gt;&lt;br /&gt;  File to upload: &amp;lt;input name="upfile1" type="file"&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;  File to upload: &amp;lt;input name="upfile2" type="file"&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;  &amp;lt;input value="Upload" type="submit"&amp;gt;&lt;br /&gt;  &amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The second file performs the following steps to save the files:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Extract the boundary string from the content-type.&lt;/li&gt;&lt;li&gt;Constructs a MultipartStream object.&lt;/li&gt;&lt;li&gt;Skips the preamble. This ignores all data until the boundary is reached.&lt;/li&gt;&lt;li&gt;Reads the parts until it finds a file. If a file is found it extracts the filename and stores the file in the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/sdcard&lt;/span&gt; directory.&lt;/li&gt;&lt;li&gt;If the part contains no file, the part's body is skipped.&lt;/li&gt;&lt;/ol&gt;There is a nice article that discribes this in more detail on &lt;i&gt;oreillynet.com&lt;/i&gt;: &lt;a href="http://www.oreillynet.com/onjava/blog/2006/06/parsing_formdata_multiparts.html" target="_blank"&gt;Parsing form-data multiparts&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;So now here is the code:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:java"&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;File Upload&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;link rel="stylesheet" href="css/default.css"&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;bsh&amp;gt;&lt;br /&gt;import org.paw.util.*;&lt;br /&gt;import org.apache.commons.fileupload.*;&lt;br /&gt;&lt;br /&gt;outDir = "/sdcard/fup";&lt;br /&gt;files = new ArrayList();&lt;br /&gt;type = (String) request.headers.get("content-type");&lt;br /&gt;&lt;br /&gt;if (type != null &amp;amp;&amp;amp;type.startsWith("multipart/form-data")) {&lt;br /&gt; try {&lt;br /&gt;  // Get the boundary string&lt;br /&gt;  boundaryIndex = type.indexOf("boundary=");&lt;br /&gt;  byte[] boundary = (type.substring(boundaryIndex + 9)).getBytes();&lt;br /&gt;&lt;br /&gt;  // Construct a MultiPartStream with request.in as InputStream&lt;br /&gt;  MultipartStream multipartStream =  new MultipartStream(request.in, boundary);&lt;br /&gt;  boolean nextPart = multipartStream.skipPreamble();&lt;br /&gt;&lt;br /&gt;  // Loop through all parts&lt;br /&gt;  while(nextPart) {&lt;br /&gt;    headers = multipartStream.readHeaders();&lt;br /&gt;&lt;br /&gt;    // If part is a file, save it to disk. Otherwise skip it.&lt;br /&gt;    if(headers.contains("filename=\"")) {&lt;br /&gt;       // Get filename&lt;br /&gt;       filename = headers.substring(headers.indexOf("filename=") + 10);&lt;br /&gt;       filename = filename.substring(0, filename.indexOf("\""));&lt;br /&gt;&lt;br /&gt;       // If filename is not empty save content to filesystem&lt;br /&gt;       if(filename.length() &amp;gt; 0) {&lt;br /&gt;   files.add(filename);&lt;br /&gt;   multipartStream.readBodyData(new FileOutputStream(outDir + "/" + filename));&lt;br /&gt;       }&lt;br /&gt;                     else {&lt;br /&gt;   multipartStream.discardBodyData();  &lt;br /&gt;       }&lt;br /&gt;    }&lt;br /&gt;    else {&lt;br /&gt;       multipartStream.discardBodyData();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    nextPart = multipartStream.readBoundary();&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt; catch(e) {&lt;br /&gt;  print(e);&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&amp;lt;/bsh&amp;gt;&lt;br /&gt;Uploaded files to &amp;lt;bsh&amp;gt;$$.print(outDir);&amp;lt;/bsh&amp;gt;:&amp;lt;br&amp;gt;&lt;br /&gt;&amp;lt;hr&amp;gt;&lt;br /&gt;&amp;lt;bsh&amp;gt;&lt;br /&gt;for(file : files) {&lt;br /&gt; print(file + "&amp;lt;br&amp;gt;");&lt;br /&gt;}&lt;br /&gt;&amp;lt;/bsh&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Downloads:&lt;/b&gt;&lt;br /&gt;&lt;a href="http://paw-android.fun2code.de/download/paw_fup.zip"&gt;paw_fup.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Installation:&lt;/b&gt;&lt;br /&gt;Unzip into the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/sdcard&lt;/span&gt; folder of your Android device.&lt;br /&gt;Access &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;http:&amp;lt;ip&amp;gt;&lt;/span&gt;&lt;ip&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;:8080/&lt;/span&gt; on your device. The &lt;i&gt;File Upload Demo&lt;/i&gt; entry should be available in the list of applications.&lt;br /&gt;&lt;br /&gt;&lt;div style="color: red;"&gt;&lt;b&gt;Attention:&lt;/b&gt; There are no access restrictions on the installation directory!&lt;/div&gt;&lt;span style="color: red;"&gt;So use this only for a short period of time or password protect the directory by defining a password (PAW Menu -&amp;gt; Server -&amp;gt; Directory Protection).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Uninstall:&lt;/b&gt;&lt;br /&gt;Delete the folder &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/sdcard/paw/html/fup&lt;/span&gt; and the file &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/sdcard/paw/webconf/apps/x01_fup.conf&lt;/span&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-8177227543949413142?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/8177227543949413142/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2010/12/file-upload.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/8177227543949413142'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/8177227543949413142'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2010/12/file-upload.html' title='File Upload'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-572381426567710395</id><published>2010-11-25T13:15:00.000-08:00</published><updated>2010-11-25T13:15:20.081-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DavDrive'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>DavDrive and Nautilus</title><content type='html'>If you are using DavDrive in combination with Ubuntu you might notice a bug which prevents you from copying directories from your Android device when using Natilus.&lt;br /&gt;This is not a DavDrive bug but a Nautilus/gvfs bug which is present for more than two years.&lt;br /&gt;&lt;br /&gt;For more detail see the Ubuntu bug report &lt;a href="https://bugs.launchpad.net/ubuntu/+source/gvfs/+bug/267642" target="_blank"&gt;#267642&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;When copying a directory with Natilus only a file containing the directory listing is produced:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_XOAuFrsAEJ4/TO7QRHlGl5I/AAAAAAAAADw/UIPWnOZolXU/s1600/dd_n1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_XOAuFrsAEJ4/TO7QRHlGl5I/AAAAAAAAADw/UIPWnOZolXU/s1600/dd_n1.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Result of Nautilus directory copy&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;The bug report mentions a workaround:&lt;br /&gt;Copying directories is possible by using a shell and accessing the &lt;tt&gt;~/.gvfs&lt;/tt&gt; folder directly.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_XOAuFrsAEJ4/TO7PoiDkX6I/AAAAAAAAADs/peP9kB4wEck/s1600/dd_n2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_XOAuFrsAEJ4/TO7PoiDkX6I/AAAAAAAAADs/peP9kB4wEck/s1600/dd_n2.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Directory copy from Shell&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Hopefully this nasty bug will be fixed soon.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-572381426567710395?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/572381426567710395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2010/11/davdrive-and-nautilus.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/572381426567710395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/572381426567710395'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2010/11/davdrive-and-nautilus.html' title='DavDrive and Nautilus'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_XOAuFrsAEJ4/TO7QRHlGl5I/AAAAAAAAADw/UIPWnOZolXU/s72-c/dd_n1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-4500017020607132319</id><published>2010-11-17T07:03:00.000-08:00</published><updated>2010-11-18T05:22:15.591-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DavDrive'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>DavDrive &amp; DAVCommander</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;DavDrive allows the browsing of the filesystem from a browser, but this is not very comfortable and does not allow for file upload, file deletion or to create and delete directories.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sourceforge.net/projects/davcommander/"  target="_blank"&gt;DAVCommander&lt;/a&gt; is a Sourceforge project, that provides a nice WebDAV frontend which can also be used as a Java Applet inside a web browser.&lt;br /&gt;This following blog post shows how DAVCommander can be easily integrated into DavDrive &lt;span style="font-size: x-small;"&gt;(and DavDrive Lite)&lt;/span&gt;. &lt;br /&gt;&lt;br /&gt;The idea is to put the files needed by DAVCommander (HTML and JAR file) into a folder served by DavDrive and call the HTMLfrom a browser. The HTML contains a JavaScript that builds the &amp;lt;applet&amp;gt; tag with the appropriate WebDAV URL, so that the configuration is done automatically. For all this to work Java has to be installed on your PC and Applets have to work. &lt;br /&gt;&lt;br /&gt;For those interested, here is the HTML page:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:javascript"&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&lt;br /&gt;davURL = window.location.protocol + "//"  + window.location.host;&lt;br /&gt;&lt;br /&gt;document.write('&amp;lt;body style="background: gray;"&amp;gt;&amp;lt;div style="border: 1px solid black;"&amp;gt;');&lt;br /&gt;document.write('&amp;lt;applet archive="DAVCommander.jar" code="ch.oxinia.webdav.davcommander.AppletMain.class" width="100%" height="98%"&amp;gt;');&lt;br /&gt;document.write('&amp;lt;param name="uri" value="' + davURL + '"&amp;gt;');&lt;br /&gt;document.write('&amp;lt;param name="staticUri" value="true"&amp;gt;');&lt;br /&gt;document.write('&amp;lt;param name="acl" value="false"&amp;gt;');&lt;br /&gt;document.write('&amp;lt;param name="versionControl" value="false"&amp;gt;');&lt;br /&gt;document.write('&amp;lt;param name="locking" value="false"&amp;gt;');&lt;br /&gt;document.write('&amp;lt;param name="davproperties" value="false"&amp;gt;');&lt;br /&gt;document.write('&amp;lt;param name="showTrees" value="false"&amp;gt;');&lt;br /&gt;document.write('&amp;lt;param name="multipleSelection" value="true"&amp;gt;');&lt;br /&gt;document.write('&amp;lt;param name="dragDrop" value="true"&amp;gt;');&lt;br /&gt;document.write('&amp;lt;param name="renameWithDoubleclick" value="false"&amp;gt;');&lt;br /&gt;document.write('&amp;lt;param name="lockUiWhileBusy" value="false"&amp;gt;');&lt;br /&gt;document.write('&amp;lt;param name="keepAlivePeriod" value="0"&amp;gt;');&lt;br /&gt;document.write('&amp;lt;param name="keepAliveUri" value=""&amp;gt;');&lt;br /&gt;document.write('&amp;lt;/applet&amp;gt;');&lt;br /&gt;document.write('&amp;lt;/div&amp;gt;&amp;lt;/body&amp;gt;');&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Don't worry, installation is very simple and all you need is a simple ZIP file which is provided at the end of the post that has to be extracted to a directory served by DavDrive.&lt;br /&gt;&lt;br /&gt;In my example, I'll extract the ZIP file to my &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/sdcard &lt;/span&gt;on my Android device which is also the root folder of my DavDrive setup. After this is done direct the browser to the URL displayed by the DavDrive app, enter &lt;i&gt;user/password&lt;/i&gt; and browse to the DAVCommander Folder.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_XOAuFrsAEJ4/TOPs2T_j92I/AAAAAAAAADg/tnUj4HH3cWM/s1600/dc2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_XOAuFrsAEJ4/TOPs2T_j92I/AAAAAAAAADg/tnUj4HH3cWM/s1600/dc2.png" /&gt;&amp;nbsp;&lt;/a&gt;&lt;/td&gt;&lt;td style="text-align: center;"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Directory Listing&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;After selecting the file DAVCommander.html the Applet should be started and after providing &lt;i&gt;user/password&lt;/i&gt; &lt;span style="font-size: x-small;"&gt;(could be more than once) &lt;/span&gt;DAVCommander should appear.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_XOAuFrsAEJ4/TOPtIfvWa9I/AAAAAAAAADk/N2cMiML5AYI/s1600/dc3.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_XOAuFrsAEJ4/TOPtIfvWa9I/AAAAAAAAADk/N2cMiML5AYI/s1600/dc3.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;DAVCommander&lt;/td&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;That's it, now you can mange files and folders directly from within your browser. &lt;br /&gt;&lt;br /&gt;Downloads:&lt;br /&gt;&lt;a href="http://davdrive-android.fun2code.de/download/DAVCommander.zip"&gt;DAVCommander.zip&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-4500017020607132319?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/4500017020607132319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2010/11/davdrive-davcommander.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/4500017020607132319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/4500017020607132319'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2010/11/davdrive-davcommander.html' title='DavDrive &amp; DAVCommander'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_XOAuFrsAEJ4/TOPs2T_j92I/AAAAAAAAADg/tnUj4HH3cWM/s72-c/dc2.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-7768779147419280514</id><published>2010-09-22T09:36:00.000-07:00</published><updated>2010-09-22T11:50:55.032-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='PAW'/><title type='text'>PAW Performance</title><content type='html'>To test the performance of PAW on Android I created a small web app for PAW Runtime which basically takes a small picture (80x120px) and transforms it into a grayscale and sepia image.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_XOAuFrsAEJ4/TJo9oGjddaI/AAAAAAAAADI/B7zlA6V5JJ4/s1600/device.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_XOAuFrsAEJ4/TJo-XDMHV8I/AAAAAAAAADQ/bcrnpDFowck/s1600/device.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="400" src="http://4.bp.blogspot.com/_XOAuFrsAEJ4/TJo-XDMHV8I/AAAAAAAAADQ/bcrnpDFowck/s400/device.png" width="240" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Web App&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_XOAuFrsAEJ4/TJoqw8rWD3I/AAAAAAAAACw/i-6ftKssxPE/s1600/org.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&lt;/div&gt;The transformation was done with native code (compiled into the PAW  runtime) and also with pure BeanShell code to get a feel how BeanShell  performs.&lt;br /&gt;Main reasons for doing the test were the reports about bad BeanShell performance.&lt;br /&gt;&lt;br /&gt;The algorithms used for BeanShell and native code&amp;nbsp; were identical.&lt;br /&gt;Here is the BeabShell code:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:java"&gt;import android.graphics.*;&lt;br /&gt;import android.graphics.Bitmap.CompressFormat;&lt;br /&gt;&lt;br /&gt;file = parameters.get("file");&lt;br /&gt;filter = parameters.get("filter");&lt;br /&gt;sepia = (filter != null &amp;amp;&amp;amp; filter.equals("sepia")) ? true : false;&lt;br /&gt;&lt;br /&gt;depth = 20;&lt;br /&gt;&lt;br /&gt;if(file != null) {&lt;br /&gt; bitmap = BitmapFactory.decodeFile(file);&lt;br /&gt;&lt;br /&gt; if(bitmap != null) {&lt;br /&gt;  bitmap2 = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888);&lt;br /&gt;  w = bitmap.getWidth();&lt;br /&gt;  h = bitmap.getHeight();&lt;br /&gt;  for(x=0; x &amp;lt; w; x++) {&lt;br /&gt;   for(y=0; y &amp;lt; h; y++) {&lt;br /&gt;    c = bitmap.getPixel(x, y);&lt;br /&gt;&lt;br /&gt;    r = Color.red(c);&lt;br /&gt;    g = Color.green(c);&lt;br /&gt;    b = Color.blue(c);&lt;br /&gt;     &lt;br /&gt;    gry = (r + g + b) / 3;&lt;br /&gt;    r = g = b = gry;&lt;br /&gt;    &lt;br /&gt;    if(sepia) {&lt;br /&gt;     r = r + (depth * 2);&lt;br /&gt;     g = g + depth;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    if(r &amp;gt; 255) {&lt;br /&gt;      r = 255;&lt;br /&gt;    }&lt;br /&gt;    if(g &amp;gt; 255) {&lt;br /&gt;      g = 255;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    bitmap2.setPixel(x, y, Color.rgb(r, g, b));&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  bos = new ByteArrayOutputStream();&lt;br /&gt;  bitmap2.compress(CompressFormat.PNG, 0 /*ignored for PNG*/, bos);&lt;br /&gt;  byte[] bitmapdata = bos.toByteArray();&lt;br /&gt;&lt;br /&gt;  request.sendResponse(bitmapdata, "image/png");&lt;br /&gt;  request.out.flush();&lt;br /&gt;  request.out.close();&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here is the result after running the test:&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_XOAuFrsAEJ4/TJosff5P55I/AAAAAAAAAC4/L1dYcR7XY0k/s1600/res.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="400" src="http://1.bp.blogspot.com/_XOAuFrsAEJ4/TJosff5P55I/AAAAAAAAAC4/L1dYcR7XY0k/s400/res.png" width="206" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Result&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;Actually BeanShell is much slower than I expected. But if you take into consideration what is happening behind the scenes it's not as surprising as it seems. There is a log of Java reflection, parsing, instantiations etc. going on.&lt;br /&gt;Another result was, that the PAW server itself is performing nicely, which is a good sign. &lt;br /&gt;So from a developer's point of view BeanShell code should be reduced to a minimum and native Android API should be used as much as possible.&lt;br /&gt;&lt;br /&gt;What it also means is that, because the PAW Web App uses much BeanShell code, there is room for improvement...&lt;br /&gt;&lt;br /&gt;To test it for yourself, download the latest &lt;a href="http://paw-android.fun2code.de/download/PawRuntime.apk"&gt;PAW Runtime&lt;/a&gt; version and unpack the Image &lt;a href="http://paw-android.fun2code.de/download/ImageManipulation.zip"&gt;Manipulation ZIP file&lt;/a&gt; to your&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt; /sdcard/paw-runtime&lt;/span&gt; directory.&lt;br /&gt;&lt;br /&gt;After that the following menu entry should be available in your PAW Runtime menu:&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;img border="0" height="48" src="http://4.bp.blogspot.com/_XOAuFrsAEJ4/TJo7Y3Q8TzI/AAAAAAAAADA/MBdKyo39LD0/s200/device.png" style="margin-left: auto; margin-right: auto;" width="200" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Menu Entry&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_XOAuFrsAEJ4/TJo7Y3Q8TzI/AAAAAAAAADA/MBdKyo39LD0/s1600/device.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-7768779147419280514?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/7768779147419280514/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2010/09/paw-performance.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/7768779147419280514'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/7768779147419280514'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2010/09/paw-performance.html' title='PAW Performance'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_XOAuFrsAEJ4/TJo-XDMHV8I/AAAAAAAAADQ/bcrnpDFowck/s72-c/device.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-1787509638473020187</id><published>2010-09-16T07:55:00.000-07:00</published><updated>2011-07-12T08:42:10.992-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='PAW'/><title type='text'>PAW Runtime</title><content type='html'>PAW Runtime is basically a stripped down PAW Server that only listens to the loopback interface on a random port and with a WebView serving as browser frontend.&lt;br /&gt;With this set-up it is possible to run PAW applications directly on the device.&lt;br /&gt;&lt;br /&gt;Everything that's possible with PAW Server is also possible with the runtime version.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_XOAuFrsAEJ4/TJIneHa4qWI/AAAAAAAAACg/nC-Q_yqN8qA/s1600/overview.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_XOAuFrsAEJ4/TUL8b29xFXI/AAAAAAAAAEg/Mcf3fK30fLo/s1600/overview.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="400" src="http://2.bp.blogspot.com/_XOAuFrsAEJ4/TUL8b29xFXI/AAAAAAAAAEg/Mcf3fK30fLo/s400/overview.png" width="341" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Overview&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;It enables users and programmers to directly develop applications on the device without the need to install a SDK on the PC.&lt;br /&gt;Because the GUI is defined via HTML development of the interface is easy for people that know HTML/CSS and JavaScript.&lt;br /&gt;&lt;br /&gt;There are of course limitations to this approach concerning speed and using all features of the platform, but for developing small applications or prototypes this should be sufficient.&lt;br /&gt;What is not possible is to develop individual apps, all PAW Runtime apps reside in the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/sdcard/paw-runtime&lt;/span&gt; directory and are accessible (when defined in the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;webconf/apps&lt;/span&gt; directory) from the main menu screen.&lt;br /&gt;&lt;br /&gt;The runtime itself comes with no applications, but demo applications are available for download.&lt;br /&gt;Below is the main menu with installed demo applications.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;img border="0" height="400" src="http://2.bp.blogspot.com/_XOAuFrsAEJ4/TJIofKo5ZEI/AAAAAAAAACo/NU3Q8-uXiFk/s400/menu.png" style="margin-left: auto; margin-right: auto;" width="184" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Menu&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_XOAuFrsAEJ4/TJIofKo5ZEI/AAAAAAAAACo/NU3Q8-uXiFk/s1600/menu.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Let's have a look at the compass app shown in the first image.&lt;br /&gt;&lt;br /&gt;All applications are stored in the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/sdcard/paw-runtime/html&lt;/span&gt; folder. The application consists of a XHTML file and the corresponding jQuery scripts and images. Together with the demos comes a &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;html/common&lt;/span&gt; folder that contains components (like JavaScript files) that can be reused.&lt;br /&gt;&lt;br /&gt;Let's have a look at the &lt;i&gt;XHTML&lt;/i&gt; file:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:html"&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;Compass&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;link rel="stylesheet" href="../common/css/default.css"&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript" src="../common/js/jquery.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript" src="../common/js/executeScript.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript" src="js/jquery.rotate.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;$(document).ready(function() {&lt;br /&gt;updateCompass();&lt;br /&gt;});&lt;br /&gt;&lt;br /&gt;function updateCompass() {&lt;br /&gt;executeScript('compassScript', null, 'compassRes');&lt;br /&gt;$("#compassImg").rotate($("#compassRes").val() * -1, 'abs');&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;center&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt;Compass&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;img src="images/compass_rose.png" id="compassImg"&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;&lt;br /&gt;&amp;lt;div style="font-size: 30px; font-style: bold;" id="compass"&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;/center&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;input type="hidden" id="compassRes" onChange="$('#compass').html($(this).val() + '°'); setTimeout('updateCompass();', 500);"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- Script --&amp;gt;&lt;br /&gt;&amp;lt;textarea id="compassScript" style="visibility:hidden; display: none;"&amp;gt;&lt;br /&gt;import de.fun2code.android.pawserver.AndroidInterface;&lt;br /&gt;&lt;br /&gt;sensorListener = AndroidInterface.getSensorListener();&lt;br /&gt;bearing = sensorListener.getOrientBearing();&lt;br /&gt;$$.print(bearing);&lt;br /&gt;&amp;lt;/textarea&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The part that reads the bearing information of the device is surrounded by BeanShell &lt;i&gt;&amp;lt;bsh&amp;gt;...&amp;lt;/bsh&amp;gt;&lt;/i&gt;  tags.&lt;br /&gt;All the rest is standard &lt;i&gt;HTML/JavaScript&lt;/i&gt;. A documentation of the functions provided by PAW comes bundled with the demo applications.&lt;br /&gt;&lt;br /&gt;One last thing to do is to define the application's &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;.conf&lt;/span&gt; file in the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;webconf/apps&lt;/span&gt; directory, so that the application is available from the main menu.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text"&gt;name=Compass&lt;br /&gt;description=Displays Compass and Bearing&lt;br /&gt;icon=compass/images/compass_rose.png&lt;br /&gt;href=compass/compass.xhtml&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;APK Download: &lt;/b&gt;&lt;a href="http://paw-android.fun2code.de/download/PawRuntime.apk"&gt;PawRuntime.apk&lt;/a&gt;&lt;br /&gt;&lt;b&gt;Demos Download: &lt;/b&gt;&lt;a href="http://paw-android.fun2code.de/download/PawRuntime_Demos.zip"&gt;PawRuntime_Demos.zip&lt;/a&gt;&lt;br /&gt;&lt;b&gt;Eclipse Project: &lt;/b&gt;&lt;a href="http://paw-android.fun2code.de/download/AndroidPawRuntime_Eclipse_Project.zip"&gt;AndroidPawRuntime_Eclipse_Project.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Note:&lt;/b&gt; Files are based on PAW Server for Android &lt;span class="gwt-InlineHTML"&gt;0.60 beta&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The demos can be simply unpacked onto the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/sdcard&lt;/span&gt; of the device.&lt;br /&gt;&lt;br /&gt;PAW Runtime is currently in alpha state.&lt;br /&gt;Comments are welcome...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-1787509638473020187?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/1787509638473020187/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2010/09/paw-runtime.html#comment-form' title='14 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/1787509638473020187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/1787509638473020187'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2010/09/paw-runtime.html' title='PAW Runtime'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_XOAuFrsAEJ4/TUL8b29xFXI/AAAAAAAAAEg/Mcf3fK30fLo/s72-c/overview.png' height='72' width='72'/><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-4302540825173833278</id><published>2010-06-04T11:03:00.000-07:00</published><updated>2010-06-04T13:49:02.276-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='PAW'/><title type='text'>Sending Web Pages, Market Links and Goolge Map Routes directly to the Phone</title><content type='html'>With the new version of PAW (0.38.6) it is now possible to send web pages, market links and Google Maps (routes, Street View) directly to the Android phone*.&lt;br /&gt;&lt;br /&gt;The setup is easy. After installing Greasemonkey and two additional scripts (one for the Android Market and one for the web an Google Map pages) the only thing that is left is to configure the Greasemonkey scripts. This is not very hard and should only take a view seconds.&lt;br /&gt;&lt;br /&gt;The scripts and instructions are found within PAW's web application, in the &lt;b&gt;Add-Ons&lt;/b&gt; section.&lt;br /&gt;&lt;br /&gt;Below are some screen shots show the new functionality.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_XOAuFrsAEJ4/TAlf338z1xI/AAAAAAAAACQ/ZoxaZoiKQUI/s1600/wmgm.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://2.bp.blogspot.com/_XOAuFrsAEJ4/TAlf338z1xI/AAAAAAAAACQ/ZoxaZoiKQUI/s400/wmgm.png" width="322" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;span style="font-size: x-small;"&gt;* Google Maps might only be working on devices which are running Android 2.1 and up&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;iframe name="pawIframe" src="" style="height: 0pt; visibility: hidden; width: 0pt;"&gt;&lt;/iframe&gt;&lt;iframe id="pawIframe" src="" style="height: 0pt; visibility: hidden; width: 0pt;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;iframe name="pawIframe" src="" style="height: 0pt; visibility: hidden; width: 0pt;"&gt;&lt;/iframe&gt;&lt;iframe id="pawIframe" src="" style="height: 0pt; visibility: hidden; width: 0pt;"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-4302540825173833278?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/4302540825173833278/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2010/06/sending-web-pages-market-links-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/4302540825173833278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/4302540825173833278'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2010/06/sending-web-pages-market-links-and.html' title='Sending Web Pages, Market Links and Goolge Map Routes directly to the Phone'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_XOAuFrsAEJ4/TAlf338z1xI/AAAAAAAAACQ/ZoxaZoiKQUI/s72-c/wmgm.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-7227269246615015412</id><published>2010-03-04T12:08:00.000-08:00</published><updated>2010-03-04T12:13:01.010-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='PAW'/><title type='text'>SSL Again</title><content type='html'>I finally got SSL working in PAW.&lt;br /&gt;&lt;br /&gt;The code in the previous post is working. The problem was fixed by disabling keep alive in the Brazil framework.&lt;br /&gt;&amp;nbsp;Actually I can't tell if this is a problem with the Brazil framework or Android.&lt;br /&gt;&lt;br /&gt;HTTPS can now be enabled in the PAW server settings.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_XOAuFrsAEJ4/S5AT9D-6O5I/AAAAAAAAABE/SIeG7VJxi8o/s1600-h/paw_server_settings_https.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_XOAuFrsAEJ4/S5AT9D-6O5I/AAAAAAAAABE/SIeG7VJxi8o/s320/paw_server_settings_https.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Anyway it's working and performance does not seem to suffer too much.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-7227269246615015412?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/7227269246615015412/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2010/03/ssl-again.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/7227269246615015412'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/7227269246615015412'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2010/03/ssl-again.html' title='SSL Again'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_XOAuFrsAEJ4/S5AT9D-6O5I/AAAAAAAAABE/SIeG7VJxi8o/s72-c/paw_server_settings_https.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8371221544034078032.post-1770743984108719682</id><published>2010-03-02T09:07:00.000-08:00</published><updated>2011-01-10T12:27:24.502-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='PAW'/><title type='text'>PAW Server for Android and SSL</title><content type='html'>After receiving user feedback from Stephen I decided to have a look how to implement SSL connections for PAW.&lt;br /&gt;&lt;br /&gt;As Stephen pointed out, and of course he is correct, security is not very high in PAW as it is possible to modify data on the device.&lt;br /&gt;First thing I did was to check how SSL works on standard Java.&lt;br /&gt;This was fairly easy and worked on first try:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;int port = 9999;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;br /&gt;System.setProperty("javax.net.ssl.keyStore", "android-keystore");&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="font-size: x-small;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;System.setProperty("javax.net.ssl.keyStorePassword", "android");&lt;br /&gt;ServerSocketFactory ssocketFactory = SSLServerSocketFactory.getDefault();&lt;br /&gt;ServerSocket ssocket = ssocketFactory.createServerSocket(port);&lt;br /&gt;Socket socket = ssocket.accept();&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;Unfortunately that didn't work at all on Android. I only received an normal ServerSocket without any SSL support.&lt;br /&gt;After some googeling the code looked like this:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;import javax.net.ssl.SSLServerSocketFactory;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;import javax.net.ssl.SSLSocketFactory;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;import javax.net.ssl.SSLContext;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;import javax.net.ssl.KeyManagerFactory;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;import java.security.KeyStore;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; try {&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; int port = 9999;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; char[] passphrase = "android".toCharArray();&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;ctx = SSLContext.getInstance("TLS");&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); &lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;/span&gt;&lt;/span&gt; &lt;/blockquote&gt;&lt;blockquote&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;//BKS&lt;br /&gt;ks = KeyStore.getInstance (KeyStore.getDefaultType());&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;ks.load(new FileInputStream("/sdcard/pawKeystore"),passphrase);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;kmf.init(ks, passphrase);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;ctx.init(kmf.getKeyManagers(), null, null);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;ssf = ctx.getServerSocketFactory();&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;ssocket = ssf.createServerSocket(port);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;ssocket.accept();&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (e) {&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; print(e);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;This code is in principle working. Actually the code can be executed inside the PAW BeanShell Console (if a keystore exists).&lt;br /&gt;&lt;br /&gt;What I didn't know was that the keystore format on Android is not the same as in standard Java. The format uses by Android is &lt;i&gt;BKS&lt;/i&gt; which is not supported by the Java &lt;i&gt;keytool&lt;/i&gt; out of the box.&lt;br /&gt;&lt;br /&gt;To get &lt;i&gt;BKS&lt;/i&gt; working the &lt;i&gt;JCE&lt;/i&gt; provider from &lt;a href="http://www.bouncycastle.org/resources.html"&gt;BouncyCastle&lt;/a&gt; has to be downloaded and the &lt;i&gt;JAR&lt;/i&gt; file has to be extracted to &lt;span style="font-size: x-small;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$JAVA_HOME/jre/lib/ext/&lt;/span&gt;&lt;/span&gt;. After that the following line has to be added to the file &lt;span style="font-size: x-small;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$JAVA_HOME/jre/lib/security/java.security&lt;/span&gt;&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;security.provider.9=org.bouncycastle.jce.provider.BouncyCastleProvider&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;The number behind &lt;span style="font-size: x-small;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;security.provider.&lt;/span&gt;&lt;/span&gt; depends on your Java installation. After that a keystore file can be created with the following command line:&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;keytool -genkey -keyalg RSA -keysize 1024 -alias alias -keystore pawKeystore -validity 3650 -storetype BKS&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;On my Galaxy I noticed that when running the code not all connections were accepted, which was strange. In addition there would be minor changes necessary to the underlying Brazil framework, because &lt;i&gt;SSLSockets&lt;/i&gt; throw additional Exceptions which do not occur when standard&amp;nbsp; Sockets are used.&lt;br /&gt;&lt;br /&gt;But after setting it all up it didn't work because of connection problems and when it worked from time to time it was horribly slow.&lt;br /&gt;The connections problems might be a problem within Android, because for the application this all should be transparent. &lt;br /&gt;&lt;br /&gt;I would have really liked to implement SSL within PAW but at the moment I just don't get it working.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8371221544034078032-1770743984108719682?l=fun2code-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fun2code-blog.blogspot.com/feeds/1770743984108719682/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fun2code-blog.blogspot.com/2010/03/paw-server-for-android-and-ssl.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/1770743984108719682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8371221544034078032/posts/default/1770743984108719682'/><link rel='alternate' type='text/html' href='http://fun2code-blog.blogspot.com/2010/03/paw-server-for-android-and-ssl.html' title='PAW Server for Android and SSL'/><author><name>Jochen</name><uri>http://www.blogger.com/profile/00094449484000593959</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-I3o9triigGM/Tx0Cu8mQOJI/AAAAAAAAANo/wGb4AH12Mv4/s220/389950-130x140.png'/></author><thr:total>2</thr:total></entry></feed>
