title: Copying Files from Assets to Internal Storage
body: <p>i have 5 files in [assets>files_new] folder</p>
  
  <ul>
  <li>one.png</li>
  <li>two.zip</li>
  <li>three.rar</li>
  <li>four.exe</li>
  <li>five.txt</li>
  </ul>
  
  <p>i want copy them to this directory (Internal Shared storage > Android > data > com.test.com) folder
  i test many codes but it was move files to sdcard.</p>
  
  <p>MainActivity.java:</p>
  
  <pre><code>public class MainActivity extends Activity {
  
  private static final String TAG = "MainActivity.java";
   @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
     // your sd card
      String sdCard = Environment.getExternalStorageDirectory().toString();
  
      // the file to be moved or copied
      File sourceLocation = new File (sdCard + "/five.txt");
  
      // make sure your target location folder exists!
      File targetLocation = new File (sdCard + "/MyNewFolder/five.txt");
  
  
       try {
  
          // 1 = move the file, 2 = copy the file
          int actionChoice = 2;
  
          // moving the file to another directory
          if(actionChoice==1){
  
              if(sourceLocation.renameTo(targetLocation)){
                  Log.v(TAG, "Move file successful.");
              }else{
                  Log.v(TAG, "Move file failed.");
              }
  
          }
  
          // we will copy the file
          else{
  
              // make sure the target file exists
  
              if(sourceLocation.exists()){
  
                  InputStream in = new FileInputStream(sourceLocation);
                  OutputStream out = new FileOutputStream(targetLocation);
  
                  // Copy the bits from instream to outstream
                  byte[] buf = new byte[1024];
                  int len;
  
                  while ((len = in.read(buf)) &gt; 0) {
                      out.write(buf, 0, len);
                  }
  
                  in.close();
                  out.close();
  
                  Log.v(TAG, "Copy file successful.");
  
              }else{
                  Log.v(TAG, "Copy file failed. Source file missing.");
              }
  
          }
  
      } catch (NullPointerException e) {
          e.printStackTrace();
      } catch (Exception e) {
          e.printStackTrace();
      }}}
  </code></pre>
  
  <p>here i try to move 1 file, but i looking for copy/move all files [assets>files_new] to directory.</p>
  
  <p>my bad if i didn't explained that much. but i'm beginner.
  - i found this thread but not what i search on, <a href="https://stackoverflow.com/questions/19218775/android-copy-assets-to-internal-storage">Android - Copy assets to internal storage</a>, i looking for copy all files from [assets>files_new] to directory which i mentioned before</p>