Android 需要将图像保存到手机存储器(不是SD卡)的gallery文件夹中
我需要在手机菜单的默认gallery文件夹(不是SD卡)中创建一个文件夹。之后,我需要使用相机将图像保存到文件夹(在gallery文件夹中创建) 问题是我可以在SD卡中找到默认的galley文件夹,我可以创建文件夹并将图像保存到其中Android 需要将图像保存到手机存储器(不是SD卡)的gallery文件夹中,android,Android,我需要在手机菜单的默认gallery文件夹(不是SD卡)中创建一个文件夹。之后,我需要使用相机将图像保存到文件夹(在gallery文件夹中创建) 问题是我可以在SD卡中找到默认的galley文件夹,我可以创建文件夹并将图像保存到其中 但是使用手机内存,我看不到默认的gallery文件夹。是否可以在手机内存中查看gallery文件夹。以及如何创建文件夹并将图像保存到其中 这一行在gallery中添加您的图像: MediaStore.Images.Media.insertImage(getConte
但是使用手机内存,我看不到默认的gallery文件夹。是否可以在手机内存中查看gallery文件夹。以及如何创建文件夹并将图像保存到其中 这一行在gallery中添加您的图像:
MediaStore.Images.Media.insertImage(getContentResolver(), yourBitmap, yourTitle , yourDescription);
请注意,您还必须添加
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
对于manifext.xml,您可以创建文件夹并将图像保存到内部存储器(手机存储器)中。但是,任何人都无法看到这些文件夹以及图像。这就是android内部内存的用途尝试在内部内存中创建如下文件夹
To create and write a private file to the internal storage:
1. Call openFileOutput() with the name of the file and the operating mode. This returns a FileOutputStream.
2. Write to the file with write().
3. Close the stream with close().
For example:
String FILENAME = "hello_file";
String string = "hello world!";
FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);
fos.write(string.getBytes());
fos.close();
Refer the link...............
http://developer.android.com/guide/topics/data/data-storage.html#filesInternal
File mydir = context.getDir("mydir", Context.MODE_PRIVATE);
File fileWithinMyDir = new File(mydir, "myfile");
FileOutputStream out = new FileOutputStream(fileWithinMyDir);
然后,在文件夹中保存文件时,给出该目录的路径并检查O/p