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

<channel>
	<title>inportb &#187; Android</title>
	<atom:link href="http://inportb.com/category/android/feed/" rel="self" type="application/rss+xml" />
	<link>http://inportb.com</link>
	<description>salty nothings are yummier</description>
	<lastBuildDate>Sun, 08 Jan 2012 06:31:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>agcc.bash: Make Native Android C Programs Using the NDK</title>
		<link>http://inportb.com/2012/01/08/agcc-bash-make-native-android-c-programs-using-the-ndk/</link>
		<comments>http://inportb.com/2012/01/08/agcc-bash-make-native-android-c-programs-using-the-ndk/#comments</comments>
		<pubDate>Sun, 08 Jan 2012 06:28:50 +0000</pubDate>
		<dc:creator>Jiang Yio</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Hacks]]></category>

		<guid isPermaLink="false">http://inportb.com/?p=893</guid>
		<description><![CDATA[I return to school at noon, but before then, I&#8217;d like to share my evening project: agcc.bash, a rewrite of agcc and agcc2.pl that works with revisions 6 and 7 of the Android NDK. The NDK is a GCC-based cross-compiler that lets you embed object code in a traditional Android app. It also works as...<a href="http://inportb.com/2012/01/08/agcc-bash-make-native-android-c-programs-using-the-ndk/">&#187;</a>]]></description>
			<content:encoded><![CDATA[<p>I return to school at noon, but before then, I&#8217;d like to share my evening project: <a href="http://dl.dropbox.com/u/1213413/htdocs/agcc/agcc.bash">agcc.bash</a>, a rewrite of <a href="http://plausible.org/andy/agcc">agcc</a> and <a href="http://credentiality2.blogspot.com/2011/07/native-android-c-program-using-ndk.html">agcc2.pl</a> that works with revisions 6 and 7 of the Android NDK.</p>
<p>The NDK is a GCC-based cross-compiler that lets you embed object code in a traditional Android app. It also works as a standalone cross-compiler, though it is not advertised as such. It is quite rough when used by itself, and agcc wraps the complexity in a little script. While agcc and agcc2.pl are written in Perl, agcc.bash is a Bash script. It also supports the latest revisions of the NDK, though r7 is slightly buggy.</p>
<p>With agcc.bash, building native Android software feels almost like working with GCC. As a quick example, let&#8217;s try the classic <a href="http://dl.dropbox.com/u/1213413/htdocs/agcc/hello.c">hello world</a>:</p>
<blockquote><p>AGCC_NDK=~/android-ndk-r6 ./agcc.bash hello.c -o hello</p></blockquote>
<p>That wasn&#8217;t too exciting&#8230; but what happened there? I have the NDK installed at ~/android-ndk-r6 and I told agcc.bash where to look for it, using the AGCC_NDK environment variable. I then invoked agcc.bash as if it were GCC. Let&#8217;s see what agcc.bash did behind the scenes:</p>
<blockquote><p>AGCC_NDK=~/android-ndk-r6 AGCC_ECHO=yes ./agcc.bash hello.c -o hello</p>
<p>=&gt; ./agcc.bash hello.c -o hello<br />
&lt;= /home/jyio/android-ndk-r6/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc -o hello -I/home/jyio/android-ndk-r6/platforms/android-8/arch-arm/usr/include -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -DANDROID -DSK_RELEASE -DNDEBUG -UDEBUG -march=armv5te -mtune=xscale -msoft-float -mthumb-interwork -fpic -fno-exceptions -ffunction-sections -funwind-tables -fmessage-length=0 -march=armv5te -mtune=xscale -msoft-float -mthumb-interwork -fpic -fno-exceptions -ffunction-sections -funwind-tables -fmessage-length=0 hello.c -Bdynamic -Wl,-T,/home/jyio/android-ndk-r6/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.x -Wl,-dynamic-linker,/system/bin/linker -Wl,&#8211;gc-sections -Wl,-z,nocopyreloc -Wl,&#8211;no-undefined -Wl,-rpath-link=/home/jyio/android-ndk-r6/platforms/android-8/arch-arm -L/home/jyio/android-ndk-r6/platforms/android-8/arch-arm/usr/lib -nostdlib /home/jyio/android-ndk-r6/platforms/android-8/arch-arm/usr/lib/crtend_android.o /home/jyio/android-ndk-r6/platforms/android-8/arch-arm/usr/lib/crtbegin_dynamic.o -lc /home/jyio/android-ndk-r6/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.4.3/libgcc.a -lm -ldl</p></blockquote>
<p>See how it transformed our innocent little command into a monster! This might be overkill for a hello world program, but it provides pretty good support for more complex software such as OpenSSL, cURL, and Python. It would be a good idea to add the NDK toolchain and agcc.bash to $PATH before trying to build a big program. In my case, the toolchain resides in <em>~/android-ndk-r6/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin</em>. If you want to build some software that come with configure scripts, you might start with:</p>
<blockquote><p><strong>CC=agcc.bash</strong> ./configure</p></blockquote>
<p>Do try this at home! Relevant links:</p>
<ul>
<li><a href="http://dl.google.com/android/ndk/android-ndk-r6-linux-x86.tar.bz2">Android NDK r6</a> (or, <a href="http://developer.android.com/sdk/ndk/">the latest version</a>)</li>
<li><a href="http://dl.dropbox.com/u/1213413/htdocs/agcc/agcc.bash">agcc.bash</a></li>
<li><a href="http://dl.dropbox.com/u/1213413/htdocs/agcc/hello.c">hello.c</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://inportb.com/2012/01/08/agcc-bash-make-native-android-c-programs-using-the-ndk/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A Survey of Upgrade Options for the HTC Dream; or, Installing Android 2.3 Gingerbread on the T-Mobile G1</title>
		<link>http://inportb.com/2011/02/17/a-survey-of-upgrade-options-for-the-htc-dream-or-installing-android-2-3-gingerbread-on-the-t-mobile-g1/</link>
		<comments>http://inportb.com/2011/02/17/a-survey-of-upgrade-options-for-the-htc-dream-or-installing-android-2-3-gingerbread-on-the-t-mobile-g1/#comments</comments>
		<pubDate>Fri, 18 Feb 2011 04:20:52 +0000</pubDate>
		<dc:creator>Jiang Yio</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://inportb.com/?p=784</guid>
		<description><![CDATA[Some of you might remember this lowly device. Once upon a time, it was the talk of the town. When the mobile carriers stopped issuing updates, CyanogenMod became one of the predominant variant distributions. But now, with official support dropped from the Android Open Source Project, even Cyanogen and his team are having trouble keeping...<a href="http://inportb.com/2011/02/17/a-survey-of-upgrade-options-for-the-htc-dream-or-installing-android-2-3-gingerbread-on-the-t-mobile-g1/">&#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Some of you might remember this lowly device.  Once upon a time, it was the talk of the town. When the mobile carriers  stopped issuing updates, CyanogenMod became one of the predominant  variant distributions. But now, with official support dropped from the  Android Open Source Project, even Cyanogen and his team are having  trouble keeping up. I am, of course, talking about the HTC Dream; this  review will cover a number of ways to keep this device up to date, and  may apply to the HTC Sapphire/Magic as well.</p>
<p><span id="more-784"></span></p>
<h3><a href="http://www.cyanogenmod.com/">CyanogenMod 7</a></h3>
<p>The easiest thing to do is wait for a CyanogenMod ROM. Progress is  delayed because Steve Kondik does not use an HTC Dream anymore and  because of the lack of AOSP support. However, <a href="http://review.cyanogenmod.com/#dashboard,294">Mehdi Abaakouk</a> has inherited Steve’s responsibilities and there will be a CyanogenMod 7 release sometime in the future.</p>
<p>For the impatient among us, other ROMs are floating around that might  satisfy the desire to upgrade. Many of these solutions depend on the  2708/2825 radio and 1.33.0013d SPL for more efficient RAM utilization.</p>
<h3><a href="http://forum.xda-developers.com/showthread.php?t=882356">ezGingerbread</a></h3>
<p>Maintained by ezterry, this near-AOSP source repository supplies  Gingerbread for the Dream/Sapphire. It is primarily a source  distribution with a number of unsupported binary builds.</p>
<h3><a href="http://forum.xda-developers.com/showthread.php?t=927357">EZ FRankenCYAN</a></h3>
<p><strong>Maintainer:</strong> bonesy<br />
<strong>Heritage:</strong> Google, Cyanogen, Firerat, ezterry<br />
<strong>Dependencies:</strong> radio and SPL update, CustomMTD for 94MB system partition</p>
<h3><a href="http://forum.xda-developers.com/showthread.php?t=932118">Ginger yoshi</a></h3>
<p><strong>Maintainer:</strong> yohshua<br />
<strong>Heritage:</strong> bonesy<br />
<strong>Dependencies:</strong> radio and SPL update<br />
<strong>Features:</strong> apps2sdext, Google Experience apps, Zeam Launcher, MIUI Miren Browser, T-Mobile Theme Chooser</p>
<h3><a href="http://forum.xda-developers.com/showthread.php?t=950765">COS-DS</a></h3>
<p><strong>Maintainer:</strong> roalex<br />
<strong>Heritage:</strong> Google, Cyanogen, Firerat, ezterry<br />
<strong>Dependencies:</strong> radio and SPL update<br />
<strong>Features:</strong> apps2sdext, Google Experience apps,  ADWLauncher, T-Mobile Theme Chooser, Titanium Backup, Gallery 2D and 3D,  ROM Manager, Google Maps 5 (vector maps, SD cache), S2E (simple2ext by  OlegKrikun)</p>
<p>I am currently using <strong>Ginger yoshi</strong>, which performs  quite well. Please share your experiences with running Android 2.3 on  your HTC Dream/Sapphire. Also comment if anything is missing or  inaccurate. Is it time for a hardware upgrade yet?</p>
]]></content:encoded>
			<wfw:commentRss>http://inportb.com/2011/02/17/a-survey-of-upgrade-options-for-the-htc-dream-or-installing-android-2-3-gingerbread-on-the-t-mobile-g1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Package Management with Opkg</title>
		<link>http://inportb.com/2010/10/19/package-management-with-opkg/</link>
		<comments>http://inportb.com/2010/10/19/package-management-with-opkg/#comments</comments>
		<pubDate>Tue, 19 Oct 2010 15:57:58 +0000</pubDate>
		<dc:creator>Jiang Yio</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Hacks]]></category>

		<guid isPermaLink="false">http://inportb.com/?p=751</guid>
		<description><![CDATA[Opkg is not limited to using packages from files; it is also capable of using apt-get style repositories, vastly simplifying the job of fetching dependencies and updating packages. I already have a repository set up, and it could be added as such echo "src/gz inportb-android-froyo http://repo.inportb.com/android/froyo" &#62; /cache/etc/opkg/inportb.conf After doing that, we could refresh the...<a href="http://inportb.com/2010/10/19/package-management-with-opkg/">&#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Opkg is not limited to using packages from files; it is also capable of using apt-get style repositories, vastly simplifying the job of fetching dependencies and updating packages. I already have a repository set up, and it could be added as such</p>
<blockquote><p><code>echo "src/gz inportb-android-froyo http://repo.inportb.com/android/froyo" &gt; /cache/etc/opkg/inportb.conf</code></p></blockquote>
<p>After doing that, we could refresh the package list</p>
<blockquote><p><code>opkg update</code></p></blockquote>
<p>Installing a package then becomes as easy as</p>
<blockquote><p><code>opkg install name-of-package</code></p></blockquote>
<p>And we could keep all our packages up-to-date using</p>
<blockquote><p><code>opkg update; opkg upgrade</code></p></blockquote>
<p>It&#8217;s also quite simple to set up a repository for distributing packages.</p>
<p><span id="more-751"></span>First, we fetch the latest <em>opkg-utils</em> off SVN at &lt;<a href="http://svn.openmoko.org/trunk/src/host/opkg-utils/">http://svn.openmoko.org/trunk/src/host/opkg-utils/</a>&gt; and <em>make</em> it. Then, we designate a directory (the repository) to dump all our packages in. Finally, every time we update the repository, we generate a new package feed</p>
<blockquote><p><code>cd path/to/repository; opkg-make-index . &gt; Packages</code></p></blockquote>
<p>Now all we have to do is make sure the directory is visible on the Web, and share its URL. The end user would add a line to a file within <em>/cache/etc/opkg</em></p>
<blockquote><p><code>src name-of-repository http://host/path/to/repository</code></p></blockquote>
<p>We could also gzip the feed to reduce bandwidth usage</p>
<blockquote><p><code>gzip -c9 Packages &gt; Packages.gz</code></p></blockquote>
<p>The repository line would be changed accordingly to</p>
<blockquote><p><code>src/gz name-of-repository http://host/path/to/repository</code></p></blockquote>
<p>We could have multiple files in <em>/cache/etc/opkg</em>, and each one of those could have multiple lines. The idea is that each vendor could have multiple repositories, and keep them in the same file for ease of management.</p>
<p>&lt;ShamelessAdvertisement&gt; Incidentally, it is almost trivial for Dropbox users to set up a repository. If you need 2.25GB of premium Web-accessible storage to host your repository or anything else for free, simply <a href="http://www.dropbox.com/referrals/NTEyMTM0MTM5">sign up through my referral link</a>. You could also <a href="http://www.dropbox.com/">skip the referral</a> and get 2GB.&lt;/ShamelessAdvertisement&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://inportb.com/2010/10/19/package-management-with-opkg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making an Opkg Package</title>
		<link>http://inportb.com/2010/10/19/making-an-opkg-package/</link>
		<comments>http://inportb.com/2010/10/19/making-an-opkg-package/#comments</comments>
		<pubDate>Tue, 19 Oct 2010 15:30:29 +0000</pubDate>
		<dc:creator>Jiang Yio</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Hacks]]></category>

		<guid isPermaLink="false">http://inportb.com/?p=744</guid>
		<description><![CDATA[Now that we have Opkg for Android, we could use it to install packages from local files or off Web servers. Installing a package is as simple as opkg install path/to/package.opk or, if it&#8217;s on the Web opkg install http://host/path/to/package.opk And to remove the package, we would go opkg remove name-of-package But what if we...<a href="http://inportb.com/2010/10/19/making-an-opkg-package/">&#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Now that we have Opkg for Android, we could use it to install packages from local files or off Web servers. Installing a package is as simple as</p>
<blockquote><p><code>opkg install path/to/package.opk</code></p></blockquote>
<p>or, if it&#8217;s on the Web</p>
<blockquote><p><code>opkg install http://host/path/to/package.opk</code></p></blockquote>
<p>And to remove the package, we would go</p>
<blockquote><p><code>opkg remove name-of-package</code></p></blockquote>
<p>But what if we wanted to share our own software with others? In this case, we would create our own packages. An Opkg package is essentially a Debian package with fewer control fields. If you know how to make a Debian package, you should be well on your way. In general, a package is an <em>ar</em> archive containing a control tarball, a data tarball, and a debian-binary file. For example let&#8217;s have a look at the opkg-hello package:</p>
<p><span id="more-744"></span><br />
<blockquote><code>package.opk	(ar)<br />
+- debian-binary	(text)<br />
+- control.tar.gz	(tarball)<br />
...+- control	(text)<br />
...+- preinst	(script)<br />
...+- postinst	(script)<br />
...+- prerm		(script)<br />
...+- postrm	(script)<br />
+- data.tar.gz	(tarball)<br />
...+- system<br />
......+- bin<br />
.........+- opkg-hello	(example program)</code></p></blockquote>
<p>Now, <em>debian-binary</em> simply contains the string <em>2.0</em>; it signifies that the archive is indeed a Debian[esque] package. The files within <em>control.tar.gz</em> are cached when the package is installed, and contain information about the package itself, how the package is to be installed, and how the package is to be removed. The contents of <em>control</em> describe the package and are used to build the repository feed, which we will cover later. There are also scripts that govern the installation and removal processes and require execution permission: <em>preinst</em> runs before the package is extracted, <em>postinst</em> performs any configuration after the main files are in place, <em>prerm</em> prepares the system before the package is removed, and <em>postrm</em> cleans up after the main files are gone. Let&#8217;s have a look inside these files:</p>
<blockquote><p><em>control</em><br />
<code>Package: opkg-hello<br />
Version: 0.0.1<br />
Description: Sample OPKG package<br />
Section: cyanogenmod/applications<br />
Priority: optional<br />
Maintainer: Jiang Yio<br />
Architecture: all<br />
Homepage: http://inportb.com/<br />
Source:<br />
Depends:</code></p></blockquote>
<blockquote><p><em>preinst</em><br />
<code>#!/system/bin/sh<br />
echo "preinst: preparing to install package"<br />
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system</code></p></blockquote>
<blockquote><p><em>postinst</em><br />
<code>#!/system/bin/sh<br />
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system<br />
echo "postinst: installed package"</code></p></blockquote>
<blockquote><p><em>prerm</em><br />
<code>#!/system/bin/sh<br />
echo "prerm: preparing to remove package"<br />
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system</code></p></blockquote>
<blockquote><p><em>postrm</em><br />
<code>#!/system/bin/sh<br />
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system<br />
echo "postrm: removed package"</code></p></blockquote>
<p>Other than emitting some debugging information, the scripts also make the <em>/system</em> tree writable while the package is installed or removed.</p>
<p>Now that we have the anatomy of an Opkg package, we could create more like it with ease. Here are a couple of helpful commands:</p>
<blockquote><p><em>make a tarball</em><br />
<code>tar zcvf name-of-tarball.tar.gz list of files and directories</code></p></blockquote>
<blockquote><p><em>make an archive</em><br />
<code>ar -r name-of-archive.opk list of files and directories</code></p></blockquote>
<p>Other than that, just be sure all the files have the right owner, group, and permission. It would also help to know something about the Android directory tree &#8212; for example, we dropped the example program in <em>/system/bin</em>, which we know is part of the search path.</p>
]]></content:encoded>
			<wfw:commentRss>http://inportb.com/2010/10/19/making-an-opkg-package/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Debian Packages on Android Phones</title>
		<link>http://inportb.com/2010/10/17/debian-packages-on-android-phones/</link>
		<comments>http://inportb.com/2010/10/17/debian-packages-on-android-phones/#comments</comments>
		<pubDate>Mon, 18 Oct 2010 00:26:21 +0000</pubDate>
		<dc:creator>Jiang Yio</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Hacks]]></category>

		<guid isPermaLink="false">http://inportb.com/?p=737</guid>
		<description><![CDATA[Well, almost. While one could theoretically install Debian packages on Android phones, it is generally a bad idea to install software designed for one system onto a different system. However, the Debian package manager is excellent for keeping track of software, and it would be nice if it could be used on Android as well....<a href="http://inportb.com/2010/10/17/debian-packages-on-android-phones/">&#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Well, almost. While one could theoretically install Debian packages on Android phones, it is generally a bad idea to install software designed for one system onto a different system. However, the Debian package manager is excellent for keeping track of software, and it would be nice if it could be used on Android as well. iPhone users already have access to this mechanism in the form of Cydia, so why not put it on Android too?</p>
<p><strong><span id="more-737"></span>For user applications, we already have APK&#8217;s.</strong></p>
<p>These are self-contained blocks that may be easily installed and removed. The APK system is great for running untrusted software that needs to be sandboxed, but it is not flexible or efficient enough to manage the operating system itself. Android users typically do not update their systems very often, and when they do so, they update the whole setup at once. This presents two problems: firstly, users don&#8217;t receive updated software as it becomes available and secondly, each update is a resource-intensive and time-consuming task. It would be great if system software could be updated piecemeal, just like a <em>real</em> Linux setup.</p>
<p>The Debian packaging system solves this problem very well, but its size makes it unsuitable for mobile devices. Nevermind that Cydia users use Debian packages &#8212; it&#8217;s still good to be frugal. Since we&#8217;re not going to install Debian software onto our phones (which would probably break many things), we don&#8217;t have to stick strictly to the Debian format; on the other hand, Debian provides a very nice model for us to emulate.</p>
<p><strong>Enter Opkg.</strong></p>
<p>Here is a package manager and format that very closely resemble the Debian package manager and format. In fact, <a href="http://code.google.com/p/opkg/">Opkg</a> is capable of working with Debian packages. The difference is that it&#8217;s tiny and it&#8217;s designed for mobile devices.</p>
<p>For starters, I have compiled a statically-linked build of Opkg. It is able to install local (and http-hosted) packages as dpkg does. It can also maintain a list of software sources <em>a la</em> apt-get. Its small size (745KB) makes it easily-integrable into almost any Android system.</p>
<p>If you&#8217;re feeling adventurous and would like to try this on your rooted Android phone, the files are currently hosted <a href="http://dl.dropbox.com/u/1213413/android-opkg/index.htm">on my Dropbox account</a>. You do need root access, so if you use a cooked ROM such as CyanogenMod, you should be good to go. Please keep in mind that there is only one package at the moment (the example), but it&#8217;s not difficult to make more.</p>
]]></content:encoded>
			<wfw:commentRss>http://inportb.com/2010/10/17/debian-packages-on-android-phones/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Standards-Compliant Browsers Are Awesome</title>
		<link>http://inportb.com/2009/08/24/standards-compliant-browsers-are-awesome/</link>
		<comments>http://inportb.com/2009/08/24/standards-compliant-browsers-are-awesome/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 00:39:22 +0000</pubDate>
		<dc:creator>Jiang Yio</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Computing]]></category>

		<guid isPermaLink="false">http://inportb.com/?p=405</guid>
		<description><![CDATA[Recently, I rewrote from scratch a two-year-old project of mine. Imagine, a browser-based image editor, had been sitting around collecting dust, so I figured I&#8217;d delete all the legacy code (almost all of it) and create something better. I&#8217;ve also been evaluating the possibility of integrating Imagine into Google Wave. For giggles, I decided to...<a href="http://inportb.com/2009/08/24/standards-compliant-browsers-are-awesome/">&#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Recently, I rewrote from scratch a two-year-old project of mine. <a href="http://inportb.com/imagine/">Imagine</a>, a browser-based image editor, had been sitting around collecting dust, so I figured I&#8217;d delete all the legacy code (almost all of it) and create something better. I&#8217;ve also been evaluating the possibility of integrating Imagine into <a href="http://wave.google.com/">Google Wave</a>.</p>
<p><span id="more-405"></span>For giggles, I decided to try viewing this page on my G1. I knew that the Android browser was pretty powerful, but I had no idea that it would handle such a complex application so well without modification&#8230;</p>

<p>So far, everything seems to be working fine with the exception of drag and drop events (I attribute this to the differences between the mouse and touch mechanisms). This is why standards are important, and why I continue to write compliant code.</p>
]]></content:encoded>
			<wfw:commentRss>http://inportb.com/2009/08/24/standards-compliant-browsers-are-awesome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Filesystem Snapshots on Android</title>
		<link>http://inportb.com/2009/05/08/filesystem-snapshots-on-android/</link>
		<comments>http://inportb.com/2009/05/08/filesystem-snapshots-on-android/#comments</comments>
		<pubDate>Sat, 09 May 2009 02:46:50 +0000</pubDate>
		<dc:creator>Jiang Yio</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://inportb.com/?p=375</guid>
		<description><![CDATA[A recent trick floating around the xda-developers forums involves using UnionFS to layer the microSD storage on top of the existing data partition, effectively allowing the microSD storage to be used for data. This technique originated from MarcusMaximus04 and has made its way into the firmware builds of TheDudeOfLife and JesusFreke. While most users were...<a href="http://inportb.com/2009/05/08/filesystem-snapshots-on-android/">&#187;</a>]]></description>
			<content:encoded><![CDATA[<p>A recent trick floating around the <a href="http://forum.xda-developers.com/">xda-developers</a> forums involves using <a href="http://www.google.com/url?sa=t&amp;source=web&amp;ct=res&amp;cd=2&amp;url=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FUnionFS&amp;ei=eewESsvBD5GEtweAp42eBw&amp;rct=j&amp;q=unionfs&amp;usg=AFQjCNHfXyxvayzcM0jt1O1bjY3mb6ofqw">UnionFS</a> to layer the microSD storage on top of the existing data partition, effectively allowing the microSD storage to be used for data. This technique originated from <a href="http://forum.xda-developers.com/member.php?u=510170">MarcusMaximus04</a> and has made its way into the firmware builds of <a href="http://forum.xda-developers.com/member.php?u=1094929">TheDudeOfLife</a> and <a href="http://forum.xda-developers.com/member.php?u=1299419">JesusFreke</a>.</p>
<p>While most users were playing around with the easy &#8220;apps2SD&#8221; feature, I decided to explore a different aspect of UnionFS &#8212; stackable snapshots. The goal was to be able to make snapshots of the filesystem that could be rolled back at any time, undoing any changes. While this may sound like server-oriented technology, it could be useful on a mobile platform that is collecting a sizable hacker community.</p>
<p><span id="more-375"></span>Here&#8217;s how I did it. I started with <a href="http://forum.xda-developers.com/showthread.php?t=507151">TheDudeOfLife&#8217;s latest build</a>, which includes the new apps2SD trick from MarcusMaximus04. My microSD card has three partitions &#8212; the first is the usual FAT32 volume for documents, the second is an EXT2 volume for apps2SD, and the third is an additional EXT2 volume that I&#8217;m using to store my snapshots. If you follow the commands, you would see that I effectively bypass apps2SD for this experiment; but it is possible to use this method with apps2SD. <strong>Warning:</strong> the blogging software pretty-prints the quotation marks; be sure to make them regular double-quotes before copy+pasting.</p>
<h3>1. Prepare a Mount Point</h3>
<p>To mount the second EXT2 partition, we&#8217;ll need yet another mount point. Using ADB, remount the system partition in read-write mode:</p>
<blockquote><p>adb remount</p></blockquote>
<p>Next, get a shell session on the phone (through the terminal app or ADB) and type:</p>
<blockquote><p>mkdir /system/sd2</p></blockquote>
<h3>2. Prepare the Snapshot Directories</h3>
<p>We&#8217;ll be making three snapshots in this experiment, so let&#8217;s mount the second EXT2 partition and create some directories:</p>
<blockquote><p>mount -t ext2 /dev/block/mmcblk0p3 /system/sd2<br />
mkdir /system/sd2/snapshot0 /system/sd2/snapshot1 /system/sd2/snapshot2</p></blockquote>
<h3>3. Create a Snapshot</h3>
<p>To create a snapshot, we overlay one of the snapshot directories over the existing data mount. But first, we must undo the original apps2SD overlay or this would not work:</p>
<blockquote><p>mount -t yaffs2 -o rw,nosuid,nodev /dev/block/mtdblock5 /data<br />
mount -t unionfs -o dirs=&#8221;/system/sd2/snapshot0=rw:/data=ro&#8221; none /data</p></blockquote>
<p>As a test, let&#8217;s create a file:</p>
<blockquote><p>touch /data/test0</p></blockquote>
<h3>4. Repeat</h3>
<p>Now let&#8217;s create another snapshot and a new file:</p>
<blockquote><p>mount -t yaffs2 -o rw,nosuid,nodev /dev/block/mtdblock5 /data<br />
mount -t unionfs -o dirs=&#8221;/system/sd2/snapshot1=rw:/system/sd2/snapshot0=ro:/data=ro&#8221; none /data<br />
touch /data/test1</p></blockquote>
<h3>5. Repeat</h3>
<p>&#8230; and again:</p>
<blockquote><p>mount -t yaffs2 -o rw,nosuid,nodev /dev/block/mtdblock5 /data<br />
mount -t unionfs -o dirs=&#8221;/system/sd2/snapshot2=rw:/system/sd2/snapshot1=ro:/system/sd2/snapshot0=ro:/data=ro&#8221; none /data<br />
touch /data/test2</p></blockquote>
<h3>6. Did it Work?</h3>
<p>Let&#8217;s see. We have created three files, and we could check by listing them:</p>
<blockquote><p>ls /data/test*</p>
<blockquote><p>/data/test0<br />
/data/test1<br />
/data/test2</p></blockquote>
</blockquote>
<p>We could delete a file that we created in an earlier snapshot:</p>
<blockquote><p>rm /data/test0<br />
ls /data/test*</p>
<blockquote><p>/data/test1<br />
/data/test2</p></blockquote>
</blockquote>
<p>But when we switch to an earlier snapshot&#8230; not only was the most recently created file gone, but the deleted file came back:</p>
<blockquote><p>mount -t yaffs2 -o rw,nosuid,nodev /dev/block/mtdblock5 /data<br />
mount -t unionfs -o dirs=&#8221;/system/sd2/snapshot1=rw:/system/sd2/snapshot0=ro:/data=ro&#8221; none /data<br />
ls /data/test*</p>
<blockquote><p>/data/test0<br />
/data/test1</p></blockquote>
</blockquote>
<p>As you can see, the last file we created just vanished. Now let&#8217;s roll back to the first snapshot:</p>
<blockquote><p>mount -t yaffs2 -o rw,nosuid,nodev /dev/block/mtdblock5 /data<br />
mount -t unionfs -o dirs=&#8221;/system/sd2/snapshot0=rw:/data=ro&#8221; none /data<br />
ls /data/test*</p>
<blockquote><p>/data/test0</p></blockquote>
</blockquote>
<p>There is just one test file now. And finally, let&#8217;s see what happens when we restore to the original mount:</p>
<blockquote><p>mount -t yaffs2 -o rw,nosuid,nodev /dev/block/mtdblock5 /data<br />
ls /data/test*</p></blockquote>
<p>&#8230; the test files are all gone. But where have they gone? Why, they&#8217;re all on the snapshot partition, of course:</p>
<blockquote><p>ls /system/sd2/snapshot*/</p>
<blockquote><p>test0<br />
test1<br />
test2</p></blockquote>
</blockquote>
<h3>7. Getting apps2SD Back</h3>
<p>If you&#8217;re missing your apps2SD by now, you could do the following to get it back:</p>
<blockquote><p>mount -t unionfs -o dirs=/system/sd:/data none /data</p></blockquote>
<p>Or you could just reboot.</p>
<h3>So&#8230;</h3>
<p>Snapshots do work, though the procedure is a bit cumbersome. However, it should be trivial to write up a shell script to automate most of this. There are a couple of things that remain to be tested, however:</p>
<ol>
<li><strong>Performance:</strong> UnionFS is supposed to be very efficient, but I have not done any actual performance testing.</li>
<li><strong>Efficiency:</strong> We created many overlay mounts back there while experimenting; I need to do some more reading to determine any impact this may have on efficiency.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://inportb.com/2009/05/08/filesystem-snapshots-on-android/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Using Cupcake Without A Data Plan</title>
		<link>http://inportb.com/2009/04/26/using-cupcake-without-a-data-plan/</link>
		<comments>http://inportb.com/2009/04/26/using-cupcake-without-a-data-plan/#comments</comments>
		<pubDate>Sun, 26 Apr 2009 16:42:27 +0000</pubDate>
		<dc:creator>Jiang Yio</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://inportb.com/?p=357</guid>
		<description><![CDATA[Really, there is no need for this post&#8230; because Cupcake (an updated version of Android found on the HTC Magic and ported over to the G1) is quite friendly to users without data service. The ability to skip activation allows the user to delay activation until the WiFi connection can be initialized. And since rooting...<a href="http://inportb.com/2009/04/26/using-cupcake-without-a-data-plan/">&#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Really, there is no need for this post&#8230; because Cupcake (an updated version of Android found on the HTC Magic and ported over to the G1) is quite friendly to users without data service. The ability to skip activation allows the user to delay activation until the WiFi connection can be initialized. And since rooting is required, the modified recovery image and engineering SPL makes backup-and-restore trivial.</p>
<h3><span id="more-357"></span>What are the options?</h3>
<p>As of now, there are three major builds containing this Android version. Haykuro maintains two series, the &#8216;G&#8217; builds sourced from Google and the &#8216;H&#8217; builds sourced from HTC for the Chunghwa phone. TheDudeOfLife maintains an analogous &#8216;G&#8217; series. So far, there is no way to say which series is universally &#8220;better,&#8221; since each has its perks and quirks. So I would recommend trying them all if the time is available, since formatting is necessary anyway.</p>
<h3>Where to get this Cupcake stuff?</h3>
<p>Both Haykuro and TheDudeOfLife use Google Code to keep track of their progress:</p>
<ul>
<li><a href="http://code.google.com/p/sapphire-port-dream/">Haykuro&#8217;s builds</a></li>
<li><a href="http://code.google.com/p/thedudescupcake/">TheDudeOfLife&#8217;s builds</a></li>
</ul>
<p>They also post regularly at the <a href="http://www.xda-developers.com/">xda-developers</a> forum.</p>
<h3>How to apply the update?</h3>
<p>Haykuro has a <a href="http://code.google.com/p/sapphire-port-dream/wiki/PageName">nice guide</a> written up. I found it quite helpful, but here&#8217;s some of my own <a href="/2009/04/11/upgrading-to-haykuro/">commentary</a>. Keep in mind that root access (specifically, the modified recovery image) is required. Haykuro&#8217;s guide covers that too, I believe.</p>
<h3>What&#8217;s next?</h3>
<p>For the adventurous (who isn&#8217;t who has performed this update?), funbacon has posted several <a href="http://forum.xda-developers.com/showthread.php?t=507244">enhancements</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://inportb.com/2009/04/26/using-cupcake-without-a-data-plan/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Upgrading to Haykuro</title>
		<link>http://inportb.com/2009/04/11/upgrading-to-haykuro/</link>
		<comments>http://inportb.com/2009/04/11/upgrading-to-haykuro/#comments</comments>
		<pubDate>Sun, 12 Apr 2009 03:15:40 +0000</pubDate>
		<dc:creator>Jiang Yio</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://inportb.com/?p=327</guid>
		<description><![CDATA[Haykuro has recently released a series of Android builds. This is the software for the HTC Magic, ported to the G1. Since I have not had time to fully explore this new operating system, I&#8217;ll just list some of the most obvious changes: activation not required! (can set up account later) new theme new camera...<a href="http://inportb.com/2009/04/11/upgrading-to-haykuro/">&#187;</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://haykuro.theiphoneproject.org/">Haykuro</a> has recently released a series of <a href="http://code.google.com/p/sapphire-port-dream/">Android builds</a>. This is the software for the HTC Magic, ported to the G1. Since I have not had time to fully explore this new operating system, I&#8217;ll just list some of the most obvious changes:</p>
<ul>
<li><strong>activation not required!</strong> (can set up account later)</li>
<li>new theme</li>
<li>new camera options, such as video recording</li>
<li>lock-screen background</li>
<li>3G notification icon says H</li>
<li>smooth transitions by default</li>
<li>automatic screen orientation flipping</li>
<li>no more voice search in search widget</li>
<li>on-screen keyboard</li>
<li>&#8230; among other things &#8230;</li>
</ul>
<p>Now, it is actually pretty simple to get this software. There&#8217;s even a <a href="http://code.google.com/p/sapphire-port-dream/wiki/PageName">nice guide</a> for this, which was pretty straightforward for me to follow. Nevertheless, since I had not rooted my phone and I have no data plan, I had a couple of extra steps.</p>
<h3><span id="more-327"></span>0. Pre-requisites</h3>
<p>It is necessary to format the microSD card as a FAT32 super-floppy. This means that there is no partition table and that there is a single FAT32 partition that spans the entire disk. Windows by default formats removable storage as super-floppies. In addition, it is necessary to get ADB working. These are out of the scope of this guide, but do ask in the comments if you&#8217;re having trouble.</p>
<p><strong>Backup your data! This procedure will erase everything.</strong></p>
<p>Before starting, please open up the Haykuro guide; what I write here only supplements the original information.</p>
<h3>1. Downgrade to RC29 using DREAIMG.nbh</h3>
<p>This was easy enough, but left me with a non-activated phone. To activate, I used <a href="http://forum.xda-developers.com/showthread.php?t=452316">JesusFreke&#8217;s trick</a>. Since I had RC29, I entered <em>setprop app.setupwizard.disable 1</em> on the keyboard to enable debugging, and raised the Settings manager by entering <em>am start -a android.intent.action.MAIN -n com.android.settings/.Settings</em> through the ADB shell.</p>
<h3>2. Perform a nandroid backup</h3>
<p>This is optional, but I did it anyway just to be safe.</p>
<h3>3. Flash the new ROM</h3>
<p>I downloaded the Chinese <em>5.0.1H_zh_signed.zip</em> because the English version was not available. I didn&#8217;t mind because I know Chinese, but it was pretty easy to switch to English in the settings. For the record, the English-default version is now available for download.</p>
<p>Edit: I take that back; the English version just does not have Chinese fonts; it still needs to be switched to English. Therefore, I&#8217;d recommend getting the Chinese version.</p>
<h3>3b. Switch to English</h3>
<p>Now if you want to switch to English, start from the home screen and:</p>
<ol>
<li>Push Menu</li>
<li>Touch the lower-right item (Settings)</li>
<li>Touch the next-to-last item (Locale &amp; text)</li>
<li>Touch the first item (Select locale)</li>
<li>Select the first item (English)</li>
<li>Reboot for full effect</li>
</ol>
<h3>4. Upgrade the radio firmware</h3>
<p>I did this because it was recommended, but I didn&#8217;t have any issues without it.</p>
]]></content:encoded>
			<wfw:commentRss>http://inportb.com/2009/04/11/upgrading-to-haykuro/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The Market Cache</title>
		<link>http://inportb.com/2009/01/25/the-market-cache/</link>
		<comments>http://inportb.com/2009/01/25/the-market-cache/#comments</comments>
		<pubDate>Sun, 25 Jan 2009 14:25:57 +0000</pubDate>
		<dc:creator>Jiang Yio</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://inportb.com/?p=281</guid>
		<description><![CDATA[The Market cache has been a source of grievance for many Android/G1 users. Applications under Android store data in caches that are cleaned up when memory is running low. The G1 has an unimpressive amount of onboard memory, and the Market browser has a cache that cannot be manually cleared. This has lead to many...<a href="http://inportb.com/2009/01/25/the-market-cache/">&#187;</a>]]></description>
			<content:encoded><![CDATA[<p>The Market cache has been a <a href="http://androidcommunity.com/forums/f12/growing-android-market-5924/">source</a> <a href="http://androidcommunity.com/forums/f23/market-storage-growing-every-day-6845/">of</a> <a href="http://androidcommunity.com/forums/f12/clearing-market-cache-9461/">grievance</a> <a href="http://androidforums.com/showthread.php?t=2141">for</a> <a href="http://www.google.com/support/forum/p/Android+Market/thread?tid=41ec2c22c8cf5448">many</a> Android/G1 users. Applications under Android store data in caches that are cleaned up when memory is running low. The G1 has an unimpressive amount of onboard memory, and the Market browser has a cache that cannot be manually cleared. This has lead to many individuals performing factory data resets on their phones just to reclaim the sequestered memory.</p>
<p>The factory data reset is not the best approach. In fact, I would say that the best approach is to do nothing at all about the problem. By virtue of Android&#8217;s memory manager, caches are cleared automatically when memory is needed. For example, if the foreground task needs to do something memory-intensive and there are some background tasks and caches, some of the tasks could be killed or caches could be cleared to make room. So&#8230; the problem solves itself.</p>
<p>One does not need to manually reclaim the memory, but what&#8217;s wrong with doing it anyway? I mean, it does get rid of the low-memory warnings that are so distressing to some. However, the biggest problem with clearing caches is the act itself. Caches perform the useful function of storing objects so that they need not be computed or fetched again, saving processor, networking, and power resources. One can even say that memory exists mainly for the purpose of caching. Therefore, it would be optimal to fill the memory as much as possible with cache. The system that Google set up is almost perfect &#8212; it allows the memory to fill with cached data, clearing bits at a time only when needed for a foreground task.</p>
<p>But why isn&#8217;t it perfect? Well, I had mentioned the low-memory warnings earlier. When the average user sees one of these, he/she thinks that the phone is about to explode. It&#8217;s not; rather, it&#8217;s a sign that the memory manager is doing its job. The psychological aspect of the problem can be resolved by either removing this warning or making it appear more benign, reserving the real warning for when the memory is <em>really</em> running out.</p>
<p>In the interim, I&#8217;m going to hang onto my caches and encourage you to do the same. There is no harm in taking the need-based memory management approach. Remember, unused memory is wasted memory.</p>
]]></content:encoded>
			<wfw:commentRss>http://inportb.com/2009/01/25/the-market-cache/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

