I've got some so files that I'm building from pre-existing code. I'm
trying to use it, as is, but I've run into a problem. The source
relies on two extraneous files that are expected to exist in the same
directory as the so. If I push the files to the correct location,
with the adb, everything works as expected. I thought that putting
the files in the "assets" folder of the project would work, but that
was not the case. Is there a way to add these files to the project,
so that they are installed with the libraries?
On Wed, Feb 15, 2012 at 11:22 AM, Mark Winchester <mwinches...@gmail.com> wrote: > I've got some so files that I'm building from pre-existing code. I'm > trying to use it, as is, but I've run into a problem. The source > relies on two extraneous files that are expected to exist in the same > directory as the so. If I push the files to the correct location, > with the adb, everything works as expected. I thought that putting > the files in the "assets" folder of the project would work, but that > was not the case. Is there a way to add these files to the project, > so that they are installed with the libraries?
No. You can rewrite the pre-existing code in question to have a configurable location for the files.
> On Wed, Feb 15, 2012 at 11:22 AM, Mark Winchester <mwinches...@gmail.com> wrote:
> > I've got some so files that I'm building from pre-existing code. I'm
> > trying to use it, as is, but I've run into a problem. The source
> > relies on two extraneous files that are expected to exist in the same
> > directory as the so. If I push the files to the correct location,
> > with the adb, everything works as expected. I thought that putting
> > the files in the "assets" folder of the project would work, but that
> > was not the case. Is there a way to add these files to the project,
> > so that they are installed with the libraries?
> No. You can rewrite the pre-existing code in question to have a
> configurable location for the files.
> I've got some so files that I'm building from pre-existing code. I'm > trying to use it, as is, but I've run into a problem. The source > relies on two extraneous files that are expected to exist in the same > directory as the so. If I push the files to the correct location, > with the adb, everything works as expected. I thought that putting > the files in the "assets" folder of the project would work, but that > was not the case. Is there a way to add these files to the project, > so that they are installed with the libraries?
> -- > 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
Can I access files in "assets" like they were files located in ./
assets/ from my native code? When I shell into the emulator, I
noticed that the files aren't pushed out to the /data/data/blah...
folder with the library files.
-Mark
On Feb 15, 11:27 am, JackN <j...@jacknorth.com> wrote:
> I put files into assetts folder. Are you referring to them correctly
> On Feb 15, 9:02 am, Mark Murphy <mmur...@commonsware.com> wrote:
> > On Wed, Feb 15, 2012 at 11:22 AM, Mark Winchester <mwinches...@gmail.com> wrote:
> > > I've got some so files that I'm building from pre-existing code. I'm
> > > trying to use it, as is, but I've run into a problem. The source
> > > relies on two extraneous files that are expected to exist in the same
> > > directory as the so. If I push the files to the correct location,
> > > with the adb, everything works as expected. I thought that putting
> > > the files in the "assets" folder of the project would work, but that
> > > was not the case. Is there a way to add these files to the project,
> > > so that they are installed with the libraries?
> > No. You can rewrite the pre-existing code in question to have a
> > configurable location for the files.
On Thu, Feb 16, 2012 at 10:21 AM, Mark Winchester <mwinches...@gmail.com> wrote: > Can I access files in "assets" like they were files located in ./ > assets/ from my native code? When I shell into the emulator, I > noticed that the files aren't pushed out to the /data/data/blah... > folder with the library files.
AFAIK, no. However, you can use JNI to call back into your app and get at the data from Java code, passing the results to the native code.
On Fri, Feb 17, 2012 at 12:50 AM, Mark Murphy <mmur...@commonsware.com> wrote: > On Thu, Feb 16, 2012 at 10:21 AM, Mark Winchester <mwinches...@gmail.com> wrote: >> Can I access files in "assets" like they were files located in ./ >> assets/ from my native code? When I shell into the emulator, I >> noticed that the files aren't pushed out to the /data/data/blah... >> folder with the library files.
> AFAIK, no. However, you can use JNI to call back into your app and get > at the data from Java code, passing the results to the native code.
Or, to make your life simpler, just copy the assets to regular files under /data/data/yourapp on first run. Then you can open them with regular C functions.