在Android的Andr​​oid设备专用相机路径

问题描述:

我创建了一个示例应用程序,在我的应用我拍摄照片并将其保存在特定的文件夹。该应用程序成功运行在模拟器上与目标2.3.3,但在图像被存储在 /mnt/sdcard.DCIN/100ANDRO/sample.jpg $默认的文件夹移动安装时C $ C>。请告诉我怎样才能解决这个问题。

I created a sample app, in my app i capture a photo and save it in a specific folder. The app runs successfully on the emulator with target 2.3.3, but when installing it on a mobile the image gets stored in the default folder in /mnt/sdcard.DCIN/100ANDRO/sample.jpg. Please tell me how can I overcome this issue.

如果你是依靠X> = API级别8 OK,你可以使用Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM);

if you are OK with relying on x>= API level 8 you could use Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM);