-3

I want to create a folder in Internal storage root but NOT IN data/data. In my favorite path, except data/data, that user can see that in File Manager. What should I do?

I try many things like this:

String path = "my folder"+File.separator+"gallery";
    File directory = new File(path);
halfer
  • 19,824
  • 17
  • 99
  • 186
ali
  • 21
  • 1
  • 4

1 Answers1

0
File mydir = context.getDir("mydir", Context.MODE_PRIVATE); //Creating an internal dir;
File fileWithinMyDir = new File(mydir, "myfile"); //Getting a file within the dir.

FileOutputStream out = new FileOutputStream(fileWithinMyDir); //Use the stream as usual to write into the file

Try using the above code

Pallav
  • 165
  • 1
  • 2
  • 14
  • i want a folder in root or somewhere to put my images in it directly by file manager @Pallav – ali May 05 '15 at 21:57