<?xml version="1.0" encoding="iso-8859-1"?>
        <?xml-stylesheet type="text/css" href="http://www.miek.nl/blog/"?>
<rss version="2.0"
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 xmlns:dc="http://purl.org/dc/elements/1.1/"
 xmlns:admin="http://webns.net/mvcb/"
 xmlns:atom="http://www.w3.org/2005/Atom"
>
<channel>
<title>Filed under: android | Miek</title>
<atom:link href="http://www.miek.nl/blog/archives/android/index-rss.xml" rel="self" type="application/rss+xml" />
<link>http://www.miek.nl/blog</link>
<description>Thoughts on (technical) stuff</description>
<dc:language>en-us</dc:language>
<dc:creator>Miek Gieben</dc:creator>
<dc:date>2012-02-04T04:15:11+01:00</dc:date>
<admin:generatorAgent rdf:resource="http://nanoblogger.sourceforge.net" />

<item>
<link>http://www.miek.nl/blog/archives/2011/05/20/android_development_with_sane_tools/index.html</link>
<guid isPermaLink="true">http://www.miek.nl/blog/archives/2011/05/20/android_development_with_sane_tools/index.html</guid>
<title>Android development with sane tools</title>
<dc:date>2011-05-20T08:40:35+01:00</dc:date>
<dc:creator>Miek Gieben</dc:creator>
<dc:subject> android</dc:subject>
<description><![CDATA[<p>I can't stand Eclipse, but I do want to
develop for Android. But just not with Eclipse, VIM and a few terminals is all I need.</p>

<p>This, short, tutorial will tell you what I did to get things 
going.</p>

<p>First of:</p>

<pre><code>% sudo apt-get install eclipse
</code></pre>

<p>NO, NO, not for eclipse, but for all the Java stuff. To avoid any
further mishaps:</p>

<pre><code>% sudo chmod -x /usr/bin/eclipse
</code></pre>

<p>Download the Android SDK from <a href="http://developer.android.com/sdk/index.html">the android
site</a>. Next unpack
the SDK in a directory and add <code>&lt;that-directory&gt;/tools</code> and
<code>&lt;that-directory&gt;/platform-tools</code> to your $PATH.</p>

<p>And then start android:</p>

<pre><code>% adroid
</code></pre>

<p>And install from <code>Available packages</code> the stuff you need. From the
<code>Android Repository</code> I installed the SDKs from API11 and API12 (Android
Honeycomb).</p>

<p>When these SDKs have been successfully installed you should be able to
see some targets when you run:</p>

<pre><code>% android list targets
Available Android targets:
id: 1 or "android-11"
 Name: Android 3.0
 Type: Platform
 API level: 11
 Revision: 1
 Skins: WXGA (default)
id: 2 or "android-12"
 Name: Android 3.1
 Type: Platform
 API level: 12
 Revision: 2
 Skins: WXGA (default)
</code></pre>

<p>Next the project I'm helping with <em>does</em> use Eclipse and this needs a
little bit help nudging it to a sane environment.</p>

<h1>Compiling</h1>

<p>You'll need a <code>build.xml</code> among other things. You can create this by
issuing</p>

<pre><code>android update project --target &lt;id&gt; -name &lt;projectname&gt; --path &lt;dir&gt;
</code></pre>

<p>Next, because of the use of Admob (which is used for the in-app ads), <code>ant</code> 
needs to be taught some tricks.
Thanks for <a href="https://twitter.com/#!/bdekruijff">@bdekruijff</a> for sharing
this. In <code>default.properties</code> add <code>extensible.libs.classpath=lib</code> so
that the <code>GoogleAdMobAdsSdk-4.1.0.jar</code> can be found which is located
in a subdirectory called <code>lib/</code>.</p>

<p>After all this you should be able to compile it, with</p>

<pre><code>% ant clean compile
</code></pre>

<p>or</p>

<pre><code>% ant debug
</code></pre>

<p>to create a <code>.apk</code>.</p>]]></description>

</item>
<item>
<link>http://www.miek.nl/blog/archives/2011/05/14/mount_your_android_3_tablet/index.html</link>
<guid isPermaLink="true">http://www.miek.nl/blog/archives/2011/05/14/mount_your_android_3_tablet/index.html</guid>
<title>Mount your Android (3+) Tablet</title>
<dc:date>2011-05-14T22:23:01+01:00</dc:date>
<dc:creator>Miek Gieben</dc:creator>
<dc:subject> android</dc:subject>
<description><![CDATA[<p>Sadly Google decided <em>not</em> to make Honeycomb an USB disk (usb mass
storage) when you connect it to your computer (it is also not included in Android
3.1).</p>

<p>But of course this can be remedied:</p>

<pre><code>apt-get install mtp-tools mtpfs
</code></pre>

<p>Then connect your tablet with the USB port. My Acer A500 pops
up a nice notification, the Xoom doesn't say anything, but that
does not matter.</p>

<p>Then create a new (or use an empty one) directory and mount
the tablet:</p>

<pre><code>mkdir /tmp/A
mtpfs /tmp/A
</code></pre>

<p>Now you can drag and drop your music and movies to <code>/tmp/A/Music</code> and
<code>/tmp/A/Movies</code>. (Moboplayer is a must-have on your tablet).</p>

<p>I did notice that subdirectories seem to be some sort of novelty
for <code>mtpfs</code> so your millage may vary in that respect.</p>

<p>To unmount:</p>

<pre><code>fusermount -u /tmp/A
</code></pre>]]></description>

</item>
<item>
<link>http://www.miek.nl/blog/archives/2010/10/03/samsung_galaxy_s/index.html</link>
<guid isPermaLink="true">http://www.miek.nl/blog/archives/2010/10/03/samsung_galaxy_s/index.html</guid>
<title>Samsung Galaxy S</title>
<dc:date>2010-10-03T01:17:03+01:00</dc:date>
<dc:creator>Miek Gieben</dc:creator>
<dc:subject> android</dc:subject>
<description><![CDATA[<p>Just bought a new phone -- Samsung Galaxy S -- which is a great phone,
but it still runs Android 2.1. After playing with CyanogenMod for my
other phones I really want to run 2.2 on this phone too. Talk of the
town is that at the end of October the OTA for 2.2 is there...but I
really want to get rid of the Samsung crap and just install a plain 2.2
version.</p>

<p>Ah, for now, I will just wait. </p>]]></description>

</item>
<item>
<link>http://www.miek.nl/blog/archives/2010/09/04/android_2_2_froyo_op_je_foon/index.html</link>
<guid isPermaLink="true">http://www.miek.nl/blog/archives/2010/09/04/android_2_2_froyo_op_je_foon/index.html</guid>
<title>Android 2.2 (Froyo) op je foon</title>
<dc:date>2010-09-04T20:43:10+01:00</dc:date>
<dc:creator>Miek Gieben</dc:creator>
<dc:subject> dutch, android</dc:subject>
<description><![CDATA[<p>Deze <a href="http://forum.xda-developers.com/showthread.php?t=764530">excellente howto</a> heeft
ervoor gezorgd dat ik nu Android 2.2 (<em>nicknamed</em> Froyo) op mijn oude
HTC magic draai. Ik hoef dus nog lang geen nieuwe telefoon. Het upgraden
zelf is met de ROM van <a href="http://www.cyanogenmod.com/">CyanogenMod</a> gedaan.</p>

<p>Een Nederlandse howto kun je bij
<a href="http://www.techzine.nl/tutorials/364/android-froyo-2-2-installeren-op-een-htc-magic.html">techzine.nl</a>
vinden. Maar het <em>rooten</em> van je phone is daar wat omslachtiger
omschreven dan hier. </p>

<blockquote>
  <p>Het flashen van je telefoon kan deze dusdanig beschadigen dat 'ie
kapot is. Hij is dan zogenaamd <em>gebricked</em> en alleen nog maar nuttig
als <em>paperweight</em>. Je hebt er dan dus <strong>helemaal</strong> niks meer aan! </p>
</blockquote>

<p>Na deze waarschuwing wil je natuurlijk <em>ook</em> naar Froyo upgraden. De stappen zijn als volgt:</p>

<ul>
<li>Root je phone;</li>
<li><em>Recovery</em> installeren (soort bootloader);</li>
<li>Booten naar <em>recovery</em>;</li>
<li>Je telefoon <em>flashen</em>;</li>
<li>Klaar!</li>
</ul>

<p>In detail komt dat op het volgende neer. Eerst de voorbereidende stappen:</p>

<ol>
<li><p>In de Android Market zoek en installeer:</p></li>
<li><p><code>AppInstaller</code> van modmymobile;</p></li>
<li><p><code>ROM Manager</code>.</p></li>
<li><p>Download <code>universalandroot</code> van
<a href="http://blog.23corner.com/tag/universalandroot/">blog.23corner.com/tag/universalandroot/</a>.
Dit is een <a href="http://bit.ly/aa4jxJ">directe link</a>;</p></li>
<li><p>Download de juiste "Stable Mod" ROM voor je telefoon van
<a href="http://forum.cyanogenmod.com/files/">Cyanongenmod/files</a>.</p></li>
<li><p>Download "Google Addon pack" voor jouw telefoon. Hier zitten de
standaard Google Apps in.</p></li>
<li><p>Zet de <code>universalandroot</code>, "Google Addon pack" en de ROM in de root
directory op de SD kaart van je telefoon.</p></li>
</ol>

<h2>Rooten en flashen</h2>

<ol>
<li><p>Open <code>AppInstaller</code> en laat de <code>androot.apk</code> vinden op je SD kaart.
Selecteer die <code>.apk</code> en laat hem installeren.</p></li>
<li><p>Open dan <code>Universal AndRoot</code>. Die moet het type van je telefoon herkennen, zo
niet, dan zo ik nu maar ophouden. Herkent die je telefoon klik dan op
'root'. Als dat lukt, ben je eindelijk super user op je <em>eigen</em>
telefoon.</p></li>
</ol>

<p>Nu een custom ROM installeren:</p>

<ol>
<li><p>Open <code>ROM Manager</code> en installeer <em>Recovery</em>. Wat ik er van begrijp is
dit een soort custom boot loader. Met deze loader kun je dan weer een
ROM in je telefoon schieten. Ik heb <code>ClockworkMod Recovery</code> gebruikt en
bij mij werkte dat goed. Enige moeilijke was ontdekken welke telefoon ik
nu precies had.</p></li>
<li><p>Als je een recovery hebt geinstalleerd, selecteer dan "Backup Current ROM". Dit is mij
niet gelukt, maar toen dacht dat ik mijn oude ROM toch nooit meer nodig
zou hebben. (Gelukkig ging het flashen goed).</p></li>
<li><p>Daarna kies je voor "Reboot Into Recovery". Dit lukte bij mij niet
meteen goed, maar na een aantal keer de battery eruit gehaald te hebben,
zat ik eindelijk de <em>recovery</em>. Krijg je ipv de <em>Recovery</em> een geel
uitroep teken te zien, dan is er iets mis gegaan met de installatie
hiervan. Reboot dan je telefoon weer een keer en ga terug naar stap 1.
Mocht je niet in de <em>recovery</em> eindigen, dan kun je ook nog proberen
om te rebooten en dan de "Home" en de "Power" toets tegelijk ingedrukt
te houden.</p></li>
<li><p>In de <em>recovery</em> selecteer:</p></li>
<li><p>"wipe data/factory reset" en dan;</p></li>
<li><p>"wipe cache partition". Dit een belangrijke stap, als je dit niet
doet kun je in een reboot-loop terecht komen en is je telefoon stuk.</p></li>
<li><p>"install zip from sdcard". Navigeer naar je ROM op je SD en laat je
telefoon ermee flashen.</p></li>
<li><p>"reboot". Reboot je telefoon. Dit kan wat langer duren na  zo'n firmware upgrade. </p>

<blockquote>
  <p>Als de stap lukt. Gefeliciteerd: Je draait nu CyanogenMod 6.0</p>

<p>Als het mislukt. Gefelictieerd: Je telefoon is nu kapot. (Misschien helpt nog een keer flashen).</p>
</blockquote></li>
<li><p>Je kunt nu ook via de <em>recovery</em> een <code>nandroid</code> backup maken;</p></li>
<li><p>Reboot naar de <em>recovery</em> en installeer de "Google Addon pack";</p></li>
</ol>

<h2>Resterende issues</h2>

<p>Mijn Nederlands woordenboek deed het niet goed, maar <a href="http://blog.cone.be/2010/08/20/creating-dutch-dictionary-for-android/">gelukkig is dat ook opgelost</a>. 
Installeer <a href="http://www.miek.nl/downloads/2010/LatinIME.apk">deze .apk</a>,
met:</p>

<pre><code>adb install -r LatinIME.apk
</code></pre>

<p>Je kunt ook nog <code>Swype</code> installeren en waarschijnlijk moet je de
<code>Android Market</code> nog fixen. Zie daarvoor: <a href="http://www.techzine.nl/tutorials/364/android-froyo-2-2-installeren-op-een-htc-magic.html">techzine.nl</a></p>]]></description>

</item>
<item>
<link>http://www.miek.nl/blog/archives/2010/05/26/mocking_a_gui_for_android/index.html</link>
<guid isPermaLink="true">http://www.miek.nl/blog/archives/2010/05/26/mocking_a_gui_for_android/index.html</guid>
<title>Mocking a GUI (for Android)</title>
<dc:date>2010-05-26T21:52:10+01:00</dc:date>
<dc:creator>Miek Gieben</dc:creator>
<dc:subject> android</dc:subject>
<description><![CDATA[<p>I'm playing with <a href="http://gomockingbird.com/mockingbird/">Mockingbird</a>
which allows you to create wire frames for GUIs. I want to create
a little app for <a href="http://developer.android.com">Android</a> which is
based on the Alarm app which is included by default.</p>

<p>The following images are exported from Mockingbird:</p>

<p><img src="http://www.miek.nl/gfx/2010/alarm-home.png" width="400" alt="Home screen of clock app"/></p>

<p><img src="http://www.miek.nl/gfx/2010/alarm-details.png" width="400" alt="Details of an alarm"/></p>

<p><img src="http://www.miek.nl/gfx/2010/alarm-settings.png" width="400" alt="Settings of alarms"/></p>

<p>And what is <em>also</em> brilliant? The <a href="http://android.git.kernel.org/?p=platform/packages/apps/AlarmClock.git;a=tree;hb=HEAD">source of the alarm clock is
available</a>.</p>

<p>The bad thing is that all android apps are written in Java... (<em>yech</em>). </p>]]></description>

</item>
<item>
<link>http://www.miek.nl/blog/archives/2010/05/24/android_dev_on_ubuntu_10_04/index.html</link>
<guid isPermaLink="true">http://www.miek.nl/blog/archives/2010/05/24/android_dev_on_ubuntu_10_04/index.html</guid>
<title>Android dev on Ubuntu 10.04</title>
<dc:date>2010-05-24T18:36:35+01:00</dc:date>
<dc:creator>Miek Gieben</dc:creator>
<dc:subject> android</dc:subject>
<description><![CDATA[<p>After mocking about for a few months I decided to take
the plunge and look into developing Android applications.</p>

<p>Almost every website I looked at was telling me I needed
Eclipse and God knows what to <em>write</em> some little <em>Java</em>
programs. So I tried Eclipse, downloaded 300 megs, waited
30 seconds for the thing to start up and was then greeted
with the segmentation fault. W.T.F. ?</p>

<p>Looking further I found <a href="http://www.jukie.net/bart/blog/android-hello-world">this great blog</a>
entry detailing development with <a href="http://www.vim.org">Vim</a> and general
doing the development on a more low level &mdash; like, you know &mdash; the way
it should be.</p>

<h1>Getting the emulator up and running</h1>

<p>I'm running the <a href="http://developer.android.com/sdk/index.html">Android SDK kit</a> on
Ubuntu 10.04 (64 bits). Doing this on a 32 bits version is even easier.</p>

<p>You need to download and untar the dev kit from the URL above. And
you'll need
to add the <code>Tools</code> directory in the sdk to your <code>PATH</code> variable.</p>

<p>Next you'll need <code>java</code> and <code>ant</code>, for Ubuntu 10.04 this becomes:</p>

<pre><code>apt-get install openjdk-6-jdk openjdk-6-jre ant
</code></pre>

<p>further more, a 32 bits version of <code>libstd++</code> and <code>ia32-libs</code> is needed, because
when I started the emulator I was greeted with:</p>

<pre><code>SDL init failure, reason is: No available video device
</code></pre>

<p>So</p>

<pre><code>apt-get install ia32-libs lib32stdc++6
</code></pre>

<p>Next you can start <code>android</code></p>

<pre><code>% android
</code></pre>

<p>And a GUI should appear. Next you should click 'Available Packages', enable
the repository and just download everything. All these package will be installed
in you sdk directory (where you untarred the sdk).</p>

<p>After this has been done you can create a new virtual device (AVD). Go
to the
'Virtual Devices', select 'New' and give your need Android some nice hardware.
After this is done you can start your phone (which can take quite a while). When the 
phone is booted you will see something like this:</p>

<p><img src="http://www.miek.nl/gfx/2010/android.jpg" alt="Android emulator"/></p>

<p>Clicking 'Menu' will unlock your virtual device.</p>

<h1>HelloAndroid</h1>

<h2>Create a new project</h2>

<pre><code> android create project --target 4 --path ~/test_android --activity Test1 --package Hello.World
</code></pre>

<p>Where <code>target 4</code> is the fourth target listed with 
<code>android list targets</code>, which for me is a 2.2 device.</p>

<p><code>~/test_android</code> is just a path where your source code lives.</p>

<p><code>--package Hello.World</code> is the Java package for you program.</p>

<p><code>android create project</code> also puts some example code in the directory
structure it creates: <code>test_android/src/Hello/World/Test1.java</code></p>

<h2>Type some code</h2>

<p>Cut and paste the following code into <code>Test1.java</code>:</p>

<pre><code>package Hello.World;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class HelloAndroid extends Activity {
   /** Called when the activity is first created. */
   @Override
   public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       TextView tv = new TextView(this);
       tv.setText("Hello, Android");
       setContentView(tv);
   }
}
</code></pre>

<h2>Compilation</h2>

<pre><code>cd ~/test_android
ant debug       # this prob. builds a debug build
</code></pre>

<p>And then you should have a <code>test_android/bin/Test1-debug.apk</code>; an
android package.</p>

<h2>Getting the <code>.apk</code> on the emulator</h2>

<p>Start the emulator (if it wasn't running), and use <code>adb</code>:</p>

<pre><code>adb install ~/test_android/bin/Test1-debug.apk 

261 KB/s (13175 bytes in 0.049s)
pkg: /data/local/tmp/Test1-debug.apk
Success
</code></pre>

<p>This should work ok. Next on the emulator; Menu, and
scroll to your app, it should be named <code>Test1</code>, and click it.</p>

<p>Tada!</p>

<p>Next up: build something nice and useful.</p>]]></description>

</item>
<item>
<link>http://www.miek.nl/blog/archives/2010/04/22/how_to_voip_on_your_android_phone/index.html</link>
<guid isPermaLink="true">http://www.miek.nl/blog/archives/2010/04/22/how_to_voip_on_your_android_phone/index.html</guid>
<title>How to VOIP on your android phone</title>
<dc:date>2010-04-22T19:32:27+01:00</dc:date>
<dc:creator>Miek Gieben</dc:creator>
<dc:subject> android</dc:subject>
<description><![CDATA[<p>Skype (lite) is still banned or not available in the app market. And
Skype is also evil, closed source, proprietary protocol, etc., so I
wanted to use something more open. Enter:
<a href="http://sipdroid.org/">sipdroid</a> and <a href="http://ekiga.net">ekiga.net</a>.</p>

<h1>Steps to get VOIP working</h1>

<p>Get a VOIP (Sip) address at <a href="http://www.ekiga.net">ekiga.net</a>.</p>

<ol>
<li>Install <code>sipdroid</code> via the Market;</li>
<li>Start <code>sipdroid</code> and go to Menu->Settings;</li>
<li>Fill out your credentials you've got from Ekiga.net;
<ul>
<li><code>server</code>, should be <code>ekiga.net</code>;</li>
<li><code>username</code>, the username you got on ekiga.net.</li>
</ul></li>
</ol>

<p>You can then make a call by entering the sip address and press 'call',
for instance I'm <code>miekg@ekiga.net</code>.</p>

<blockquote>
  <p>Awesome!</p>
</blockquote>

<p>This is gonna save money! :-)</p>]]></description>

</item>
</channel>
</rss>

