Commit e06597c5 authored by Adrien Maglo's avatar Adrien Maglo

Add a JNI library that can call libvlc functions.

For now, it is easier to compile it with the Android NDK.
parent 0309fb42
#!/bin/sh
if [ "x$1" = "x" ]; then
echo "Give the ndk path"
exit 1
fi
ANDROID_NDK=$1
cd libvlcjni
$ANDROID_NDK/ndk-build
cp -v libs/armeabi/libvlcjni.so ../vlc-android/libs/armeabi/
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libvlcjni
LOCAL_SRC_FILES := libvlcjni.c
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../../../include
LOCAL_LDLIBS := $(LOCAL_PATH)/../../vlc-android/libs/armeabi/libvlc.so
include $(BUILD_SHARED_LIBRARY)
#include <string.h>
#include <jni.h>
#include <vlc/libvlc.h>
jstring Java_vlc_android_vlc_getLibvlcVersion(JNIEnv* env, jobject thiz)
{
return (*env)->NewStringUTF(env, libvlc_get_version());
}
......@@ -18,8 +18,9 @@ public class vlc extends Activity {
{
System.loadLibrary("vlccore");
System.loadLibrary("vlc");
System.loadLibrary("vlcjni");
tv.setText("Yes, we have successfully loaded libVLC!");
tv.setText("Loaded libVLC version:" + getLibvlcVersion());
}
catch (UnsatisfiedLinkError e)
{
......@@ -28,4 +29,6 @@ public class vlc extends Activity {
setContentView(tv);
}
public native String getLibvlcVersion();
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment