PhoneGap的Andr​​oid应用程序在开启相机由于轰然低内存应用程序、内存、相机、PhoneGap

2023-09-07 16:11:37 作者:心安伴我暖

我使用PhoneGap的V1.3.0 我的应用程序有一个按钮,点击后启动使用PhoneGap的API的摄像头,当返回的光路,当用户拍摄图像开发一个Android PhoneGap的应用程序。 但正在发生的事情是,应用程序崩溃,相机返回之前,所以当相机返回时,应用程序将重新启动。所以,我不明白这是拍摄的图像。 关于检查我看到籽粒发送日志 SIGKILL 以我的应用程序相机推出之后。 要注意的一点是,当我杀死所有运行的应用程序,然后开始我的应用程序,并把它正常返回而不应用程序崩溃的画面。 这个问题类似于 https://github.com/callback/phonegap/issues/5 请告诉我有什么可以去错了吗?

下面是日志 - 的https:/ /github.com/ghost$c$cr/Logs/blob/master/e2o.mobile-logs.txt 我的应用程序的名称是e2o.mobile

下面是我的manifest.xml的内容 -

 < XML版本=1.0编码=UTF-8&GT?;
<舱单的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
  包=xyz.test
  安卓版code =1
  机器人:VERSIONNAME =1.0>


<支持屏
    机器人:largeScreens =真
    机器人:normalScreens =真
    机器人:smallScreens =真
    机器人:调整大小=真
    机器人:anyDensity =真
    />


<使用-权限的Andr​​oid:名称=android.permission.CAMERA/>
<使用-权限的Andr​​oid:名称=android.permission.VIBRATE/>
<使用-权限的Andr​​oid:名称=android.permission.INTERNET对/>
<使用-权限的Andr​​oid:名称=android.permission.ACCESS_NETWORK_STATE/>
<使用特征的android:NAME =android.hardware.camera/>
<使用特征的android:NAME =android.hardware.camera.autofocus/>
<使用-权限的Andr​​oid:名称=android.permission.WRITE_EXTERNAL_STORAG​​E/>
<使用-权限的Andr​​oid:名称=android.permission.RECORD_AUDIO/>
<使用-权限的Andr​​oid:名称=android.permission.RECORD_VIDEO/>
<使用-权限的Andr​​oid:名称=android.permission.STORAG​​E/>



<应用机器人:可调试=真正的机器人:图标=@可绘制/图标机器人:标签=@字符串/ APP_NAME>
   <活动机器人:|:家configChanges =方向keyboardHidden机器人的名字=机器人:标签=@字符串/ APP_NAME机器人:launchMode =singleTop机器人:imeOptions =actionSend | flagNoEnterAction>
        <意向滤光器>
            <作用机器人:名称=android.intent.action.MAIN/>
            <类机器人:名称=android.intent.category.LAUNCHER/>
        &所述; /意图滤光器>

    < /活性GT;

<活动机器人:configChanges =方向| keyboardHidden机器人:NAME =com.phonegap.DroidGap机器人:标签=@字符串/ APP_NAME机器人:launchMode =singleTop机器人:imeOptions =actionSend | flagNoEnterAction&GT ;


< /活性GT;
< /用途>
<使用-SDK安卓的minSdkVersion =7/>
< /舱单>
 

解决方案

尽量缩小图像尺寸与targetWidth和targetHeight。 使用DestinationType FILE_URI。

I am developing an android phonegap app using phonegap v1.3.0 My app has a button which when clicks launches the camera using the phonegap api, when returns the photo path when the user captures the image. But what is happening is that the app crashes before the camera returns, so when the camera returns, the app is restarted. So I dont get the image which was captured. On checking the logs I see that the kernal sends sigkill to my app after the camera is launched. A point to note is that when I kill all the running apps and then start my app and take a picture it returns normally without the app crashing. This issue is similar to https://github.com/callback/phonegap/issues/5 Please tell me what could be going wrong?

Here are the logs - https://github.com/ghostCoder/Logs/blob/master/e2o.mobile-logs.txt the name of my app is e2o.mobile

Here are the contents of my 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>

解决方案

Try to reduce image size with targetWidth and targetHeight. Use DestinationType FILE_URI.