所有带有内置摄像头的 Android 手机都使用名为“DCIM”的文件夹吗?存储捕获的图像?

发布于 2024-10-02 01:46:11 字数 345 浏览 0 评论 0原文

我正在开发一个应用程序,它使用手机的默认相机应用程序来捕获图像,然后允许用户执行一些基本编辑。

我使用以下代码片段...

Intentintent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
imageCaptureIntent.putExtra(MediaStore.EXTRA_OUTPUT,*<file>*);
startActivityForResult(intent, TAKE_PHOTO_CODE);

我希望将捕获的图像保存在与库存相机应用程序一致的位置。我可以使用 DCIM 文件夹并假设所有手机都将使用该位置吗?

I am developing an app which uses the phone's default camera application to capture an image and then allow the user to perform some basic editing.

I use the following snippet...

Intentintent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
imageCaptureIntent.putExtra(MediaStore.EXTRA_OUTPUT,*<file>*);
startActivityForResult(intent, TAKE_PHOTO_CODE);

I want the image captured to be saved in a location that is consistent with the stock camera application. Can I use the DCIM folder and assume all phones will use that location?

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

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

发布评论

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

评论(2

怎会甘心 2024-10-09 01:46:12

我不建议假设这样的事情,例如 Droid Incredible 有一个内部 8GB 存储空间,我不确定它如何存储内部图像,所以请检查一下。

I don't recommend assuming such a thing e.g. Droid Incredible has an internal 8GB storage and I'm not sure how it stores the images inside so check that.

累赘 2024-10-09 01:46:11

我希望默认的 Android 相机应用程序会将图像保存在 DCIM 文件夹中。如果出于某种原因,手机制造商使用不同的相机应用程序定制了 Android,则默认位置可能会有所不同。

您始终可以首先检查 DCIM 文件夹是否存在,如果不存在,则拥有某种特定于您的应用程序的“后备”位置。

I would expect that the default Android camera app will save images in the DCIM folder. If for some reason a phone manufacturer customized Android with a different camera app, the default location could be different.

You could always check for the existance of the DCIM folder first, and if it doesn't exist, have some kind of a "fall back" location that's specific to your app.

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