1

I have an android project built in eclipse environment with the Android SDK , now I want to add a prebuilt library (.so) to this project , should i use NDK to do that?

Blackbelt
  • 156,034
  • 29
  • 297
  • 305
ro0xandr
  • 105
  • 7

2 Answers2

2

No, just create a jniLibs folder on the same level of your res and java folders, and put the .so files in that.

Alessandro Roaro
  • 4,665
  • 6
  • 29
  • 48
1

you usually don't need to use the NDK to use a native library (.so file) from Java. You only need it if you want to create/recompile a .so file or if the .so files doesn't provide any method implementation to Java.

From where does come your library ? A .jar or a Java class should at least come with it.

In order to use your .so file from Java, you need to know what Java methods it's defining to define the same as native from your Java code, from the same class from the same package name the .so file is made for.

ph0b
  • 14,353
  • 4
  • 43
  • 41
  • yes Java methods names are the same as class name and package name, but i solved it by creating a second package in my project has the same name of the original package of the .so lib, little help from **IDA pro** de-compiler to find the original package name :) – ro0xandr Jul 18 '14 at 21:44