由于打开相机时内存不足,phonegap android应用程序崩溃

由于打开相机时内存不足,phonegap android应用程序崩溃,第1张

概述我正在使用phonegapv1.3.0开发一个androidphonegap应用程序,我的应用程序有一个按钮,当用户单击该按钮时,将使用phonegapapi启动相机,当用户捕获图像时返回照片路径.但是发生的事情是,应用程序在相机返回之前崩溃了,因此当相机返回时,应用程序将重新启动.所以我没有得到被捕获的

我正在使用phonegap v1.3.0开发一个android phonegap应用程序,我的应用程序有一个按钮,当用户单击该按钮时,将使用phonegap API启动相机,当用户捕获图像时返回照片路径.但是发生的事情是,应用程序在相机返回之前崩溃了,因此当相机返回时,应用程序将重新启动.所以我没有得到被捕获的图像.在检查日志时,我发现启动相机后,内核将sigkill发送到我的应用程序.需要注意的一点是,当我杀死所有正在运行的应用程序然后启动我的应用程序并拍照时,它会正常返回而不会崩溃.
 这个问题类似于https://github.com/callback/phonegap/issues/5.请告诉我可能是哪里出了问题?

这是日志-https://github.com/ghostCoder/Logs/blob/master/e2o.mobile-logs.txt我的应用程序的名称是e2o.mobile

这是我manifest.xml的内容-

<?xml version="1.0" enCoding="utf-8"?><manifest xmlns:androID="http://schemas.androID.com/apk/res/androID"  package="xyz.test"  androID:versionCode="1"  androID:versionname="1.0"><supports-screens    androID:largeScreens="true"    androID:normalScreens="true"    androID:smallScreens="true"    androID:resizeable="true"    androID:anyDensity="true"    /><uses-permission androID:name="androID.permission.CAMERA" /><uses-permission androID:name="androID.permission.VIBRATE" /><uses-permission androID:name="androID.permission.INTERNET" /><uses-permission androID:name="androID.permission.ACCESS_NETWORK_STATE" /><uses-feature androID:name="androID.harDWare.camera" /><uses-feature androID:name="androID.harDWare.camera.autofocus" /><uses-permission androID:name="androID.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission androID:name="androID.permission.RECORD_AUdio" /><uses-permission androID:name="androID.permission.RECORD_VIDEO"/>  <uses-permission androID:name="androID.permission.STORAGE"/>  <application androID:deBUGgable="true" androID:icon="@drawable/icon" androID:label="@string/app_name">   <activity androID:configChanges="orIEntation|keyboardHIDden" androID:name=".Home" androID:label="@string/app_name" androID:launchMode="singletop" androID:imeOptions="actionSend|flagNoEnteraction">        <intent-filter>            <action androID:name="androID.intent.action.MAIN" />            <category androID:name="androID.intent.category.LAUNCHER" />        </intent-filter>    </activity><activity androID:configChanges="orIEntation|keyboardHIDden" androID:name="com.phonegap.DroIDGap" androID:label="@string/app_name" androID:launchMode="singletop" androID:imeOptions="actionSend|flagNoEnteraction"></activity></application><uses-sdk androID:minSdkVersion="7" /></manifest>

解决方法:

将品质参数从50降低到30可以防止相机API导致我的HTC Evo上的应用程序崩溃.

总结

以上是内存溢出为你收集整理的由于打开相机时内存不足,phonegap android应用程序崩溃全部内容,希望文章能够帮你解决由于打开相机时内存不足,phonegap android应用程序崩溃所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1094434.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-28
下一篇 2022-05-28

发表评论

登录后才能评论

评论列表(0条)

保存