Placing schema file inside the same directory of .so lib

13 views
Skip to first unread message

Abdul Qadir

unread,
Sep 14, 2021, 12:54:03 PMSep 14
to android-ndk
Hello,

We have our SDK based app inside which we have our NDK based libraries ‘libBase.so’.
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 ‘libBase.so'
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.

-
Regards,
Qadir

 

John Dallman

unread,
Sep 16, 2021, 5:12:25 AMSep 16
to andro...@googlegroups.com
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. 

John

--
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 android-ndk...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/9c21e828-cf7b-4cfe-81de-f6ee55075956n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages