电话间隙和Android 相机 API 问题 - 没有返回图像数据

发布于 2024-12-27 06:15:43 字数 987 浏览 0 评论 0原文

我在使用 Phonegap 和 Android Camera API 时遇到一些问题。我可以让它在一台设备上工作,但不能在另一台设备上工作。我听说许多其他人面临类似的问题,没有图像数据从设备的相机返回到 JavaScript。

我尝试使用此处的示例应用程序代码: http ://docs.phonegap.com/en/1.3.0/phonegap_media_capture_capture.md.html#capture.captureImage

我有两个物理设备在原始摩托罗拉 Droid 和摩托罗拉 Droid 3 上进行测试。

在摩托罗拉 Droid 上,该应用程序运行完美,图像被捕获并顺利返回到我的应用程序。

然而,使用 Droid 3 则是另一回事。我可以毫无问题地启动相机,拍照,然后单击“完成”并返回应用程序。唯一的问题是,图像数据永远不会随之显示。

在过去的一天中,我听到/读到了很多关于此问题的内容,我认为这些内容可能与该问题有关:

  1. 摩托罗拉在 Droid 3 中包含了一个非常糟糕的手机应用程序,这可能会导致性能问题。

  2. Droid 3 尝试返回的图像质量太高(因此文件太大),JavaScript 无法处理。 (无法在 Droid 3 的库存相机上设置图像的分辨率。)

  3. 该应用程序在收到图像数据后会立即“重新加载”自身(可能是因为它太大?),因此,当它再次加载,一秒钟前的图像数据不再存在。

现在我只会继续开发并继续在旧设备上进行测试,但这确实是我感觉不太好的事情。我知道 Droid 3 并不是唯一面临这些问题的设备,而且因为我对使用 Phonegap 开发简单但商业的应用程序很感兴趣,所以我的应用程序能够跨设备无缝运行对我来说非常重要。

I am having some problems with Phonegap and the Android Camera API. I can get it to work on one device, but not another.. I have heard of many others facing similar issues with no image data being returned to javascript from a device's camera.

I am attempting to use the sample app code from here: http://docs.phonegap.com/en/1.3.0/phonegap_media_capture_capture.md.html#capture.captureImage

I have two physical devices I am testing on, an original Motorola Droid, and a Motorola Droid 3.

On the Motorola Droid, the app works perfectly and the image is captured and returned to my app without a hitch.

Using the Droid 3 however, is a different story. I can launch the camera no problem, take the picture, and then click "Done" and return to the app. The only issue is, the image data never shows up with it.

I have heard/read many things in the past day concerning this issue that I think may be related to the problem:

  1. Motorola included a really poor stock phone app with the Droid 3, and this could be causing performance issues.

  2. The image attempting to be returned by the Droid 3 is too high quality (and as a result too big of a file) for javascript to handle. (There is no way to set the resolution of images on the Droid 3's stock camera.)

  3. The app is "reloading" itself instantaneously after receiving the image data (perhaps because it is too big?) and as a result, when it loads again, the image data from just a second ago no longer exists.

For now I will just push onward with development and continue to test on the old device, but this is really something that I am not feeling good about. I know that the Droid 3 is not the only device to face these issues, and because I am interested in developing simple but commercial apps with Phonegap, this is very important to me that my application will work seamlessly across devices.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

春庭雪 2025-01-03 06:15:43

您是否可以使用相机 API(与捕获API)并将质量参数调低?

Are you able to use the Camera API (versus the Capture API) and adjust the quality parameter lower?

山川志 2025-01-03 06:15:43

显然,答案是,这是多款摩托罗拉设备的问题,因为手机中内置了一些臃肿的软件,可能是 moto-blur。

在用户捕获图像数据后(在这些设备中),相机应用程序永远不会触发将图像数据返回到应用程序的事件。

我现在将其设置为正确答案,如果有人稍后发现此问题并更新了信息或解决方法,我会很乐意更新它,只需给我发消息:)

Apparently the answer is that it's an issue with several Motorola devices due to some bloatware that is built into the phone, maybe moto-blur.

The camera app never fires an event returning the image data back to the app after the user captures it (in these devices).

I'm setting this as the correct answer for now, if someone finds this later on and has updated information or a workaround, I will gladly update it, just message me :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文