Android的ACTION_IM​​AGE_CAPTURE与EXTRA_OUTPUT内部存储器 [英] Android ACTION_IMAGE_CAPTURE with EXTRA_OUTPUT in internal memory

查看:261
本文介绍了Android的ACTION_IM​​AGE_CAPTURE与EXTRA_OUTPUT内部存储器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我拍摄照片从相机,如果我打电话

When I'm taking a photo from a camera if I'm calling

File file = new File(getFilesDir().getAbsolutePath() + "/myImage.jpg");
Uri outputFileUri = Uri.fromFile(file);

cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);

OK按钮相机应用程序不能正常工作,根本不执行任何操作(实际上不会保存到我提供我猜,因此应用程序本身并没有什么内部存储器)

OK button on camera app is not functioning, simply does nothing (actually won't save it to internal memory I provided I guess and therefore the app itself does nothing).

如果我打电话然而

File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/myImage.jpg");
Uri outputFileUri = Uri.fromFile(file);

cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);

一切都很好,和照片存储在SD卡。

everything is fine and photo is stored on SDCard.

我的问题是,有没有存储在捕捉照片的方式全分辨率 SD卡不?

My question is, is there a way to store capture photo in full-resolution without SDCard?

推荐答案

本机相机应用无法将图像保存在应用程序的私有内部目录,这些只适用于特定的应用程序。

The native camera app cannot save the image in your app's private internal directories as those are only available to your particular app.

相反,你可以创建自定义相机活动将图像保存到你的内部目录或你需要使用股票相机应用与外部存储设备。

Instead you can create a custom camera activity to save images to your internal directories or you need to use the stock camera app with external storage.

请注意:如果你打算创建一个自定义相机活动,确保你的目标至少2.3以上。该商标下面什么是非常困难的工作。

Note: if you plan on creating a custom camera activity make sure you target at least 2.3 and up. Anything below that mark is very difficult to work with.

这篇关于Android的ACTION_IM​​AGE_CAPTURE与EXTRA_OUTPUT内部存储器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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