Building/finding shared libraries from Android source code
android, android-ndk, java-native-interface, rtp, shared-libraries
Solution
Say I need to build a piece of native code which is going to use standard Android shared libraries such as `libutils`, `libcutlis`, `libmedia`. I would perform following steps:
- Install `AOSP` repository with target version.
- Add my source code to appropriate directories under `./frameworks/base`. In your case it might be easier to create a separate folder and put proper `Android.mk` of course.
- You might get compile errors if required functions from those standard shared libraries are not present in the previous version.
- When you build the code as part of `AOSP` it will build required libraries and link them for you automatically.
P.S. To accomplish that you're better to use a Linux-based build host.
Problem
I wish to back port the Android RTP APIs introduced in version 3.1(Honeycomb) to earlier versions. I downloaded the source of version 4.0 and found that it these APIs had both java and native code. In order to build the native code with the NDK, certain shared libraries are required. According the Android.mk file, these are `libnativehelper`, `libcutils`, `libutils`, and `libmedia`. Though the source of all of these are present in the source code, building them was difficult. Each required many other shared libraries. For eg, `libmedia` requires these shared libraries: `libui`, `libcutils`, `libutils`, `libbinder`, `libsonivox`, `libicuuc`, `libexpat`, `libcamera_client`, `libstagefright_foundation`, `libgui` and `libdl`. So my question is, is there some way of obtaining the original 4 shared libs? Does it involve building the entire source?