Linphone库

时间:2015-03-12 16:31:49

标签: nullpointerexception static-libraries linphone

Linphone现在提供带有.jar文件的SDK和带有.so库的三个文件夹。 我如何在eclipse中使用这些文件?我已经尝试将这些文件复制到libs文件夹并添加jar依赖项,但是当我第一次在我的代码中使用libphone对象时,我得到一个空指针异常。我该如何解决这个问题?

我使用的是Windows 7 64位和Windows 8

提前致谢

1 个答案:

答案 0 :(得分:0)

将linphone.jar放入libs文件夹

ProjectRoot>app>libs>linphone.jar

将包含.so文件的所有其他文件夹放入

ProjectRoot>app>src>main>jniLibs

并在清单文件中包含这些权限

    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <!-- Needed to allow Linphone to install on tablets, since android.permission.CALL_PHONE implies android.hardware.telephony is required -->
    <uses-feature
        android:name="android.hardware.telephony"
        android:required="false" />

    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <!-- Needed to allow Linphone to install on tablets, since android.permission.CAMERA implies android.hardware.camera and android.hardware.camera.autofocus are required -->
    <uses-feature
        android:name="android.hardware.camera"
        android:required="false" />

    <uses-permission android:name="android.permission.READ_LOGS" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <!-- Needed to store received images if the user wants to -->
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <!-- Needed to use our own Contact editor -->
    <uses-permission android:name="android.permission.WRITE_CONTACTS" />
    <!-- Needed to route the audio to the bluetooth headset if available -->
    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.BROADCAST_STICKY" />
    <!-- Needed to pre fill the wizard email field (only if enabled in custom settings) -->
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
    <uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
    <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
    <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />

现在你已经完成了设置。

从这里开始使用linphone文档

Linphone's Java Wrapper Documentation

和原生支持

Liblinphone C API documentation

要开始使用,我建议您先实施LinphoneCoreListener