Do it like this :
String folder_main = "NewFolder";
File f = new File(Environment.getExternalStorageDirectory(), folder_main);
if (!f.exists()) {
f.mkdirs();
}
If you wanna create another folder into that :
File f1 = new File(Environment.getExternalStorageDirectory() + "https://stackoverflow.com/" + folder_main, "product1");
if (!f1.exists()) {
f1.mkdirs();
}
Related Contents:
- How to programmatically move, copy and delete files and directories on SD?
- Android: How to open a specific folder via Intent and show its content in a file browser?
- How to delete a whole folder and content?
- Get Application Directory
- Creating a directory in /sdcard fails
- How can I display images from a specific folder on android gallery
- How can I avoid concurrency problems when using SQLite on Android?
- Automatically accept all SDK licences
- updating Google play services in Emulator
- How to prevent Screen Capture in Android
- Force Screen On
- Where is debug.keystore in Android Studio
- How to display a Dialog from a Service?
- Error:Execution failed for task ‘:android:transformClassesAndResourcesWithProguardForRelease’
- UnsupportedOperationException: Can’t convert to dimension: type=0x1
- Replace getMap with getMapAsync
- How to increase storage for Android Emulator? (INSTALL_FAILED_INSUFFICIENT_STORAGE)
- Facebook key hash does not match any stored key hashes
- Dialogs / AlertDialogs: How to “block execution” while dialog is up (.NET-style)
- Display fragment viewpager within a fragment
- Add new item count to icon on button – Android
- Place 2 textview beside each other with 2nd textview always visible
- How to set time to device programmatically
- Unable to resolve target ‘android-XX’
- gradle build fails on lint task
- ListView setOnItemClickListener not working by adding button
- How can I get the UUID of my Android phone in an application?
- Android: Under what circumstances would a Dialog appearing cause onPause() to be called?
- Custom SSL handling stopped working on Android 2.2 FroYo
- InflateException with FloatingActionButton from Official Design Library
- DatePicker shows wrong value of month
- Android Resources$NotFoundException: Resource ID #0x7f030027
- How to generate buildConfigField with String type
- How to save images into Database
- Android Circular Determinate ProgressBar
- Intent – if activity is running, bring it to front, else start a new one (from notification)
- Get color value programmatically when it’s a reference (theme)
- Change Checkbox value without triggering onCheckChanged
- How to draw a circle with animation in android with circle size based on a value
- Should use “sp” instead of “dp” for text sizes
- What’s the purpose of item-id’s in Android ListView Adapter?
- Moving from one activity to another Activity in Android
- Stop saving photos using Android native camera
- Firebase Authentication State Change does not fire when user is disabled or deleted
- How to run (not only install) an android application using .apk file?
- How do CursorLoader automatically updates the view even if the app is inactive?
- Firebase SMS Verification change sender name
- How to mute audio in headset but let it play on speaker programmatically?
- No resource found that matches the given name ‘@style/ Theme.Holo.Light.DarkActionBar’
- Android: How to Make A Drawable Selector