Cocos2dx Android how to use .so instead of .jar library libcocos2dx.jar, use something like libcocos2dx.so

537 Views Asked by At

Is it possible and if so how do you use/reference the .so version of the cocos2d-x library instead of the libcocos2dx.jar as most tutorials tell you to do. ie cocos2d-x has some project directory called Android and there's a project there with java code that will compile and create a libcocos2dx.jar file which I can then reference in my own project.

But my question is why reference .jar java library instead of .so library, so how do I reference in my own project so that I use something like libcocos2dx.so instead of referencing library project libcocos2dx.jar?

I guess I'm thinking the performance will be better if I use .so native library.

1

There are 1 best solutions below

0
On

Forgot I even posted this, anyway in case helps others, you can simply extract JAR contents and get the .so from there and put it in libs and there edit the main activity java code to reference it that way. Related helpful links:

*.so library from included *.jar involves UnsatisfiedLinkError

How to bundle a native library and a JNI library inside a JAR?

Not really sure if there's any performance impact to bundling the .so inside jar or not and not sure what problem if any that may cause if the .so inside is too platform specific etc, so I prefer to keep .so's outside of jars, directly in lib folder.