Hello,

I have been trying to get the absolute path for an asset file but i
havent found an answer.

the file which is directly within my asset folder is mydemo.txt
 and i call the function given below to test the validity of the path
(tried the below options)
                testURI("//android_asset/mydemo.txt");
                testURI("//assets/mydemo.txt");

        public void testURI(String filepath) {
                try {
                        Log.e(TAG, "Testing " + filepath);
                        File f = new File(filepath);
                        if (f.exists() == true) {
                                Log.e(TAG, "Valid :" + filepath);
                        } else {
                                Log.e(TAG, "InValid :" + filepath);
                        }
                } catch (Exception e) {
                        Log.e(TAG, "File not found" + filepath);
                        e.printStackTrace();
                }
        }

Can someone let me know whats the absolute path i can use to get an
asset file. i don't need the file descriptors but i want the file path
to construct an URI.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to