tags:

views:

58

answers:

1

I have a binary file in the R.raw folder. Now I am able to get the file name and can read the file as well, but I need to find out the complete path of the file in string format.

any help will be appreciated.

A: 

So if you are able to get the file name you probably have a File object. If so call this method: http://developer.android.com/reference/java/io/File.html#getAbsolutePath%28%29

I think you should consider storing new files into your application data directory: http://developer.android.com/reference/android/content/ContextWrapper.html#getDir%28java.lang.String,%20int%29

radek-k
but i am using this...InputStream iStream = getApplicationContext().getResources().openRawResource(R.raw.map);
sajjoo
So you still have no file but input stream. It is probably not stored as a single file in a file system. Besides R.raw (like any other R.) resource is read only. You cannot put anything there after compilation.
radek-k
you are right but its inevitable that i have to use stream for reading this file and i checked android.os.Environment does not go into Stream.
sajjoo
`android.os.Environment` is a class. Why would it go into stream?
radek-k
that is what i am saying because i have to use stream. is there any way i can get the full path of my raw folder?
sajjoo
There is no raw folder. You can access raw resources only in a way you mentioned. You cannot modify it neither.
radek-k