hi!

i'm writing an application that needs to call some functions of a 3rd
party library (mjsip).
I need to call a library method that reads a text file, and that takes
the absolute filename's path as an argument.
At first, the text file was in the res/raw, and i tried and reference
it via getResources().openRawResourceFd(R.raw.conf), but the fact that
it doesn't expose "paths" made me think that i had to use Assets
instead.
I then tried using assets combined with file descriptors (the openFd()
method), to try and avoid the whole path issue, but an exception was
raised saying that this method can only be called on uncompressed
data, and that my text file probably is compressed.

The getAssets().list method doesn't seem to wanna work (it only yields
some results if i call it on "/", otherwise it does nothing at all).

So, if i want to pass to another, non-native library the absolute path
of a resource, how can i do that? (without using fds as it seems it's
not allowed)

Just to be even clearer, here is what the beginning of the library
method i need to pass the path to (the one that needs to read a config
file) looks like:

        protected void loadFile(String file) {
                if (file == null) {
                        // TODO raise exception
                        return;
                }
                // else
                BufferedReader in = null;
                try {
                        in = new BufferedReader(new FileReader
(file));



thanks!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" 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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to