Hi All,

I want to get access to the raw resource in order to check the size of
the .mp3 file placed there. I found that it can be done by using the
URI from java.net.URI package and passing that URI as a parameter in
the File object constructor. But it doesn't work. There are few
requirements in regard to the URI: absolute hierarchical URI, file
scheme and path component non-empty, undefined: authority, query &
fragment components.

I've tried following string to create the URI:

String uriStr = "android.resource://" + PACKAGE_NAME + "/" +
R.raw.resource;

PACKAGE_NAME is being assigned as an AUTHORITY. I haven't found any
other way to create the File object than:

File mp3File = new File(URI uri);

and then call the: long mp3Size = mp3File.length(); to find the size
of the resource file...

Does anybody know how I could achive that in some other way or what I
am doing wrong with the above code?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to