0

I am trying to use SQLCipher within Android. They made it very easy to integrate by adding the dependency:

implementation 'net.zetetic:android-database-sqlcipher:4.2.0@aar'

They have nice and simple examples of then using this in Java, but my application is c++ and I am using the NDK. SQLCipher is primarily C code so I know that this is linking against some compiled C code. Are the headers available for use? Where are these dependencies being installed. I am an iOS developer new to Android so I feel like this should simple but I am just missing something.

David
  • 1,648
  • 1
  • 16
  • 31

2 Answers2

1

For a library to be usable directly by ndk, you'd need a .so version of it to link against. If you're including the library like this, you'd use JNI to access it via Java.

I'd recommend against hacking something up to access their .so files directly. Its quite possible their Java code has business logic that prevents errors or initialized things that are not set up properly if you go right against their .so file.

Gabe Sechan
  • 90,003
  • 9
  • 87
  • 127
1

There's currently no support for consuming C/C++ dependencies from an AAR. We're working on this here: https://github.com/android-ndk/ndk/issues/916

But I should note that even when that is complete, sqlcipher does need to choose to expose that library. The AAR would not currently contain includes, and it may not be a stable API so they may choose not to expose it.

Dan Albert
  • 10,079
  • 2
  • 36
  • 79