<?xml version="1.0"?>
<rss version="2.0"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:dcterms="http://purl.org/dc/terms/" >
<channel>
<title>android</title>
<link>http://kanru.info/blog/tags/android/</link>
<description>Kanru&#39;s Adventure Journal</description>
<item>

	<title>Android: Wakelocks and TuxOnIce</title>


	<guid isPermaLink="no">urn:uuid:e95626a2-2d2e-5067-9a84-1af70508ef83</guid>

	<link>http://kanru.info/blog/archives/2011/06/29/android-wakelocks-n-tuxonice/</link>


	<category>0xlab</category>

	<category>android</category>

	<category>linux</category>


	<pubDate>Wed, 29 Jun 2011 10:26:28 +0800</pubDate>
	<dcterms:modified>2011-06-29T13:02:58Z</dcterms:modified>

	<description>&lt;p&gt;最近為了把 &lt;a href=&quot;http://tuxonice.net/&quot;&gt;TuxOnIce&lt;/a&gt; 整到 &lt;a href=&quot;https://gitorious.org/0xlab-kernel/kernel/commits/toi/linaro-android.38&quot;&gt;Android 上面&lt;/a&gt;，著實把 Linux 的電源管理系統中關於 suspend 與 hibernation 的部份研究了一下。而 Android 為了增加待機時間加入了 wakelock 的機制，讓情況變得更加複雜。&lt;/p&gt;

&lt;h2&gt;TuxOnIce&lt;/h2&gt;

&lt;h3&gt;TOI Patch&lt;/h3&gt;

&lt;p&gt;TuxOnIce 簡稱 TOI，前身是 Software Suspend 2，是一個長期在 linux
upstream 以外耕耘的一個休眠補釘，相較於早期整合到 linux kernel 內的
swsusp，TOI 的功能非常豐富，可以指定把記憶體內容儲存到多種不同的位置，如檔案或置換空間，還可以選擇不同的壓縮方法。&lt;/p&gt;

&lt;p&gt;首先幫 ARM 平台加上基本的休眠功能，使用 Hiroshi DOYU 的 patch:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://article.gmane.org/gmane.linux.power-management.general/20543&quot;&gt;http://article.gmane.org/gmane.linux.power-management.general/20543&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;然後到 TOI 網站下載最新的 3.2 補釘，打上去的時候會有一些衝突但是都還滿容易解決，要注意的是某些衝突是看不出來的，例如因為函式移動位置而造成重複定義，要小心檢查。&lt;/p&gt;

&lt;p&gt;然後因為 TOI 對於非 x86 平台有一些假設現在已經不適用，所以需要修改&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://gitorious.org/0xlab-kernel/kernel/commit/e551caf&quot;&gt;https://gitorious.org/0xlab-kernel/kernel/commit/e551caf&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;OMAPFB&lt;/h3&gt;

&lt;p&gt;使用 Pandaboard 加上 Android 測試才發現從休眠醒來後 LCD 不會自動點亮，通常在 x86 平台上有 pm-utils 或是 hibernate script 來幫忙處理這種關閉打開 LCD 的問題，這次我是先在 kernel 內幫 OMAPFB 加上一個電源管理的呼叫，讓 kernel 醒來的時候自己重新設定 LCD。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://gitorious.org/0xlab-kernel/kernel/commit/21e0f14&quot;&gt;https://gitorious.org/0xlab-kernel/kernel/commit/21e0f14&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Pandaboard &amp;amp; Beagleboard xM&lt;/h3&gt;

&lt;p&gt;在 Pandaboard 或 Beagleboard xM 上面沒有 NAND 可以當作儲存空間，所以一般都是把檔案放在MMC 上面，第一個 patch 讓 kernel 在開機的時候不要初始化不存在的 NAND 空間&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://gitorious.org/0xlab-kernel/kernel/commit/3ae6b4c&quot;&gt;https://gitorious.org/0xlab-kernel/kernel/commit/3ae6b4c&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;然後因為 MMC 的 probe 需要時間，第二個 patch 讓 TOI 等待指定的 resume
device 已經偵測到之後才開始進行 resume&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://gitorious.org/0xlab-kernel/kernel/commit/1078bd7&quot;&gt;https://gitorious.org/0xlab-kernel/kernel/commit/1078bd7&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Wakelock&lt;/h2&gt;

&lt;p&gt;wakelock 是 Android 為了讓裝置可以更積極的休眠又不妨礙正常工作的進行而加入的機制，究竟是好是壞已經在 LKML 與 LWN 上面討論過非常多次，可以參考：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://lwn.net/Articles/318611/&quot;&gt;Wakelocks and the embedded problem&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://lwn.net/Articles/388131/&quot;&gt;Blocking suspend blockers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://thread.gmane.org/gmane.linux.kernel/985471&quot;&gt;Suspend block api (version 7)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;失眠症&lt;/h3&gt;

&lt;p&gt;開始測試 TOI 的效果時遇到的第一個問題就是失眠症，因為 wakelock 從中作梗，導致每次休眠到一半就被取消掉。原來是因為 TOI 的休眠途徑會先強制檔案系統把內容寫回，而 MMC 子系統會在寫入/讀取一段時間後嘗試進入低耗電模式，偏偏 Android 在這裡安插了一個 wakelock，導致之後要凍結所有執行緒的時候失敗。&lt;/p&gt;

&lt;p&gt;解法，首先因為休眠的後半段路徑其實就是要準備進行關機，而一般來說休眠都是人為啟動，因此可以假設此時使用者了解工作可能還未完成，可以忽略
wakelock，所以第一個 patch 就是讓休眠的路徑不去檢查 wakelock，避免像
MMC 這樣的問題。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://gitorious.org/0xlab-kernel/kernel/commit/3bb5d6f&quot;&gt;https://gitorious.org/0xlab-kernel/kernel/commit/3bb5d6f&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;接下來是一般的待機路徑，似乎是因為新的 kernel 會積極的嘗試把 MMC 變成低耗電模式，但 OMAP 預設的 MMC timeout 是 100 毫秒，把工作放在 Queue
裡面反而不斷鎖住 wakelock 讓 Android 無法休眠，第二個 patch 就是讓 MMC
子系統在準備休眠的時候就不要作無謂的掙扎，直接進入低耗電模式。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://gitorious.org/0xlab-kernel/kernel/commit/88823b9&quot;&gt;https://gitorious.org/0xlab-kernel/kernel/commit/88823b9&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;嗜睡症&lt;/h3&gt;

&lt;p&gt;解決了失眠症沒想到接下來遇到嗜睡症，因為手機插著 USB 的時候是不會真正睡著的，所以一直沒機會觀察 Android 睡著是怎麼樣，原來只把 kernel 叫醒是沒用的，Android 還會檢查目前的 input event 是否屬於 user activity 的範圍，是的話才會把整個系統帶醒，不然因為 wakelock 的機制，馬上就會又睡著。&lt;/p&gt;

&lt;p&gt;參考：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.elinux.org/Android_Power_Management&quot;&gt;Android Power Management&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>


</item>
<item>

	<title>Android 2.3 Introduction &#x26; Statistics</title>


	<guid isPermaLink="no">urn:uuid:e84c0855-25f2-5058-bf1a-ba693dc97127</guid>

	<link>http://kanru.info/blog/archives/2010/12/29/android23-introduction/</link>


	<category>0xlab</category>

	<category>android</category>

	<category>gingerbread</category>


	<pubDate>Wed, 29 Dec 2010 15:41:29 +0800</pubDate>
	<dcterms:modified>2011-06-29T13:33:30Z</dcterms:modified>

	<description>&lt;p&gt;如果你有收看 LWN.net 的話，大概知道每次 linux kernel 有新的 release 前都會有一次針對這次 release 的統計資料，看看主要的貢獻是由哪些人，哪些公司完成。藉由這次跟 0xlab 分享 Android 2.3 新特性的時候，我學 LWN.net
做了一些小統計，還滿有趣的。&lt;/p&gt;

&lt;h2&gt;Most active Android 2.3 organizations (by changesets)&lt;/h2&gt;

&lt;table&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;4204 google.com
1354 android.com
98 sonyericsson.com
71 gmail.com
39 codeaurora.org
39 samsung.com
38 intel.com
32 nokia.com
32 holtmann.org
&lt;strong&gt;29 0xlab.org&lt;/strong&gt;
25 trusted-logic.com
17 openbossa.org
11 nxp.com
&lt;strong&gt;11 linux.org.tw&lt;/strong&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;
&lt;pre&gt;10 ti.com
10 acer.com.tw
8 themaw.net
8 garmin.com
7 snpe.rs
7 motorola.com
7 mc.pp.se
7 googlemail.com
5 invensense.com
4 mirbsd.org
3 windriver.com
3 realvnc.com
2 teleca.com
2 sharp.co.jp&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;
&lt;pre&gt;2 nvidia.com
2 motoya.co.jp
2 lge.com
2 broadcom.com
1 yahoo-inc.com
1 xs4all.nl
1 wdsglobal.com
1 uwevoelker.de
1 strongswan.org
1 stericsson.com
1 signove.com
1 saftware.de
1 richlowe.net
1 pv.com&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;
&lt;pre&gt;1 promwad.com
1 pcc.me.uk
1 padovan.org
1 osbeck.com
1 nii.net
1 martin.st
1 ilovelinux.de
1 happydroid.com
1 droidmod.org
1 cpeterso.com
1 big.or.jp
1 arm.com&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;h2&gt;Most active Android 2.3 developers (by lines changed)&lt;/h2&gt;

&lt;table&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;Jesse Wilson
Eric Laurent
Dianne Hackborn
David &#39;Digit&#39; Turner
Nick Pelly
Mathias Agopian
Nick Kralevich
Brian Carlstrom
Eric Fischer
Andreas Huber&lt;/pre&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;pre&gt;386588
364359
260033
205494
160707
124119
103004
83492
61646
61233&lt;/pre&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;pre&gt;12.8708%
12.13%
8.65%
6.84% 
5.35%
4.13%
3.42%
2.77%
2.05%
2.03%&lt;/pre&gt;
&lt;/td&gt;
&lt;/table&gt;

&lt;hr&gt;

&lt;div class=&quot;center&quot; style=&quot;width:425px&quot; id=&quot;__ss_6395491&quot;&gt;&lt;object
id=&quot;__sse6395491&quot; width=425&quot; height=355&quot;&gt;&lt;param name=&quot;movie&quot;
value=&quot;//static.slidesharecdn.com/swf/ssplayer2.swf?doc=android23intro-101229014534-phpapp02&amp;rel=0&amp;stripped_title=android23intro&amp;userName=kanru&quot;
/&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;/&gt;&lt;param
name=&quot;allowScriptAccess&quot; value=&quot;always&quot;/&gt;&lt;embed name=&quot;__sse6395491&quot;
src=&quot;http://kanru.info//static.slidesharecdn.com/swf/ssplayer2.swf?doc=android23intro-101229014534-phpapp02&amp;rel=0&amp;stripped_title=android23intro&amp;userName=kanru&quot;
type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot;
allowfullscreen=&quot;true&quot; width=412&quot; height=355&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;

&lt;p&gt;投影片中還研究了一下各主要開發者主要研究的方向，看 log 的時候依照這個順序去看，有一定的脈絡可尋 :)&lt;/p&gt;
</description>


</item>
<item>

	<title>Android Service with dynamic arguments</title>


	<guid isPermaLink="no">http://kanru.info/blog/archives/861/</guid>

	<link>http://kanru.info/blog/archives/861/</link>


	<category>0xlab</category>

	<category>android</category>

	<category>init</category>


	<pubDate>Tue, 24 Aug 2010 16:01:34 +0800</pubDate>
	<dcterms:modified>2010-08-24T08:01:34Z</dcterms:modified>

	<description>&lt;p&gt;Recently when I was preparing some Android training material I found this little trick.&lt;/p&gt;

&lt;p&gt;Android &quot;init&quot; can do a lot of things, including &quot;on property change&quot; trigger; one can image some applications use this to implement an ad-hoc IPC. One example is the &lt;em&gt;system/libnetutil&lt;/em&gt; that monitors the &quot;init.svc.dhcpcd&quot; property to detect whether dhcpcd is running or not.&lt;/p&gt;

&lt;p&gt;Android framework can execute some predefined command (service) via the &quot;ctl.start&quot; property, the most interesting part is you can supply dynamic arguments to the command just like you were calling a command from shell.&lt;/p&gt;

&lt;p&gt;The format is&lt;/p&gt;

&lt;pre class=&quot;hl&quot;&gt;setprop ctl.start service&lt;span class=&quot;hl opt&quot;&gt;:&lt;/span&gt;arg1 arg2 arg3..
&lt;/pre&gt;

&lt;p&gt;It must be a oneshot service, for example you can define a dhcpcd service like:&lt;/p&gt;

&lt;pre class=&quot;hl&quot;&gt;service dhcpcd &lt;span class=&quot;hl opt&quot;&gt;/&lt;/span&gt;system&lt;span class=&quot;hl opt&quot;&gt;/&lt;/span&gt;bin&lt;span class=&quot;hl opt&quot;&gt;/&lt;/span&gt;dhcpcd &lt;span class=&quot;hl opt&quot;&gt;-&lt;/span&gt;B
    group dhcp wifi system
    disabled
    oneshot
&lt;/pre&gt;

&lt;p&gt;And set the target interface dynamically:&lt;/p&gt;

&lt;pre class=&quot;hl&quot;&gt;setprop ctl.start dhcpcd&lt;span class=&quot;hl opt&quot;&gt;:&lt;/span&gt;eth0
&lt;/pre&gt;

&lt;p&gt;&quot;init&quot; will then execute &quot;dhcpcd -B eth0&quot; with appropriate permissions. &lt;/p&gt;
</description>


</item>
<item>

	<title>Root your Phone with just 1-Click</title>


	<guid isPermaLink="no">http://kanru.info/blog/archives/822/</guid>

	<link>http://kanru.info/blog/archives/822/</link>


	<category>0xlab</category>

	<category>android</category>

	<category>root</category>


	<pubDate>Tue, 03 Aug 2010 17:32:25 +0800</pubDate>
	<dcterms:modified>2010-08-03T09:32:25Z</dcterms:modified>

	<description>&lt;p&gt;Today I read that &lt;a href=&quot;http://news.slashdot.org/story/10/07/31/167255/Silent-Easily-Made-Android-Rootkit-Released-At-DefCon&quot;&gt;someone&lt;/a&gt; demoed how to put rootkit into your phone during the &lt;a href=&quot;https://www.defcon.org/&quot;&gt;Defcon&lt;/a&gt;. But there are no details, the keywords like kernel moudle, install apk, remote phone call, ..., all reminds me the old phishing attack. Then I thought, can it be the &lt;a href=&quot;http://mobile.slashdot.org/story/10/07/23/2013251/Droid-X-Gets-Rooted&quot;&gt;trick&lt;/a&gt; used to root Droid X?&lt;/p&gt;

&lt;p&gt;Actually this &lt;a href=&quot;http://c-skills.blogspot.com/2010/07/exploid-works-on-droid-x.html&quot;&gt;exploid&lt;/a&gt; works on almost every Android phone because it leverages a vulnerability in the framework. XDA developers also &lt;a href=&quot;http://forum.xda-developers.com/showthread.php?t=736271&quot;&gt;confirmed&lt;/a&gt; the success on various N1 model. But can it be used on real attack?&lt;/p&gt;

&lt;p&gt;To demonstrate how &lt;strong&gt;dangerous&lt;/strong&gt; the local exploit is, I wrote an Android application that inject the &lt;code&gt;su&lt;/code&gt; program into your phone. With &lt;a href=&quot;http://github.com/CyanogenMod/android_packages_apps_Superuser&quot;&gt;Superuser.apk&lt;/a&gt; you can gain root access whenever you run &lt;code&gt;su&lt;/code&gt; from adb shell.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;No additional permissions required! This works on my stock Nexus One and in theory any Android. Just one click I can root you phone (optionally take away your data simultaneously). Don&#39;t trust me or any other similar programs floating around the market, or simply don&#39;t install any program until your carrier fix this.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blog.kanru.info/wp-content/uploads/2010/08/home1.png&quot;&gt;&lt;img src=&quot;http://blog.kanru.info/wp-content/uploads/2010/08/home1-180x300.png&quot; alt=&quot;&quot; title=&quot;home1&quot; width=&quot;180&quot; height=&quot;300&quot; class=&quot;alignnone size-medium wp-image-823&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;http://blog.kanru.info/wp-content/uploads/2010/08/rootdroid.png&quot;&gt;&lt;img src=&quot;http://blog.kanru.info/wp-content/uploads/2010/08/rootdroid-180x300.png&quot; alt=&quot;&quot; title=&quot;rootdroid&quot; width=&quot;180&quot; height=&quot;300&quot; class=&quot;alignnone size-medium wp-image-824&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;http://blog.kanru.info/wp-content/uploads/2010/08/su.png&quot;&gt;&lt;img src=&quot;http://blog.kanru.info/wp-content/uploads/2010/08/su-180x300.png&quot; alt=&quot;&quot; title=&quot;su&quot; width=&quot;180&quot; height=&quot;300&quot; class=&quot;alignnone size-medium wp-image-837&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;pre&gt;
Download the apk here: &lt;a href=&quot;http://0xlab.org/~kanru/RootDroid-release.apk&quot;&gt;http://0xlab.org/~kanru/RootDroid-release.apk&lt;/a&gt;
&lt;img src=&quot;http://blog.kanru.info/wp-content/uploads/2010/08/RootDroid-release.apk_.png&quot; alt=&quot;&quot; title=&quot;RootDroid-release.apk&quot; width=&quot;120&quot; height=&quot;120&quot; class=&quot;alignnone size-full wp-image-843&quot; style=&quot;float:left&quot; /&gt;
md5: 20894acd3be808c51ce32491872ba027
sha1: 889fc92692c0e58e83673dedbabbc66d5c6318b1
&lt;/pre&gt;

&lt;div style=&quot;clear:left&quot;&gt;&lt;/div&gt;

&lt;p&gt;This vulnerability has been &lt;a href=&quot;http://github.com/CyanogenMod/android_system_core/commit/5f5d5c8cef10f28950fa108a8bd86d55f11b7ef4&quot;&gt;fixed&lt;/a&gt; in CyanogenMod two weeks ago, and the source code is landing the AOSP froyo branch, but there is still no official fix update from Google. Consider how &lt;strong&gt;dangerous&lt;/strong&gt; this is, I may not install any third party application until an OTA arrives or just go ahead with a customized rom with my newly rooted phone ;-)&lt;/p&gt;
</description>


</item>
<item>

	<title>AndroidDev: Recent progress on Gallery3D</title>


	<guid isPermaLink="no">http://kanru.info/blog/archives/799/</guid>

	<link>http://kanru.info/blog/archives/799/</link>


	<category>0xlab</category>

	<category>Gallery3D</category>

	<category>agl</category>

	<category>android</category>

	<category>opengl</category>


	<pubDate>Wed, 19 May 2010 20:31:40 +0800</pubDate>
	<dcterms:modified>2010-05-19T12:31:40Z</dcterms:modified>

	<description>&lt;p&gt;Gallery3D is the gallery application released with Éclair, contributed by &lt;a href=&quot;http://www.cooliris.com/mobile/nexus-one/&quot;&gt;Cooliris&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This application heavily uses OpenGL to render the scenes. It looks great on Nexus One. But 0xdroid does not yet support hardware accelerated 3D graphics and rely on libagl to rasterize the 3D graph. &lt;/p&gt;

&lt;p&gt;Agl is the software OpenGL rendering engine used by android emulator. Gallery3D assumes there is hardware support and this caused a lot of trouble when one want to run it with agl. Even if the libagl implementation is correct and complete, Gallery3D may also assumes some implementation depended behavior. Not to mention the fundamental libagl implementations may have problems.&lt;/p&gt;

&lt;p&gt;Anyway, we have some progress and I&#39;d like to share the screenshots. Devkit8000 DVI output, 640x480 resolution, captured by DDMS.&lt;/p&gt;

&lt;p&gt;[gallery link=&quot;file&quot;]&lt;/p&gt;

&lt;p&gt;I have a feeling there are more OpenGL tricks inside the source code then I&#39;d expected.&lt;/p&gt;
</description>


</item>
<item>

	<title>AndroidDev: Provision the device</title>


	<guid isPermaLink="no">http://kanru.info/blog/archives/789/</guid>

	<link>http://kanru.info/blog/archives/789/</link>


	<category>0xlab</category>

	<category>Devkit8000</category>

	<category>Provision</category>

	<category>android</category>


	<pubDate>Wed, 12 May 2010 10:39:43 +0800</pubDate>
	<dcterms:modified>2010-05-12T02:39:43Z</dcterms:modified>

	<description>&lt;p&gt;在 Devkit8000 上把 HOME key 設定好後卻無法作用，仔細看了下處理 HOME key 的地方是 polices 下的 PhoneWindowManager.java，會去檢查這個 device 是否被 &quot;Provision&quot; 了。&lt;/p&gt;

&lt;p&gt;這個 Provision 的動作其實就是 Device 第一次啟用時做初始設定，在 Google phone 上面就是 SetupWizard，在 emulator 裏面則有簡單的 Provision.apk，之前無法作用就是因為一直沒有把 Provision.apk 放進去...&lt;/p&gt;

&lt;p&gt;Provision.apk 做了什麼事呢？其實很簡短：&lt;/p&gt;

&lt;pre class=&quot;hl&quot;&gt;&lt;span class=&quot;hl kwa&quot;&gt;public class&lt;/span&gt; DefaultActivity &lt;span class=&quot;hl kwa&quot;&gt;extends&lt;/span&gt; Activity &lt;span class=&quot;hl opt&quot;&gt;{&lt;/span&gt;

    &lt;span class=&quot;hl kwc&quot;&gt;&amp;#64;Override&lt;/span&gt;
    &lt;span class=&quot;hl kwa&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;hl kwb&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hl kwd&quot;&gt;onCreate&lt;/span&gt;&lt;span class=&quot;hl opt&quot;&gt;(&lt;/span&gt;Bundle icicle&lt;span class=&quot;hl opt&quot;&gt;) {&lt;/span&gt;
        &lt;span class=&quot;hl kwa&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;hl opt&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl kwd&quot;&gt;onCreate&lt;/span&gt;&lt;span class=&quot;hl opt&quot;&gt;(&lt;/span&gt;icicle&lt;span class=&quot;hl opt&quot;&gt;);&lt;/span&gt;

        &lt;span class=&quot;hl slc&quot;&gt;// Add a persistent setting to allow other apps to know&lt;/span&gt;
        &lt;span class=&quot;hl slc&quot;&gt;// the device has been provisioned.&lt;/span&gt;
        Settings&lt;span class=&quot;hl opt&quot;&gt;.&lt;/span&gt;Secure&lt;span class=&quot;hl opt&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl kwd&quot;&gt;putInt&lt;/span&gt;&lt;span class=&quot;hl opt&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl kwd&quot;&gt;getContentResolver&lt;/span&gt;&lt;span class=&quot;hl opt&quot;&gt;(),&lt;/span&gt;
                               Settings&lt;span class=&quot;hl opt&quot;&gt;.&lt;/span&gt;Secure&lt;span class=&quot;hl opt&quot;&gt;.&lt;/span&gt;DEVICE_PROVISIONED&lt;span class=&quot;hl opt&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;hl opt&quot;&gt;);&lt;/span&gt;

        &lt;span class=&quot;hl slc&quot;&gt;// remove this activity from the package manager.&lt;/span&gt;
        PackageManager pm &lt;span class=&quot;hl opt&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hl kwd&quot;&gt;getPackageManager&lt;/span&gt;&lt;span class=&quot;hl opt&quot;&gt;();&lt;/span&gt;
        ComponentName name &lt;span class=&quot;hl opt&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;hl kwd&quot;&gt;ComponentName&lt;/span&gt;&lt;span class=&quot;hl opt&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl kwa&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;hl opt&quot;&gt;,&lt;/span&gt;
                                     DefaultActivity&lt;span class=&quot;hl opt&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl kwa&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;hl opt&quot;&gt;);&lt;/span&gt;
        pm&lt;span class=&quot;hl opt&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl kwd&quot;&gt;setComponentEnabledSetting&lt;/span&gt;&lt;span class=&quot;hl opt&quot;&gt;(&lt;/span&gt;name&lt;span class=&quot;hl opt&quot;&gt;,&lt;/span&gt;
                   PackageManager&lt;span class=&quot;hl opt&quot;&gt;.&lt;/span&gt;COMPONENT_ENABLED_STATE_DISABLED&lt;span class=&quot;hl opt&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;hl opt&quot;&gt;);&lt;/span&gt;

        &lt;span class=&quot;hl slc&quot;&gt;// terminate the activity.&lt;/span&gt;
        &lt;span class=&quot;hl kwd&quot;&gt;finish&lt;/span&gt;&lt;span class=&quot;hl opt&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;hl opt&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;hl opt&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;

&lt;p&gt;因此若要提供一個類似 SetupWizard 的初始化介面在 Devit8000 上面，只要延伸這個 Provision.apk 做的事，提供 GUI 等等，最重要的就是設定這個 &quot;Settings.Secure.DEVICE_PROVISIONED&quot;&lt;/p&gt;

&lt;p&gt;這是一個筆記。&lt;/p&gt;
</description>


</item>
<item>

	<title>Fourth 0xdroid Release for BeagleBoard and Devkit8000!</title>


	<guid isPermaLink="no">http://kanru.info/blog/archives/767/</guid>

	<link>http://kanru.info/blog/archives/767/</link>


	<category>0xlab</category>

	<category>android</category>


	<pubDate>Tue, 27 Apr 2010 12:16:14 +0800</pubDate>
	<dcterms:modified>2010-04-27T04:16:14Z</dcterms:modified>

	<description>&lt;p&gt;&lt;img src=&quot;http://0xlab.org/logo_imgs/0xdroid.png&quot; style=&quot;float:left;&quot;/&gt; Today we are celebrating the 0xLab&#39;s one year old birthday! I&#39;d like to write about the recently announced &lt;a href=&quot;http://code.google.com/p/0xdroid/wiki/beagle_eclair_0x4&quot;&gt;fourth 0xdroid release&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;What&#39;s new in this release? The biggest one is that it is based on Éclair code base! While Éclair uses a lot more 3D stuff for its UI, the performance drop between Donut and Éclair is huge. After lots of testing and hacking, we finally bought the Éclair performance back to its original level. For detailed benchmark results, checkout the wiki page &lt;a href=&quot;http://code.google.com/p/0xdroid/wiki/Benchmarks&quot;&gt;Benchmarks&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Second is new hardware support. 0xdroid now officially supports Devkit8000, a BeagleBoard clone. Developers did many works to bring up the all functionality include LCD/DVI output, touchscreen calibration, USB, Ethernet, etc. Running Éclair on Devkit8000 looks great!&lt;/p&gt;

&lt;p&gt;Oh, and the new installer! The new installer used in this release supports both BeagleBoard and Devkit8000, with different display resolution and hardware revision. It can do a lot more than previous installer can do, for example it can download images from network, install to SD/MMC card and indicate progress via graphic display or via blinking LEDs. All of this will fit into a 1MB binary!&lt;/p&gt;

&lt;p&gt;Enjoy the release video on the youtube:&lt;/p&gt;

&lt;div style=&quot;width:480px;margin: 0 auto;&quot;&gt;&lt;object width=&quot;480&quot; height=&quot;385&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/OGpYk1p1UPI&amp;hl=zh_TW&amp;fs=1&amp;&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/OGpYk1p1UPI&amp;hl=zh_TW&amp;fs=1&amp;&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;480&quot; height=&quot;385&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;

&lt;p&gt;Want to contribute? &lt;a href=&quot;http://code.google.com/p/0xdroid/wiki/UsingPreBuiltImages&quot;&gt;Download&lt;/a&gt; it and try now!&lt;/p&gt;
</description>


</item>
<item>

	<title>Got one A1 from Broncho</title>


	<guid isPermaLink="no">http://kanru.info/blog/archives/688/</guid>

	<link>http://kanru.info/blog/archives/688/</link>


	<category>0xlab</category>

	<category>android</category>


	<pubDate>Mon, 15 Mar 2010 17:50:49 +0800</pubDate>
	<dcterms:modified>2010-03-15T09:50:49Z</dcterms:modified>

	<description>&lt;p&gt;上週末下班前，在桌上發現一個包裹，原來是渡海而來的兩隻 A1！這兩隻 A1 是 Broncho 的產品，詳細規格可以參考 &lt;a href=&quot;http://www.broncho.cn/products/a1/&quot;&gt;Broncho 的網頁&lt;/a&gt;。&lt;/p&gt;

&lt;p&gt;大伙興奮的開箱啦！&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/FxCam_1268373797319.jpg&quot;&gt;&lt;img src=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/FxCam_1268373797319-150x150.jpg&quot; alt=&quot;開箱&quot; title=&quot;unbox&quot; width=&quot;150&quot; height=&quot;150&quot; class=&quot;alignnone size-thumbnail wp-image-689&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/FxCam_1268373867309.jpg&quot;&gt;&lt;img src=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/FxCam_1268373867309-150x150.jpg&quot; alt=&quot;開箱&quot; title=&quot;unbox2&quot; width=&quot;150&quot; height=&quot;150&quot; class=&quot;alignnone size-thumbnail wp-image-691&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/2010-03-12-14.04.52.jpg&quot;&gt;&lt;img src=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/2010-03-12-14.04.52-150x150.jpg&quot; alt=&quot;&quot; title=&quot;合照&quot; width=&quot;150&quot; height=&quot;150&quot; class=&quot;alignnone size-thumbnail wp-image-699&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/2010-03-12-14.06.25.jpg&quot;&gt;&lt;img src=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/2010-03-12-14.06.25-150x150.jpg&quot; alt=&quot;&quot; title=&quot;真像&quot; width=&quot;150&quot; height=&quot;150&quot; class=&quot;alignnone size-thumbnail wp-image-703&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;包裝和 Hero 的很像。3.2 寸 LCD, 480x320 的解析度，200 萬畫素的相機鏡頭，CPU 是 Marvell 300 (624 MHz)，記憶體是 256 + 128 MB，支援 WIFI, Bluetooth, FM, GPS。不是使用標準的 USB 接口，但同一個接口可以接 USB、耳機、變壓器。觸控螢幕使用起來的感覺像是電容式的，反應非常靈敏，輕輕的觸摸就有反應。&lt;/p&gt;

&lt;p&gt;系統是 Android Cupcake，內建軟體有不少 Google App，最另人驚訝旳是上面有 Android Market 可以用，試著從 Market 上面下載了一些小遊戲下來玩，完全沒有問題，真是太牛了！另外一點就是有內建手寫輸入，速度不快但是準確度不錯。除此之外還有谷歌拼音可以用。&lt;/p&gt;

&lt;p&gt;測試的途中無線網路與 GPS 不是很穩，除此之外以一隻中低價位的手機來說表現的相當不錯。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/lock.png&quot;&gt;&lt;img src=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/lock-150x150.png&quot; alt=&quot;&quot; title=&quot;lock&quot; width=&quot;150&quot; height=&quot;150&quot; class=&quot;alignnone size-thumbnail wp-image-711&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/home.png&quot;&gt;&lt;img src=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/home-150x150.png&quot; alt=&quot;&quot; title=&quot;home&quot; width=&quot;150&quot; height=&quot;150&quot; class=&quot;alignnone size-thumbnail wp-image-712&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/apps.png&quot;&gt;&lt;img src=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/apps-150x150.png&quot; alt=&quot;&quot; title=&quot;apps&quot; width=&quot;150&quot; height=&quot;150&quot; class=&quot;alignnone size-thumbnail wp-image-713&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/market.png&quot;&gt;&lt;img src=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/market-150x150.png&quot; alt=&quot;&quot; title=&quot;market&quot; width=&quot;150&quot; height=&quot;150&quot; class=&quot;alignnone size-thumbnail wp-image-714&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/market2.png&quot;&gt;&lt;img src=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/market2-150x150.png&quot; alt=&quot;&quot; title=&quot;market2&quot; width=&quot;150&quot; height=&quot;150&quot; class=&quot;alignnone size-thumbnail wp-image-715&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/market3.png&quot;&gt;&lt;img src=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/market3-150x150.png&quot; alt=&quot;&quot; title=&quot;market3&quot; width=&quot;150&quot; height=&quot;150&quot; class=&quot;alignnone size-thumbnail wp-image-716&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/weather.png&quot;&gt;&lt;img src=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/weather-150x150.png&quot; alt=&quot;&quot; title=&quot;weather&quot; width=&quot;150&quot; height=&quot;150&quot; class=&quot;alignnone size-thumbnail wp-image-717&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/handwriting1.png&quot;&gt;&lt;img src=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/handwriting1-150x150.png&quot; alt=&quot;&quot; title=&quot;handwriting1&quot; width=&quot;150&quot; height=&quot;150&quot; class=&quot;alignnone size-thumbnail wp-image-718&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/handwriting2.png&quot;&gt;&lt;img src=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/handwriting2-150x150.png&quot; alt=&quot;&quot; title=&quot;handwriting2&quot; width=&quot;150&quot; height=&quot;150&quot; class=&quot;alignnone size-thumbnail wp-image-719&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/handwriting3.png&quot;&gt;&lt;img src=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/handwriting3-150x150.png&quot; alt=&quot;&quot; title=&quot;handwriting3&quot; width=&quot;150&quot; height=&quot;150&quot; class=&quot;alignnone size-thumbnail wp-image-720&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/handwriting4.png&quot;&gt;&lt;img src=&quot;http://blog.kanru.info/wp-content/uploads/2010/03/handwriting4-150x150.png&quot; alt=&quot;&quot; title=&quot;handwriting4&quot; width=&quot;150&quot; height=&quot;150&quot; class=&quot;alignnone size-thumbnail wp-image-721&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
</description>


</item>

</channel>
</rss>
