Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/216.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 将捕获的照片保存到内部目录以便稍后放入HashMap是否有用?_Java_Android_Bitmap - Fatal编程技术网

Java 将捕获的照片保存到内部目录以便稍后放入HashMap是否有用?

Java 将捕获的照片保存到内部目录以便稍后放入HashMap是否有用?,java,android,bitmap,Java,Android,Bitmap,我的想法是: 拍摄照片并将其保存到内部目录或模式.PRIVATE,然后使用文件将其保存到位图,然后从位图保存到Base64字符串 我用这个代码将一个图像保存到私有应用程序目录中 pictureActionIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); File imageFolder = new File(getApplicationContext().getFilesDir().getPath()+"/img/"); File ima

我的想法是:

拍摄照片并将其保存到内部目录或
模式.PRIVATE
,然后使用文件将其保存到
位图
,然后从
位图
保存到
Base64
字符串

我用这个代码将一个图像保存到私有应用程序目录中

pictureActionIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File imageFolder = new File(getApplicationContext().getFilesDir().getPath()+"/img/");
File image = new File(imageFolder,taskItems.get("uuid")+".jpg");

Uri uriSavedImage = Uri.fromFile(image);
pictureActionIntent.putExtra(MediaStore.EXTRA_OUTPUT,uriSavedImage);
startActivityForResult(pictureActionIntent, CAMERA_REQUEST);
我的目标是
Base64
字符串
,我想把它放在
HashMap

如果是,我怎么做

谢谢你的帮助


亲切的问候

为什么要将其存储在hashmap中?为什么不存储在sQlite中呢?这样,当JVM重新启动时,您就不会丢失它\因为我用映射覆盖了xml文件中的整个标记。这就是我使用hashmap的原因为什么要将其存储在hashmap中?为什么不存储在sQlite中呢?这样,当JVM重新启动时,您就不会丢失它\因为我用映射覆盖了xml文件中的整个标记。这就是我使用hashmap的原因