How to link a library containing jar and .so files?

I want to use the tinyb library inside my project:

I build my project using gradle. Given I specified the paths to the jar and .so files I can execute the jar generated by gradle.
However, when I deploy the jar to another device using the gradle ssh plugin the jar and .so files are not on this device.

I thought that I can add a folder that contains these jar and .so files to my project and link them in the build.gradle.
something like that:

dependencies {
    compile files('libs/tinyb.jar')

So gradle generates one big jar file that combines my project files and the tinyb library. Is that possible? Is the described way reasonable? If yes, how can I get it working?

Thank you very much.