0

I have few files in raw folder of application, i need to have both Uri and filepath for those/all files present in the raw folder

so far, i am able to print all the names of files in raw folder(from here), but not able to get Uri and the file path for them

public void listRaw()
{
    Field[] fields=R.raw.class.getFields();
    for(int count=0; count < fields.length; count++)
    {
        Log.i("Raw Asset: ", fields[count].getName());
    }
}
  1. I DO NOT need input stream for those files
  2. I need file path and uri for those files
  3. Do i need to put all files in assets to get Uri and filepath
Community
  • 1
  • 1
Akhil Jain
  • 13,872
  • 15
  • 57
  • 93
  • http://stackoverflow.com/a/7979084/634474 – dymmeh Apr 23 '13 at 13:17
  • Since there is no "filepath" of raw resources, you will need to redesign your app to avoid your "need". Resources are not files on the device. – CommonsWare Apr 23 '13 at 13:17
  • http://stackoverflow.com/questions/7976141/get-uri-of-mp3-file-stored-in-res-raw-folder-in-android. http://stackoverflow.com/questions/7966085/raw-folder-url-path – Raghunandan Apr 23 '13 at 13:19
  • @CommonsWare the apk will have resources packaged right? so the raw folder is also packaged under the apk file. – Raghunandan Apr 23 '13 at 13:21
  • @CommonsWare I understand about resources, what about assets? – Akhil Jain Apr 23 '13 at 13:22
  • 1
    There is no "filepath" for an asset, either. These are not files, except on your development machine. Resources and assets are entries in the ZIP file that is the APK. If you need a "filepath", you will have to make a copy of the data into a local file. – CommonsWare Apr 23 '13 at 13:23
  • @CommonsWare got your point, got solution to store files locally, http://stackoverflow.com/a/7976663/1225413 , thanks for your time – Akhil Jain Apr 23 '13 at 13:27

0 Answers0