Compiling GPAC for Android

To compile GPAC for Android under Ubuntu (version >= 12.04), please execute the following steps:

1.Prerequisite

1.1.Download and unzip Android SDK

Download and unzip the latest version at http://developer.android.com/sdk/index.html.

1.2.Download and unzip NDK Android

Download and unzip the latest version at https://developer.android.com/ndk/downloads/index.html.

1.3.ANT

1.4.Get and install SDK Component for Android

Launch /tools/android. This opens a window. On the left panel, click on “Available packages”, select “Android Repository” and then “Install Selected”.

1.5. [Optional] Install Eclipse IDE

Firstly get Eclipse for java at http://www.eclipse.org/downloads/?osType=linux. Then get the ADT (Android Development Tools) plug-in in order to allow Eclipse to interact with Android tools at http://developer.android.com/sdk/eclipse-adt.html and follow the instructions. For installing Android SDK components, go to Eclipse Select Window->Preferences->Android and put the SDK directory path. Then select Window > Android SDK and AVD Managergo get the packages (Android repository packages are needed. The third party ones depends on the target devices

1.6.Get GPAC project

1.7.Links the Android SDK and NDK directories

1.8.Get all extra-libs

1.8.1. Compiling from source code

  • Get extra_libs source code from here. Then, goto /build/android and run the script:

    Note: you need to set the right to execute the script (i.e: chmod a+x) to the sh scripts if they ask

  • When the compilation finishes without error, go to <GPAC_EXTRA_DIR> and copy the compiled extra-libs into <GPAC_DIR>/extra_lib/libs/android

    1.8.2. Using pre-compiled extra-libs

    Get pre-compiled extra-libs from here

    2.Compilation

    Go to GPAC_DIR/build/android/jni and launch the script:

    By default, it will generate the package Osmo4-[VERSION]-[BRANCH].apk in GPAC_DIR (referenced as YOUR_OSMO4.apk)

    3.Debuging using adb tool

    3.1.Setup the environmental variable

    Open ~/.bashrc using an editor and add these lines to the end of it:

    You should recharge your .bashrc for updating your changes:

    3.2.Some useful commands

    First you need to connect your phone with the computer and enable Usb Debugging Mode (refer)

  • List the devices connected to this computer
  • Install GPAC to your connected device: cd to GPAC_DIR then run
  • Get the logs
  • Sometimes you can get a segmentfault exception. For dumping the error message, use the command
  • Start Osmo4 from command-line
  • 4.Common issues

  • If you have a problem with the execusing of aapt you need to install 32-bit libraries
  • GitHub issues