Droidcon India 2014

Droidcon India’s fourth edition

Hitesh Sondhi

@hiteshsondhi88

Cross compiling native Linux libraries for Android

Submitted Oct 22, 2014

Learn how to cross compile and use native linux libraries like FFmpeg/curl for Android.
The new Android Lollipop requires binaries to be PIE executables so I will also cover during the course on how to make binaries compatible with Android Lollipop.

Outline

We’ll have hands on session cross compiling native Linux libraries for Android. Will walk through the following steps during the workshop:

  1. Installing Android NDK
  2. Installing required Linux packages
  3. Basic linux compilation and how can we cross compile native Linux projects for Android.
  4. What is pkg-config, how it works on Linux and how can we use it to make our life easier while cross compiling for Android.
  5. Demonstration of compiling curl for Android.
  6. How can we make our binaries compatible with Android Lollipop (i.e Creating PIE binaries).
  7. Demonstration of compiling FFmpeg for Android.
  8. How to add more codecs/features to FFmpeg.
  9. Demonstrating use of these compiled binaries using Java.

In the end will share a shell script that would cover all the steps above and the developer can easily modify it to compile other native Linux libraries.

Requirements

  1. Basic linux knowledge.
  2. A laptop with Ubuntu 12.04, 14.04 or Debian wheezy.
  3. Basic Android Development Setup.

Optional: (Can do it during the workshop)

  1. Android NDK (https://developer.android.com/tools/sdk/ndk/index.html).
  2. FFmpeg source code (http://ffmpeg.org/releases/ffmpeg-2.4.2.tar.bz2)
  3. curl source code (https://github.com/bagder/curl/archive/curl-7_38_0.tar.gz)
  4. openssl source code (https://github.com/openssl/openssl/archive/OpenSSL_1_0_1j.tar.gz)
  5. x264 source code (ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2)

Speaker bio

Android lover, nodeJS enthusiast, hacker, coder, loves server side scripting.
I’ve been working on Android framework from last 3 years with Vinsol. I’ve worked on
various interesting apps and I am keen to share my experience with the community.

I occasionally write about my technical experience on Vinsol’s blog http://vinsol.com/blog
Android weekly published few of my blog posts in the weekly issues below:
http://androidweekly.net/issues/issue-118
http://androidweekly.net/issues/issue-119

I’ve been maintaining few open source libraries
http://hiteshsondhi88.github.io/ffmpeg-android/
http://hiteshsondhi88.github.io/ffmpeg-android-java/

Connect me on github https://github.com/hiteshsondhi88

Comments

{{ gettext('Login to leave a comment') }}

{{ gettext('Post a comment…') }}
{{ gettext('New comment') }}
{{ formTitle }}

{{ errorMsg }}

{{ gettext('No comments posted yet') }}

Hosted by

droidconIN is an annual conference on Android, part of the worldwide series of events. more