使用camera2与不推荐使用的Camera-最佳做法是什么? [英] Use of camera2 versus deprecated Camera - what is best practice?

查看:359
本文介绍了使用camera2与不推荐使用的Camera-最佳做法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个应用程序,对于该应用程序,相机是必不可少的功能.在这方面,我想100%地确定以下方面:

I'm writing an app for which the camera is an essential feature. In this regard I want to be 100% certain about the following aspects:

  1. 如果我使用不推荐使用的相机:该应用程序仍将在所有API上运行 现在?
  2. 如果1)是,则此应用将在什么时候停止运行 不再在所有API上使用(我的应用程序应涵盖最低API 17)?
  3. 在哪里可以找到有关2)的更新的官方信息,即计划什么以及何时计划?
  4. 说,我现在已经在使用新的camera2,我的理解是该应用会 不能在21以下的任何API上运行-对吗?
  5. 从到目前为止获得的信息中,我的工作假设是:现在仍在使用已弃用的Camera.但是请继续关注API的市场份额并尽快开始学习camera2,以便准备在未来2-3年内将应用切换到camera2.你同意吗?
  1. If I use the deprecated camera: will the app still run on all APIs now?
  2. If 1) is yes: At what point in time this app will not run anymore on all APIs (my app shall cover minimum API 17) ?
  3. Where can I find updated official information about 2), i.e. what is planned and by when?
  4. Say, I would use the new camera2 already now, my understanding is that the app would not run on any API below 21 - correct?
  5. My working hypothesis from the information I got so far is: NOW still use the the deprecated Camera. But Keep watching market shares of APIs and start learning camera2 soon, in order to be ready to switch the app to camera2 within the next 2-3 years. Do you agree?

无论如何,使用设备的摄像头并使其在几乎所有目标设备上运行都非常棘手(就目前而言,我很高兴掌握了旧"摄像头...).因此,我真的很想确定以上几点.非常感谢您的回答.

In any case, the use of a device's camera and making it run on virtually all targeted devices is tricky enough (as for now I am happy to have mastered the "old" Camera...). Therefore, I really want to be sure about the above points. Many thanks for your answers.

推荐答案

如果我使用不推荐使用的相机:该应用程序现在仍可以在所有API上运行吗?

If I use the deprecated camera: will the app still run on all APIs now?

是的

在什么时候该应用程序将不再在所有API上运行(我的应用程序应涵盖最低API 17)?

At what point in time this app will not run anymore on all APIs (my app shall cover minimum API 17) ?

建造一台时光机器,进入未来,寻找答案,并让我们其他人知道.

Build a time machine, go into the future, find out, and let the rest of us know.

IOW,我们无法预测Google是否以及何时完全停止使用此API.话虽如此,他们几乎从未停止使用API​​.

IOW, we have no way of predicting if and when Google might discontinue this API entirely. That being said, they almost never discontinue APIs.

我在哪里可以找到有关2)的最新官方信息,即计划什么以及何时计划?

Where can I find updated official information about 2), i.e. what is planned and by when?

在Google找工作,或者选择上述的时光机选项. Google不习惯于提前宣布计划,他们的时间机器无法出租.

Get a job with Google, or go with the aforementioned time machine option. Google is not in the habit of announcing plans in advance, and their time machine is not available for rental.

(尽管埃隆·马斯克(Elon Musk)可能有一辆配备融合先生的特斯拉,所以你可以联系他...)

(though Elon Musk probably has a Tesla outfitted with a Mr. Fusion, so you could reach out to him...)

我现在已经使用了新的camera2,我的理解是该应用程序无法在低于21的任何API上运行-是吗?

I would use the new camera2 already now, my understanding is that the app would not run on any API below 21 - correct?

正确.

现在仍然使用不推荐使用的相机.但是请继续关注API的市场份额,并尽快开始学习camera2,以便准备在未来2-3年内将应用程序切换到camera2.你同意吗?

NOW still use the the deprecated Camera. But Keep watching market shares of APIs and start learning camera2 soon, in order to be ready to switch the app to camera2 within the next 2-3 years. Do you agree?

不,出于某些原因,我将在您下一次引用后进行澄清.

No, for reasons I will clarify after your next quote.

使用设备的摄像头并使其在几乎所有目标设备上运行都非常棘手

the use of a device's camera and making it run on virtually all targeted devices is tricky enough

这种棘手的部分原因是设备制造商拥有相机的实施方式,这些实施方式可能被形容为古怪".

Part of that trickiness is the fact that device manufacturers have camera implementations that might be generously described as "quirky".

仅保留旧相机API的问题在于,我希望该API的质量控制稳定下降.设备制造商主要用于相机的有限资源将专门用于新API.

The problem with sticking with the old camera API exclusively is that I expect quality control on that API to steadily decline. What limited resources device manufacturers have for cameras primarily will be devoted to the new API.

因此,我的建议是同时使用两个API:在可能的情况下使用camera2,并在需要时使用原始API.诚然,这需要大量工作.如果您无权进行此工作,那么您别无选择,只能坚持使用原始相机API,直到准备好将minSdkVersion设为21+为止.

Hence, my recommendation is to use both APIs: using camera2 where possible and falling back to the original API where needed. Admittedly, this requires substantially more work. If you are not in position to do that work, then you have no choice but to stick with the original camera API until such time as you are ready to have your minSdkVersion be 21+.

这篇关于使用camera2与不推荐使用的Camera-最佳做法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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