I have ported a C shared library to Android using SWIG and the Android-NDK
In order to test some my library API I need to be able to specify files, e.g. to load data from
I am currently doing all my development using an emulator (I don’t have a smartphone) and am wondering how I can:
a) move files on to the emulator (possibly adb shell mv?)
b) access those files from my Java code
any pointers gratefully received
If you want to have the files within your application, you can put them in the assets/ folder of the root directory of your project (create it if it doesn’t exist).
From there you can access them with the AssetManager class
http://developer.android.com/reference/android/content/res/AssetManager.html
You can use the SD card as well, here is explained how to get files onto the enulators SD card
Manually put files to Android emulator SD card
Here is the documentation on how to access the data afterwards
http://developer.android.com/guide/topics/data/data-storage.html#filesExternal