How does native android code written for ARM run on x86?
Yes, ARM native code runs on Intel x86 using an emulation feature named Houdini
What this library does is reads ARM instructions on the fly and converts them to equivalent x86 instructions. This is the reason why many apps may work as is on x86 without actually having to build an equivalent library.
Does Android x86 emulate ARM?
First thing first, Android apps (pure Java) are not actually being "compiled for ARM, just like Java apps are compiled into a intermediate Java bytecodes to to executed by any platforms that supports JVM, Android apps written in Java are compiled into Dalvik bytecodes to be run on any platform that supports Dalvik VM. In this regard, how Android apps run x86 or ARM or MIPS is similar to how Java apps run on x86, SPARC, POWER, etc.
Of course if an app contains native code, then the app would need to include support for x86 to be run on an x86 emulator or an actual x86 phone/tablet.
As for the second part of your question, remember that the OS part of Android has been compiled to the x86 platform, so I would assume running x86 Android on a x86 computer is exactly same as running, for example, a Windows in a VM when using OSX.
NDK: how to build a lib, so that app can work on arm(s), x86, etc.?
You need just add to Application.mk
this string:
APP_ABI := all
Is a signed Android APK-File running on x86- and ARM-Android devices?
Yup, these devices will run an x86 version of the dalvik vm so your application will run just fine with respects to the application itself, it may not run if it needs stuff like GPS,or other cellphone based classes.
Related Topics
Erase Bitmap Parts Using Porterduff Mode
Room Persistence: Error:Entities and Pojos Must Have a Usable Public Constructor
Changing Default Port (I.E. 5037) on Which Adb Server Runs
Android Java.Lang.Illegalstateexception: Couldn't Read Row 0, Col 0 from Cursorwindow
Value of a Global Variable Is Reset After It Is Initialised in Valueeventlistener
Accessing Google Account Id /Username via Android
How to Add External Fonts to Android Application
Android Show Notification with a Popup on Top of Any Application
How to Setlayoutparams() for an Imageview
Android: Fragments Overlapping Issue
Android Saf (Storage Access Framework): Get Particular File Uri from Treeuri
What's the Maximum Size for an Android Shared Preference Value
How to Show Toast in Asynctask in Doinbackground
Tab Not Taking Full Width on Tablet Device [Using Android.Support.Design.Widget.Tablayout]