Requirements

Fisrt of all, install the Android SDK from the official site. Then run the android binary and install the following:

  • Android SDK Tools
  • Android SDK Platform-tools
  • Android SDK Build-tools
  • An Android SDK platform (at the time I'm writing this, the latest one is Android 5.1.1 - API 22)

Building Liblinphone

Here are the steps to build liblinphone on Android.

Create your project

Create a directory for your new project, then, create your project. You can either use the assistant from your IDE (Eclipse or Android Studio), or the command line:

android create project -n [project_name] -t [target_android_version] -p [path_to_project_dir] -k [package_name] -a [default_activity_name]

If you do create your project using the command line, you can still import it in your IDE.
For Eclipse , go to File -> Import -> Android - Existing Android Code Into Workspace.

Download our SDK

You can download a zip with the latest linphone SDK for Android.

If you don't plan on doing any video, you can use a smaller SDK.

Unzip it in the root folder of your project (next to the AndroidManifest.xml file).

Your project might already contain a libs directory, in that case, just merge the two of them.

Configure your project

Putting the jar in the libs/ directory should be enough. 

If for some reason it's not (for example if you decided to put the jar in another folder), just add the jar in your build path.

In Eclipse, right click on your project -> Properties -> Java Build Path -> Libraries -> Add JARs... -> and select the linphone.jar file.

You can try your setup by trying to import the LinphoneCore for example:
<code>
import org.linphone.core.LinphoneCore;
</code>

How to use the SDK

There is a [http://www.linphone.org/docs/liblinphone-javadoc documentation (javadoc)] of the methods wrapped above the linphone C layer to be used in your Android application available.

You can also download the source code of Linphone Android (see the Source Code part of [http://www.linphone.org/technical-corner/linphone/downloads this page]) and take a look either at the LinphoneMini project in the sample/ folder or at the tutorials in the submodules/linphone/coreapi/help/java/org/linphone/core/tutorials/ folder.

Compile and run

Nothing specific to do, just compile it as a normal Android application (on Eclipse, right click on the project -> Run as -> Android Application).

Troubleshooting

[http://www.linphone.org/docs/liblinphone-javadoc/org/linphone/core/LinphoneCoreFactory.html#setDebugMode(boolean,%20java.lang.String) Activate debug traces]

To get debug traces from adb:
<code> adb logcat </code>

To get symbolicated stack trace from adb, use:
<code> adb logcat -d | ndk-stack -sym obj/local/`adb shell getprop ro.product.cpu.abi | tr -d '\r'` /<code>