<?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>ukstokes.com &#187; Android</title>
	<atom:link href="http://ukstokes.com/blog/category/android/feed/" rel="self" type="application/rss+xml" />
	<link>http://ukstokes.com/blog</link>
	<description>tech stuff from a tech bloke</description>
	<lastBuildDate>Tue, 31 Aug 2010 15:03:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Compile your own droid &#8211; Part 1a</title>
		<link>http://ukstokes.com/blog/2010/01/15/compile-your-own-droid-part-1a/</link>
		<comments>http://ukstokes.com/blog/2010/01/15/compile-your-own-droid-part-1a/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 21:48:42 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://ukstokes.com/blog/?p=570</guid>
		<description><![CDATA[Here's a confession. My inner geek woke me up the next morning at 3:00 wondering whether my android build had completed. In the end sanity took hold again, and I went back to sleep. Quite lucky really as when I checked in the morning, the java compiler had crashed with a meaningless error. An exception [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-565" title="android-logo" src="http://ukstokes.com/blog/wp-content/uploads/2010/01/android-logo.jpg" alt="android-logo" width="72" height="80" />Here's a confession. My inner geek woke me up the next morning at 3:00 wondering whether my android build had completed. In the end sanity took hold again, and I went back to sleep. Quite lucky really as when I checked in the morning, the java compiler had crashed with a meaningless error.</p>
<pre class="brush: bash;">An exception has occurred in the compiler (1.5.0). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.

java.lang.AssertionError: writePool E

at com.sun.tools.javac.jvm.ClassWriter.writePool(ClassWriter.java:513)
at com.sun.tools.javac.jvm.ClassWriter.writeClassFile(ClassWriter.java:1333)
at com.sun.tools.javac.jvm.ClassWriter.writeClass(ClassWriter.java:1211)
at com.sun.tools.javac.main.JavaCompiler.genCode(JavaCompiler.java:325)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:474)
at com.sun.tools.javac.main.Main.compile(Main.java:592)
at com.sun.tools.javac.main.Main.compile(Main.java:544)
at com.sun.tools.javac.Main.compile(Main.java:58)
at com.sun.tools.javac.Main.main(Main.java:48)
make: *** [out/target/common/obj/APPS/VpnServices_intermediates/classes-full-debug.jar] Error 41
make: *** Waiting for unfinished jobs....</pre>
<p>After trying the most recent update of Java 1.5 I made a cry for help in the XDA forums. The answer seemed simple enough, try JDK1.6. I installed it and modified /home/ben/mydroid/build/core/main.mk, commenting out the lines that checked for Java 1.5. Then after a "make clean", and another "make -j2" (-j4 made my laptop burn up ...) it was building again, and this time finished!</p>
<p>I make a nandroid backup and wiped to factory settings (using Amon_RA's recovery image) flashed the resulting boot.img and system.img to my phone using fastboot:</p>
<pre class="brush: bash;">fastboot flash boot boot.img
fastboot flash system system.img
fastboot reboot</pre>
<p>Rebooted my device, and it worked! A very basic system though, no Market or Google Apps.</p>
<p>Next steps ... getting root, creating an update.zip, making my own kernel with compcache ... the list is actually endless, it's nice just to get this far.</p>
<p>In fact next step could be building from Cyanogen's Eclair sources. Will give it a go and post if it works...</p>
]]></content:encoded>
			<wfw:commentRss>http://ukstokes.com/blog/2010/01/15/compile-your-own-droid-part-1a/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Compile your own droid (for HTC Sapphire) &#8211; Part 1</title>
		<link>http://ukstokes.com/blog/2010/01/13/compile-your-own-droid-for-htc-sapphire-part-1/</link>
		<comments>http://ukstokes.com/blog/2010/01/13/compile-your-own-droid-for-htc-sapphire-part-1/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 23:07:37 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://ukstokes.com/blog/?p=555</guid>
		<description><![CDATA[I thought I'd have a go at building Android 2.0.1 from source for the HTC Magic (AKA MyTouch 3G and HTC Sapphire). Mine is the 32B board from UK Vodafone - Google branded. Current most recent firmware from HTC for the device is Android 1.6, although Android 2.0.1 source code is available from Google. Android [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-565" title="android-logo" src="http://ukstokes.com/blog/wp-content/uploads/2010/01/android-logo.jpg" alt="android-logo" width="72" height="80" />I thought I'd have a go at building Android 2.0.1 from source for the HTC Magic (AKA MyTouch 3G and HTC Sapphire). Mine is the 32B board from UK Vodafone - Google branded. Current most recent firmware from HTC for the device is Android 1.6, although Android 2.0.1 source code is available from Google. Android 2.0 roms are already available from xda-developers.com, but I wanted to see how hard it was to do it myself. Also if I'm successful this will be a place where all information will be in one place.</p>
<p>This is not rocket science by the way - this is my experience in following the guides from Google and HTC on Ubuntu 9.10. All of this information is already out there, just not necessarily all in one place in this format or adapted for this environment.</p>
<p>Building on Windows is not supported. I'm using Ubuntu 9.10 (32bit) on my laptop. Java JDK 1.5 is required, using 1.6 is supported but you have to make additional steps changing instances of "1.5" to "1.6" in makefiles. 64bit Ubuntu users may want to follow a different guide, not sure if any differences here could cause a build to fail.</p>
<p><strong>Setting up your environment ready for development</strong>, install the following packages (<a href="http://source.android.com/download">reference</a>):</p>
<pre class="brush: bash;">sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zipcurl libncurses5-dev zlib1g-dev valgrind</pre>
<p>In Ubuntu 9.10 you can't get Java 1.5 using apt any more. I downloaded it from java.com and installed it in /usr/local/java/jdk1.5.0. Then:</p>
<pre class="brush: bash;">ln -s /usr/local/java/jdk1.5.0/bin/java /usr/local/bin/java</pre>
<p>If you try "java -version" it should tell you "Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)". Finally, edit your ~/.bashrc using vim and add the following to the end of the file:</p>
<pre class="brush: bash;">export JAVA_HOME=/usr/local/java/jdk1.5.0/
export ANDROID_JAVA_HOME=$JAVA_HOME
export PATH=$PATH:/home/ben/bin:$JAVA_HOME/bin</pre>
<p>Reload your .bashrc file using ". ~./bashrc".</p>
<p><strong>Setting up repo</strong> - a Google tool to manage your Android source code repository:</p>
<pre class="brush: bash;">cd ~
mkdir bin
curl http://android.git.kernel.org/repo &gt;~/bin/repo
chmod a+x ~/bin/repo
mkdir mydroid
cd mydroid
repo init -u git://android.git.kernel.org/platform/manifest.git -b eclair</pre>
<p>Answer the questions where prompted and then fetch the source code using:</p>
<pre class="brush: bash;">repo sync</pre>
<p>This bit takes a while ... when finished:</p>
<pre class="brush: bash;">gpg --import</pre>
<p>Paste in the GPG key at the bottom of <a href="http://source.android.com/download">this page</a> and then press ctrl+D. Now we need the HTC binaries and kernel source to build specifically for the Sapphire.</p>
<pre class="brush: bash;">wget --referer=http://developer.htc.com/google-io-device.html http://member.america.htc.com/download/RomCode/ADP/signed-google_ion-ota-14721.zip?

# line commented -- wget --referer=http://developer.htc.com/ http://member.america.htc.com/download/RomCode/Source_and_Binaries/sapphire.hep-357975db.tar.bz2</pre>
<p><strong>Now to do the final bit of setup</strong> and start the build (<a href="http://source.android.com/documentation/building-for-dream">reference here</a>):</p>
<pre class="brush: bash;">cd ~/mydroid/vendor/htc/sapphire-open
./unzip-files.sh
cd ~/mydroid
. build/envsetup.sh
lunch aosp_sapphire_us-eng</pre>
<p>Yes that is supposed to say "lunch", not "launch". Now the build can be started! One final thing is required to stop the build from crashing (<a href="http://www.mail-archive.com/android-porting@googlegroups.com/msg08157.html">reference</a>):</p>
<pre class="brush: bash;">cd ~/mydroid/external/webkit
git cherry-pick 18342a41ab72e2c21931afaaab6f1b9bdbedb9fa</pre>
<p>Now we can start the build:</p>
<pre class="brush: bash;">cd ~/mydroid
make -j4</pre>
<p>Bah, I've got an error: "Your version is: /bin/bash: javac: command not found.". There's a problem with my path (which I have corrected above already).</p>
<pre class="brush: bash;">export PATH=$PATH:$JAVA_HOME/bin</pre>
<p><strong>Now it's building</strong>. The HTC website advises this is now a good time to make a cup of tea, or take a nap. I'll revisit this tomorrow I think!</p>
]]></content:encoded>
			<wfw:commentRss>http://ukstokes.com/blog/2010/01/13/compile-your-own-droid-for-htc-sapphire-part-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
