6

I never used c++ for android and NDK before. When I use it for - say - image processing I want to be sure app will work on all devices with android 2.2 and higher.

When I write for iPhone, xcode compiles 2 binaries for arm7 and arm7s architectures and packs them into the same bundle.

Now I've written a sample NDK app which doesn't want to run on x86 android emulator while running well on my Nexus 7. I think it's obvious that should be the way to make it run both on arm and x86, but still can't find it. Does somebody know? Thanks!

Tertium
  • 6,049
  • 3
  • 30
  • 51
  • This might help http://stackoverflow.com/questions/10098049/android-ndk-build-ignoring-app-abi-x86 – Simon May 15 '13 at 12:01
  • Yes, but "APP_ABI := all" is more universal answer – Tertium May 15 '13 at 12:03
  • Bonus question: how do you do it if you're manually invoking the NDK tools to create a shared library (i.e. Application.mk does not exist)? – technomage May 15 '13 at 14:01
  • create it and add this string. manual ndk-build will take it into account and will create folders for each new *.so. When you build yor java project it will include all of them and choose what to launch in runtime – Tertium May 15 '13 at 17:02

2 Answers2

14

You need just add to Application.mk this string:

APP_ABI := all
vvvvv
  • 25,404
  • 19
  • 49
  • 81
Tertium
  • 6,049
  • 3
  • 30
  • 51
0

this could help you i guess,

Sample app porting guidelines : http://software.intel.com/en-us/articles/using-the-android-x86-ndk-with-eclipse-and-porting-an-ndk-sample-app