2

I would like to know if it is possible to use both X86 and ARM libraries at the same time when running my application on X86 android platform?

My problem is as follows: I have one application to create for x86 android platform. I have 2 shared libraries (lib1.so and libthirdparty.so) Lib1.so is compiled for x86 for performance reasons. Libthirdparty.so is a library compiled for ARM I cannot recompile it because it comes from a third party.

Lib1.so must call libthirdparty.so. How CAN I do please? (if both libraries are ARM it works well with houdini emulator on x86 platform, but in my case I mix 2 different architecture and I don't how it could work, or at least if it is just possible)

ctrl-alt-delor
  • 7,506
  • 5
  • 40
  • 52
user271280
  • 49
  • 4
  • It looks like you are not Free to do that. You need to go back to you supplier and get them to give you more freedom, then you can recompile. Good luck. Also If you use cpu specific code it will not run on all phones. – ctrl-alt-delor Feb 27 '14 at 23:12
  • 2
    +1 because someone down voted it. We should not downvote for being stupid, if we did we would down vote everything. Stackoverflow if for when we are stupid. Sounds like it should be possible when run under emulation, but don't know how. – ctrl-alt-delor Feb 27 '14 at 23:16
  • What is the library for, maybe we can suggest are replacement. – ctrl-alt-delor Feb 27 '14 at 23:16

1 Answers1

0

An x86 binary will not be able to directly load and call an ARM binary.

But your Java app will be able to load both without issues.

Starting from there, you can make them communicate over JNI or directly using a native pipe or socket.

As others said in the comments, mixing ABIs like that isn't really recommended. You'll need to handle exceptions properly and give a meaningful message to the user in case he's using your app on a platform that only supports x86 binaries.

ph0b
  • 14,353
  • 4
  • 43
  • 41