Skip to content
This repository has been archived by the owner on Sep 30, 2018. It is now read-only.

Commit

Permalink
[droid] update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Cory Fields committed Jul 14, 2012
1 parent 8c4245c commit 5f580b8
Showing 1 changed file with 14 additions and 53 deletions.
67 changes: 14 additions & 53 deletions docs/README.android
Expand Up @@ -14,9 +14,9 @@ TOC
-----------------------------------------------------------------------------

We currently recommend Ubuntu Natty (11.04) or later. Current work has been
done here.
done here. Additionally, building from OSX Snow Leopard is working.

NOTE TO NEW LINUX USERS: All lines that are prefixed with the '#'
NOTE TO NEW USERS: All lines that are prefixed with the '#'
character are commands that need to be typed into a terminal window /
console (similar to the command prompt for Windows). Note that the '#'
character itself should NOT be typed as part of the command.
Expand Down Expand Up @@ -67,19 +67,7 @@ Install at least the following packages:
- SDK Platform

--------------------------------------------------------------------
2.3. Creating an Android Virtual Device
--------------------------------------------------------------------

In the Android SDK Manager (see 2.2) go to Tools -> Manage AVDs...
to open the Android Virtual Device Manager. Click on "New..." to
create a new Android Virtual Device (AVD). Enter a name (<avd-name>)
and select "Android 2.3.3 - API Level 10" as the Target. For the
"SD Card Size" choose at least 512 MB. In the "Hardware" part specify
at least "256" MB for "Device ram size". Click on "Create AVD" to
create your AVD.

--------------------------------------------------------------------
2.4. Setup the Android toolchain
2.3. Setup the Android toolchain
--------------------------------------------------------------------

To be able to compile XBMC and the libraries it depends on for the
Expand Down Expand Up @@ -125,7 +113,7 @@ the libc.so there. (where <android-toolchain>/android-<x>/ is the path you have
4. Installing the required Ubuntu packages
-----------------------------------------------------------------------------

# sudo apt-get install git-core make g++ gcc cvs rpl TODO
# sudo apt-get install build-essential

If you run a 64bit operating system you will also need to get ia32-libs

Expand Down Expand Up @@ -164,6 +152,9 @@ on with the Android toolchain and creating an Android Application Package
This build was designed to be massively parallel. Don't be afraid to
give it a 'make -j20' or so.

Verify that all deps built correctly (it will tell you so) before
continuing. You will get crazy build errors otherwise.

--------------------------------------------------------------------
5.2. Building XBMC
--------------------------------------------------------------------
Expand All @@ -172,36 +163,18 @@ on with the Android toolchain and creating an Android Application Package
# make -C tools/android/depends/xbmc

After the first build (assuming bootstrap and configure are successful),
subsequent builds can be run with a simple 'make'.

--------------------------------------------------------------------
5.3. Building the APK
--------------------------------------------------------------------

# cd $HOME/xbmc-android/tools/android/packaging
# make

This will create the debug APK named "xbmcapp-debug.apk" in the
"images" sub-directory
subsequent builds can be run with a simple 'make' and 'make apk'.

-----------------------------------------------------------------------------
6. Installing XBMC in an Android system
-----------------------------------------------------------------------------

To install XBMC through the previously built APK in an Android system you can
either install it on a real device (smartphone/tablet/...) running Android
2.3.x or use the Android emulator and the previously created AVD.

--------------------------------------------------------------------
6.1. Installing XBMC in the Android emulator
--------------------------------------------------------------------

# cd $HOME/xbmc-android/tools/android/packaging
# emulator-arm -avd <avd-name> -wipe-data &
# adb install images/xbmcapp-debug.apk
>= 2.3.x.

--------------------------------------------------------------------
6.2. Installing XBMC on the Android device
6.1. Installing XBMC on the Android device
--------------------------------------------------------------------

Make sure your Android device is connected to your computer through
Expand All @@ -213,7 +186,7 @@ device's Android settings:

# cd $HOME/xbmc-android/tools/android/packaging
# adb devices
# adb -s <device-id> install images/xbmcapp-debug.apk
# adb -s <device-id> install -r images/xbmcapp-debug.apk

The <device-id> can be retrieved from the list returned by the
"adb devices" command and is the first value in the row representing
Expand Down Expand Up @@ -254,23 +227,11 @@ using gdb directly, you will need to use ndk-gdb which wraps it. Do NOT trust
the -p/--project switches, as of ndk7b they do not work. Instead you will need
to cd to tools/android/packaging/xbmc and execute it from there.

# ndk-gdb --start
# ndk-gdb --start --delay=0

This will open the installed version of XBMC and break. The warnings can be
ignored as we have setup the appropriate paths already.

Caveats:

- Anything related to dlopen'd libs is hit or miss. Not good when libxbmc.so is
run that way. Basic functionality works, though be aware that breakpoints may
not be reliable yet.

- Timings during the first second or two can be strange because gdb doesn't
know when we're actually into xbmc. For example, a breakpoint set for
android_init will likely never be hit. Use of ndk-gdb's --delay switch may
help.


--------------------------------------------------------------------
8. Architecture
--------------------------------------------------------------------
Expand Down Expand Up @@ -305,7 +266,7 @@ approach of modifying the binary and blanking out the versions.
See here for more info:
http://www.bernawebdesign.ch/byteblog/2011/11/23/creating-non-versioned-shared-libraries-for-android/

As a final gotcha, all libs must be in the form of ^lib*.so$ with no
As a final gotcha, all libs must be in the form of ^lib.*so$ with no
exceptions (they won't even install otherwise), and the soname must match.
So we have to do some renaming to get some of our self-built libs loaded.

Expand All @@ -330,7 +291,7 @@ is 'tools/android/packaging' and that the proper sdk/ndk paths are set.
# adb -e install -r images/xbmcapp-debug.apk

-Launch XBMC on the emulator without the GUI
# adb shell am start -a android.intent.action.MAIN -n org.xbmc/android.app.NativeActivity
# adb shell am start -a android.intent.action.MAIN -n org.xbmc.xbmc/android.app.NativeActivity

-Kill a misbehaving XBMC
# adb shell ps | grep org.xbmc | awk '{print $2}' | xargs adb shell kill
Expand Down

0 comments on commit 5f580b8

Please sign in to comment.