简体   繁体   中英

adding Sqlite4java in android studio project

I have a requirement to retrieve larger images which is limited by Cursor limit(1 Mb) in android's native sqlite support.

I am trying to use sqlite4java in my android studio project but am facing issues loading the native library.

My project libs(C:\\Users\\admin\\AndroidStudioProjects\\appname\\libs) folder has the following files:

在此处输入图片说明

    armeabi\libsqlite4java-android-armv5tejl.so
    armeabi-v7a\libsqlite4java-android-armv7l.so
    x86\libsqlite4java-android-i686.so
    libsqlite4java-linux-amd64.so
    libsqlite4java-linux-i386.so
    libsqlite4java-osx.dylib
    sqlite4java.jar
    sqlite4java-docs.zip
    sqlite4java-src.zip
    sqlite4java-win32-x64.dll
    sqlite4java-win32-x86.dll

When I run the command "java -jar sqlite4java.jar" on the Terminal:

I get the error:

Nonetheless I can use the classes in my code; but when I try to open a database connection I get the exception:

"libsqlite4java-android-armv7l.so" is already present in the folder "libs\\armeabi-v7a".

What can I do to use sqlite4java in my project?

I finally found a solution.

I've made a lib (not libs) folder and inside it I've moved the folders armeabi , armeabi-v7a and x86 .

I then zipped the lib folder into lib.zip, renamed it to armeabi.lib and converted it to .jar .

This I've placed in My project libs(C:\\Users\\admin\\AndroidStudioProjects\\appname\\libs) folder:

    armeabi.jar
    libsqlite4java-linux-amd64.so
    libsqlite4java-linux-i386.so
    libsqlite4java-osx.dylib
    sqlite4java.jar
    sqlite4java-docs.zip
    sqlite4java-src.zip
    sqlite4java-win32-x64.dll
    sqlite4java-win32-x86.dll

armeabi.jar has the lib folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM