Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create folder during application installation in android

Tags:

android

Can we create a directory on the internal storage of the device during application installation .Also after creating that i need to copy some images and music to that directory from our res folder. Does anyone have any ideas as to create a directory at install time? Thanks in advance

like image 916
Anish Avatar asked May 24 '26 07:05

Anish


1 Answers

  public void onCreate(Bundle savedInstanceState) {

       super.onCreate(savedInstanceState);
       setContentView(R.layout.main);

       // creating Derectory on SD card
       File nfile=new File(Environment.getExternalStorageDirectory()+"/directory name");
       nfile.mkdir();
     }

Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!