I am working on a video editor program and am fairly new to android and java. What I would like to happen is when the user presses "create new project" button, a dialog pops up asking the user for the name of the project. I have that part down, but what I then want, is when the user presses "ok" on that dialog, my code will take the name and create a directory inside of my data/data file for my project and inside of that directory create folders titled 1 to 5 or more. I really don't know how to go about this, so any input would be truly appreciated.
As sgarman proposed you can use the SD card (and I think it's better) but if you want to use your application dir you can get it by calling getFilesDir()
from your activity, it will return a File
object of /data/data/your.app/files
then you can get the path and append the new directory:
String dirPath = getFilesDir().getAbsolutePath() + File.separator + "newfoldername";
File projDir = new File(dirPath);
if (!projDir.exists())
projDir.mkdirs();
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With