Placing schema file inside the same directory of .so lib

Skip to first unread message

Abdul Qadir

Sep 14, 2021, 12:54:03 PM9/14/21
to android-ndk

We have our SDK based app inside which we have our NDK based libraries ‘’.
Now, we have our schema and other data – which is between 4 to 12 megabytes, and required to be accessed in read-only mode by the native code(C++).
For this scenario, I can put my schema.db file under the asset folder and directly access using Ndk api's, but I want it to reside at the same place where my ‘'
is present. i.e "app/src/main/jniLibs", since for all the other platforms we are keeping this file in the ‘same location as the executable’.

Also, we may need to open the schema file in write mode also, to support upgrade to the schema without needing to upgrade the app. But I am not sure whether it is allowed 
and therefore how to do it.

Any help suggestion would be appreciated.



John Dallman

Sep 16, 2021, 5:12:25 AM9/16/21
I have not dealt with your scenario, but I've learned the hard way that trying to keep the same file layout on Android (and iOS) as other platforms is not usually worth the trouble, and can be impossible. Doing things the way that Android expects is usually easier. 


You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Reply all
Reply to author
0 new messages