我建立了一个Linphone android开源代码并在android手机上测试过。它在android手机中运行良好。但是当我在屏幕尺寸(1024 * 600)的模拟器中运行此应用程序时,它经常崩溃。我需要检查这个崩溃也发生三星Galaxy Tab 3(具体)。但目前我自己没有三星Galaxy Tab 3设备。任何人都可以为我提供完成上述工作的解决方案吗?
崩溃时这是我的logcat
03-07 10:17:38.037: E/TEST(655): Cannot start linphone
03-07 10:17:38.037: E/TEST(655): java.lang.NullPointerException
03-07 10:17:38.037: E/TEST(655): at org.linphone.LinphoneManager.startBluetooth(LinphoneManager.java:261)
03-07 10:17:38.037: E/TEST(655): at org.linphone.LinphoneManager.startLibLinphone(LinphoneManager.java:650)
03-07 10:17:38.037: E/TEST(655): at org.linphone.LinphoneManager.createAndStart(LinphoneManager.java:358)
03-07 10:17:38.037: E/TEST(655): at org.linphone.LinphoneService.onCreate(LinphoneService.java:167)
03-07 10:17:38.037: E/TEST(655): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2363)
03-07 10:17:38.037: E/TEST(655): at android.app.ActivityThread.access$1600(ActivityThread.java:130)
03-07 10:17:38.037: E/TEST(655): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1277)
03-07 10:17:38.037: E/TEST(655): at android.os.Handler.dispatchMessage(Handler.java:99)
03-07 10:17:38.037: E/TEST(655): at android.os.Looper.loop(Looper.java:137)
03-07 10:17:38.037: E/TEST(655): at android.app.ActivityThread.main(ActivityThread.java:4745)
03-07 10:17:38.037: E/TEST(655): at java.lang.reflect.Method.invokeNative(Native Method)
03-07 10:17:38.037: E/TEST(655): at java.lang.reflect.Method.invoke(Method.java:511)
03-07 10:17:38.037: E/TEST(655): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
03-07 10:17:38.037: E/TEST(655): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
03-07 10:17:38.037: E/TEST(655): at dalvik.system.NativeStart.main(Native Method)
我在评论startBluetooth()
方法
03-07 12:38:08.683: E/AndroidRuntime(825): FATAL EXCEPTION: Thread-100
03-07 12:38:08.683: E/AndroidRuntime(825): java.lang.OutOfMemoryError
03-07 12:38:08.683: E/AndroidRuntime(825): at java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:94)
03-07 12:38:08.683: E/AndroidRuntime(825): at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:145)
03-07 12:38:08.683: E/AndroidRuntime(825): at java.lang.StringBuilder.append(StringBuilder.java:216)
03-07 12:38:08.683: E/AndroidRuntime(825): at org.linphone.DialerFragment$8.run(DialerFragment.java:666)
03-07 12:38:08.683: E/AndroidRuntime(825): at java.lang.Thread.run(Thread.java:856)
答案 0 :(得分:0)
在AndroidManifest.xml文件的应用程序标记中添加以下行。由于OutOfMamoryException,您的应用程序崩溃了。这与我发生了冲突然后我在AndoridManifest.xml中将largHeap设置为true并解决了问题。
机器人:largeHeap = “真”
<application
android:debuggable="true"
android:allowBackup="true"
android:icon="@drawable/logo_linphone_57x57"
android:label="@string/app_name"
android:largeHeap="true" >
.
.
.
</application>
在你的情况下,
如果您在应用程序中不需要蓝牙音频,则在下面的代码中注释或添加异常。
startBluetooth();
startLibLinphone(Context c)
函数中的{p> LinphoneManager.java
。
试试这个。它由于蓝牙原生支持而给出错误。