Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android create folders in Internal Memory

Is there any way/ is it allowed to create folders in Internal Memory in Android. Example :

- data
-- com.test.app (application's main package)
---databases (database files)
---files (private files for application)
---shared_prefs (shared preferences)

---users (folder which I want to create)

Can I create users folder in Internal Memory for example?

like image 814
Android-Droid Avatar asked Nov 14 '11 16:11

Android-Droid


People also ask

Can you make file folders in Android?

On your Android phone or tablet, open the Google Drive app. Tap Folder. Name the folder. Tap Create.

What is the use of Android folder in internal storage?

Android Internal storage is the storage of the private data on the device memory. By default, saving and loading files to the internal storage are private to the application and other applications will not have access to these files.


1 Answers

I used this to create folder/file in internal memory :

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.
like image 118
Android-Droid Avatar answered Oct 13 '22 00:10

Android-Droid