3

I'm working on a java android project. this project requires to use specific commands. these commands are all developed in c++/c but I've been given two files (.jar and .so) that are supposed to "turn them into" java, so I can use them in my java android project.

The thing is, what am I supposed to do with these 2 files?? I've read a lot of stuff (mostly about creating the .jar and .so, but I don't care about this step, for I already have the 2 files)

I tried to import the .jar (import external lib), I tried to add the .so via the static loading : //static { // System.loadLibrary("MySoFile"); // } All I get is a stack overflow error or a problem with the DEX file...

Has anybody ever tried to do this?? I don't seem to get the point here...all I want to do is being able to use the commands in the .jar file.... ://

thanks in advance!!

Guigui
  • 127
  • 2
  • 8

2 Answers2

1

Take a look at this answer about adding jar files. '.so' files can usually just be drag and dropped to the project.

Community
  • 1
  • 1
poitroae
  • 21,129
  • 10
  • 63
  • 81
0

All you need to do is make sure the jar is in your classpath and you can then access the classes within this jar. A jar is just an archive of classes, you don't need to load the library into memory or something similar.

You may want to read the answer to the question here How to use classes from .jar files?

Community
  • 1
  • 1
David
  • 19,577
  • 28
  • 108
  • 128