0

I want to create a folder to save a copy of an image from gallery to use it from my Directory

I have tried a lot for how to save the image inside the folder and how to use it back.

The folder must be Private Folder so that only my app can access it.

Vikasdeep Singh
  • 20,983
  • 15
  • 78
  • 104
Jehad
  • 472
  • 2
  • 10
  • 24
  • I think you are looking for this http://stackoverflow.com/questions/17674634/saving-images-to-internal-memory-in-android – Su_race Dec 14 '14 at 09:43
  • Please provide the relevant parts of your code that you have tried to achieve your aims. – D-Dᴙum Dec 14 '14 at 10:54

2 Answers2

0

you can save files directly on the device's internal storage. By default, files saved to the internal storage are private to your application and other applications cannot access them (nor can the user). When the user uninstalls your application, these files are removed. For example:

http://developer.android.com/guide/topics/data/data-storage.html#filesInternal

String FILENAME = "hello_file";
String string = "hello world!";
FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);
fos.write(string.getBytes());
fos.close();

MODE_PRIVATE will create the file (or replace a file of the same name) and make it private to your application. Other modes available are: MODE_APPEND, MODE_WORLD_READABLE, and MODE_WORLD_WRITEABLE.

it's take from: How to create private folder in sdcard

Community
  • 1
  • 1
Miki Franko
  • 687
  • 3
  • 7
0

You might want to take a look at the getDir() method that does exactly what you wish to accomplish..