code: private void copyPrivateRawResourceToPubliclyAccessibleFile() {
          InputStream inputStream = null;
          FileOutputStream outputStream = null;
          try {
              inputStream = getResources().openRawResource(R.raw.robot);
              outputStream = openFileOutput(SHARED_FILE_NAME,
                      Context.MODE_WORLD_READABLE | Context.MODE_APPEND);
              byte[] buffer = new byte[1024];
              int length = 0;
              try {
                  while ((length = inputStream.read(buffer)) > 0){
                      outputStream.write(buffer, 0, length);
                  }
              } catch (IOException ioe) {
                  /* ignore */
              }
          } catch (FileNotFoundException fnfe) {
              /* ignore */
          } finally {
              try {
                  inputStream.close();
              } catch (IOException ioe) {
                 /* ignore */
              }
              try {
                  outputStream.close();
              } catch (IOException ioe) {
                 /* ignore */
              }
          }
      }
docs: Copies a private raw resource content to a publicly readable
  file such that the latter can be shared with other applications.