PhoneGap的在Android 4.1.2相机死机,三星Galaxy S3,HTC [英] Phonegap camera crash on android 4.1.2, samsung galaxy s3, HTC

查看:145
本文介绍了PhoneGap的在Android 4.1.2相机死机,三星Galaxy S3,HTC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想很多开发者都使用熟悉并且PhoneGap的崩溃这个问题/在Android 4.1.2得到一个图片从相机/库后重新启动。

许多解决方案的许多搜索后,我希望把一些为了这个问题,我希望你能帮助我了解什么是当前的解决方案。注:当前稳定的PhoneGap版本是2.9.0。


  1. 使用了fileURI且没有dataURL,因为EN codeD Base64是太大的DOM处理。


  2. 编辑(不通过的PhoneGap构建config.xml文件)Android清单文件,并添加下面一行到每一次活动:



 的android:alwaysRetainTaskState =真正的机器人:launchMode =singleTask。



  1. 限制使用targetWidth / targetHeight分辨率,因为图片太大导致内存过载。而降低质量。


  2. 关掉



  

不要让actitivies


在Android设置选项..这是ofcourse不是一个真正的解决方案becaues我们不能要求用户这样做。


  1. 同样,编辑Android清单(与丢弃的PhoneGap构建服务),并添加:


 的android:configChanges =方向| keyboardHidden |键盘|屏幕尺寸|区域<使用特征的android:NAME =android.hardware.camera机器人:所需=FALSE/><采用-SDK安卓的minSdkVersion =7机器人:targetSdkVersion =10/><活动机器人:configChanges =方向| keyboardHidden/>



  1. 使用外接摄像头插件(不的PhoneGap的):

链接到所有这些解决方案在这里:
<一href=\"http://community.phonegap.com/nitobi/topics/phonegap_camera_crash_on_android_4_1_2_samsung_galaxy_s3_htc\" rel=\"nofollow\">http://community.phonegap.com/nitobi/topics/phonegap_camera_crash_on_android_4_1_2_samsung_galaxy_s3_htc

现在..
该文献综述之后..有谁知道哪个组合的作品?
请大家帮忙!


解决方案

我有一个类似的问题。
你需要以下得到这个工作:
确保使用特征标签后,会出现应用程序标签。

 &LT;使用特征的android:NAME =android.hardware.camera机器人:所需=FALSE/&GT;
&LT;使用特征的android:NAME =android.hardware.camera.autofocus机器人:所需=FALSE/&GT;&lt;应用
......

我希望这个解决您的问题。

I think a lot of developers are familier with this problem of phonegap crashes/restarts after getting a picture from camera / library on android 4.1.2.

After many searches of many solutions I want to put some order into this problem and I wish you could help me understand what is the current solution. Note: the current stable phonegap version is 2.9.0.

  1. Using fileURI and not dataURL, because the encoded base64 is too big for the DOM to handle.

  2. Editing (not via phonegap build config.xml) the android manifest file and add the following line to every activity:

android:alwaysRetainTaskState="true" android:launchMode="singleTask".

  1. Limit the resolution using targetWidth/targetHeight, because the image is to big which causes memory over load. and reducing quality..

  2. Switch off the

"Do not keep actitivies"

option in android settings.. which is ofcourse not a real solutions becaues we can't ask users to do that..

  1. Again, editing the android manifest (with discarding phonegap build service) and add:

android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale"

<uses-feature android:name="android.hardware.camera" android:required="false"/>

<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="10"/>

<activity  android:configChanges="orientation|keyboardHidden" />

  1. Using an external camera plugin (not phonegap's):

links to all these solutions are here: http://community.phonegap.com/nitobi/topics/phonegap_camera_crash_on_android_4_1_2_samsung_galaxy_s3_htc

Now.. After this literature review.. Does anyone know which combination works? please help!

解决方案

I had a similar problem. You require the following to get this to work: Make sure "uses-feature" tag appears after "application" tag.

<uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>

<application 
......

I hope this resolves your issue.

这篇关于PhoneGap的在Android 4.1.2相机死机,三星Galaxy S3,HTC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆