Sunday, July 29, 2012

XBMC for Android on MK802

XBMC announce XBMC for Android.
不過並不打算放上Google Play, 需要自行compile及打包, 方法可參考:
Build XBMC for Android on lubuntu 12.04

在此記錄一下目前在MK802跑起來的情況.
MK802介紹可參考:

Android 4.0 mini PC 最小的主機MK802

CPU : Allwinner A10 - ARM Cortex A8 SoC

GPU : ARM Mali 400
RAM : 1GB
以公定價$79USD及讓人跌破眼鏡的入手價, 拿來玩真是夠本了.
這次是要用Android 手機來控制 XBMC, 因為MK802沒有IR只能用滑鼠操作上有些不便.
Google Play上有Official XBMC Remote可直接下載來用.
中文設定: 切換到Appearance -> Setting -> International -> Language
為了能透過HTTP連到MK802的XBMC, 需要將"網站伺服"的功能打開, 設定port number
接著查看IP, 設定手機上的XBMC Remote如下:
連線成功就會出現控制選項
用手機上"Remote Control" Navigation, 測試播放USB裡的影片,
影片開播後選手機上的"Now Playing", 可以做seek, FF/FB功能,
音量控制是使用手機上的音量鍵.(當初還因為無法控制音量煩腦, 沒想到直接用就可以...冏)
播放online radio, 用的是SKY.FM, 可以到"附加元件"中下載安裝.
音樂Full screen播放, 可以看到背景的GL動畫還可以跑到31fps, 似乎還OK.
天氣+音樂播放, 後面的GL動畫還是正常顯示, 並不是靜態的.

後記:
1. 透過附加元件下載安裝的YouTube及Time.com無法正常播放video.
2. 很吃記憶體大約要吃掉80MB.
3. 研究XBMC在Android 如何implement, 應該是很有趣的.必竟XBMC是用自己的GUI系統, 還要克服Bionic libc在dlopen的不足之處. 


Update:
XBMC APK 下載
APK修改的部份:
1. 修正中文無法顯示問題.
2. 客制開機畫面及背景圖

Saturday, July 28, 2012

Build XBMC for Android on lubuntu 12.04


1. install required packages
# sudo apt-get install build-essential default-jdk git curl autoconf \
   unzip zip zlib1g-dev gawk gperf

2. Getting the Android SDK and NDK
crystax-5 NDK with enabled support of C++ exceptions, RTTI and Standard C++ Library 

3.Installing Android SDK packages
<android-sdk> : $HOME/XBMC_Project/android-sdk-linux
# cd <android-sdk>/tools
# ./android update sdk -u -t platform,platform-tool

4.Setup the Android toolchain
<android-ndk> :  $HOME/XBMC_Project/android-ndk-r8b
<android-toolchain> :  $HOME/XBMC_Project/android_toolchain/android-9
# cd <android-ndk>
# ls platforms
# cd build/tools
# ./make-standalone-toolchain.sh --ndk-dir=../../ \
  --install-dir=<android-toolchain>/android-9 --platform=android-9

5. Create a (new) debug key to sign debug APKs
All packages must be signed. The following command will generate a
self-signed debug key. If the result is a cryptic error, it
probably just means a debug key already existed, no cause for alarm.

# keytool -genkey -keystore ~/.android/debug.keystore -v -alias \
  androiddebugkey -dname "CN=Android Debug,O=Android,C=US" -keypass \
  android -storepass android -keyalg RSA -keysize 2048 -validity 10000

6. Getting the source code
# cd $HOME/XBMC_Project
# git clone git://github.com/xbmc/android.git xbmc-android-git
# cd xbmc-android-git
# git submodule update --init addons/skin.touched

7.Building dependencies
# cd $HOME/XBMC_Project/xbmc-android-git/tools/android/depends
# ./bootstrap
# ./configure --help
#export XBMC_ANDROID_NDK=~/XBMC_Project/android-ndk-r7-crystax-5.beta2
#export XBMC_ANDROID_SDK=~/XBMC_Project/android-sdk-linux
#export XBMC_ANDROID_TARBALLS=~/XBMC_Project/xbmc-tarballs
#./configure --with-toolchain=~/XBMC_Project/android-toolchain/android-9
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for main in -lz... yes
checking for unzip... yes
checking for zip... yes
checking for curl... /usr/bin/curl
checking for tar... /bin/tar
checking for -gcc... no
configure: WARNING: host was not specified. guessing.
checking for gcc... /home/oopsmonk/XBMC_Project/android-toolchain/android-9/arm-linux-androideabi/bin/gcc
        toolchain:       /home/oopsmonk/XBMC_Project/android-toolchain/android-9
        cpu:             armeabi-v7a
        host:            arm-linux-androideabi
        sdk-platform:    android-10
configure: creating ./config.status
config.status: creating Makefile
config.status: creating Makefile.include
#make -j4
make[1]: Leaving directory `/home/oopsmonk/XBMC_Project/xbmc-android-git/tools/android/depends/libssh'
Dependencies built successfully.

8.Building XBMC
#cd ~/XBMC_Project/xbmc-android-git/tools/android/depends/xbmc
#make -j4
APK location : ~/XBMC_Project/xbmc-android-git/xbmcapp-armeabi-v7a-debug.apk
Enjoy it !!

Ref: