Monday, May 9, 2011

[android-developers] where to put files to be read by jni native code

I am trying include a small data file with my package. I need to pass
the name of the datafile down to a JNI native 'c' function that will
open and read the file. I am confused as to where to put this file.
I've tried in res/raw, and in assets, but I can't seem to get an
absolute pathname to where these files live to give to the 'c'
routine.

I supposed I could use AssetManager to open a fd and pass that down to
the C code, but that is not how my existing library works at the
moment.

How can I get the absolute path to an asset file or resource file, and
can it be opened by the 'c' code?

-Jim

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate