是否所有的Andr​​oid手机有内置摄像头使用了一种叫做&QUOT文件夹; DCIM"存储拍摄的图像? [英] Do all Android phones with a built-in camera use a folder called "DCIM" to store captured images?

查看:285
本文介绍了是否所有的Andr​​oid手机有内置摄像头使用了一种叫做&QUOT文件夹; 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);

我要拍摄的被保存在一个位置,与股票相机应用程序一致的图像。我可以使用DCIM文件夹,并承担所有的手机都将使用该位置?

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?

推荐答案

我会想到的是,默认的Andr​​oid摄像头应用程序将保存图像的DCIM文件夹。如果由于某种原因,手机制造商定制的Andr​​oid与其他相机的应用程序,默认位置可能会有所不同。

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.

您总是可以检查DCIM文件夹是否存在等第一,如果它不存在,有某种形式的后退位置是特定于您的应用程序。

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.

这篇关于是否所有的Andr​​oid手机有内置摄像头使用了一种叫做&QUOT文件夹; DCIM&QUOT;存储拍摄的图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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