2016年6月14日 星期二

Ubuntu Phone - porting - emulator

其實對 emulator 之前沒什麼研究,依official wiki 中步驟[1]抓來的 android code tree 是phablet-4.4.2_r1 [2],看來 wiki 中的 "Building from scratch" 就是抓 phablet 4.4.2_r1 來 build emulator。
如果是直接裝 ubuntu-emulator 其 dependency ubuntu-emulator-runtime.deb 就會把prebuild 的 emulator 放在下面
/usr/share/android/emulator/out/host/linux-x86/bin/emulator-x86
/usr/share/android/emulator/out/host/linux-x86/bin/emulator-arm
然後執行 "ubuntu-emulator run" 時 [2] 時再去執行相對位置的 emulator-*.

如此看來如果要把 Ubuntu emulator 升級當作一個 reference device 的話,可以拉新的 AOSP code,build 出其 emulator binary,還可以升級goldfish kernel [3] 到3.18 or 4.4.  最新的 emulator kernel 已改為 ranchu [6].

目前新的 AOSP tree 不再包含 qemu [4], 而是直接放一個 prebuilt emulator [5]所以可能需要再另外把它拉回來build。

keep updating .....
(
emulator 還不能動:
https://hackpad.com/Phablet-Ubuntu-Touch-z2FB0yq24Eq
)

[1] https://wiki.ubuntu.com/Touch/Emulator
[2] http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/wily/goget-ubuntu-touch/wily/files/head:/ubuntu-emulator/
[3] https://android.googlesource.com/kernel/goldfish.git
[4] https://android.googlesource.com/platform/external/qemu
[5] https://android.googlesource.com/platform/prebuilts/android-emulator
[6] https://groups.google.com/forum/#!topic/android-emulator-dev/dltBnUW_HzU

2016年6月11日 星期六

Ubuntu Phone - porting - tools

工欲善其事,必先利其器,知道工具在那裡並如何使用,會方便很多,這篇文章就用來收集開發時後可以用到的工具,連結等等 ... keep updating...

## Documents
 * https://wiki.ubuntu.com/Touch
  * https://wiki.ubuntu.com/Touch/MaintainingCodePhablet
  * https://wiki.ubuntu.com/Touch/ContainerArchitecture

## Docker which can be used to build AOSP/device tarball.
 * https://hub.docker.com/r/phablet/platform-devel/

## The place to file bug for Ubuntu touch.
 * https://bugs.launchpad.net/canonical-devices-system-image
 * https://bugs.launchpad.net/turbo
 * https://bugs.launchpad.net/avila
 * https://bugs.launchpad.net/arale

## The reference device Sony Z5 for android 6.x (on developing)
 * https://wiki.ubuntu.com/Touch/Devices/minato

## The phablet 6.x common tree.
 * https://code-review.phablet.ubuntu.com/#/admin/projects/aosp/platform/manifest
  * $ repo init -u ssh://<username>@code-review.phablet.ubuntu.com:29418/aosp/platform/manifest \ -b phablet-6.x && repo sync
 * https://wiki.ubuntu.com/Touch/MaintainingCodePhablet

## The server which host device images
 * Global: http://system-image.ubuntu.com/
 * China: http://cn.system-image.ubuntu.com or http://cache-origin.system-image.ubuntu.com

## Tools
 * https://github.com/alex-tu-cc/ubuntu_phone_tools

## Tips
 * How to flash Meizu Pro5 Android edition to Ubuntu?
  * I did not test this way, but it looks good to go.
  * http://askubuntu.com/questions/767323/how-to-install-ubuntu-on-meizu-pro-5-that-was-originally-with-android/767771#767771?newreg=7437cbdaadd6416ea11a98492c08df17

2016年6月7日 星期二

Ubuntu Phone - porting - 緣起

Ubuntu Phone 已經上市一段時間了,但似乎沒看到 community 在 Port 它,可能是實體手機出貨量太少,也可能是 document 不夠(沒看到中文的)導致開發者興趣缺缺,作最僅剩的第三方 phone os,不免覺得有點可惜。其實買 Ubuntu edition phone 滿划算的,因為其可以刷回 Android 版本,但 Android edition 就不行刷到 Ubuntu edition 了(主因為 Ubuntu resize partition)。

但是如果 WIDI support[1][註1] 順暢度達成後,當成一個開發阿宅的隨身小 pc[2],用來 ssh 到家中或是公司的 server ,在外面開會或是在朋友家中也可以當一個臨時的報告用小 pc 也是滿方便的,甚至有些家庭可能就不需要買文書小筆電可以在外用手機,回家變桌機。這實在是個人滿期待看到的結果。

App 生態不完整是當然不流行的一大主因,但個人認為這是鷄跟蛋的問題,就跟 Android 剛出的時後也是被笑完全跟 Iphone 沒得比,但後來也是追上來了。只要有抓到大家想要的點,自然就會有人用了。目前每次 OTA 後,所有裝過的 deb packages 都要重裝是令個人感覺比較不方便的地方,不知道有沒有什麼好方法解決。

因此,我想借這個 blog 來分享一些開發的經驗,所以留言開放大家點歌~哦不,是點主題,看有那些你很想要知道的,但一直找不到資料,我可以盡我所能(=有空的時後)的回答大家。

目前我想先分享一些 porting 上可能會遇到的問題,以及大約的架構 (說得太淺請別笑我,大家切撮指教)

其實有很多問題也可以直接上 mail list [4]上詢問,上面高手如雲。

[1] http://news.softpedia.com/news/ubuntu-touch-ota-11-update-introduces-wireless-display-support-to-ubuntu-phones-504681.shtml
[2] http://www.techrepublic.com/article/ubuntu-convergence-finally-impresses-me/
[3] https://wiki.ubuntu.com/Touch/Devices/minato
[4] https://lists.launchpad.net/ubuntu-phone/

[註1] 因為目前很多手機都將 MHL 功能拿掉,所以目前看來只有 WIDI 比較可行,不過還是有一些手機存在 MHL [3],如果可以順利 porting 完成,可能也有助於手機廠再回頭看 MHL 這塊。