The title is pretty much self-explanatory: is Android a 32- or 64- bit OS? I assume that it is one or another and not both, as that would force both 32- and 64-bit binaries to be hosted on Google Play. I know that this is a simple question, and that other people have been asking it, but for the life of me I have not been able to find an answer on the web, and there is certainly not one on this SE.
In the realm of the ARM chipsets which is the common factor, the entire Android stack, from the near-identical kernel based on Linux, are in fact, 32bit, cross-compiled from usually either a 32bit/64bit host environment, the host environment is usually one of the distributions of Linux. Recommended distribution, by Google, for building and cross-compiling Android is Ubuntu.
The Android run-time library (media, graphics, filesystem, to name but a few) are also 32bit, but as we reach the layer of the dalvikvm, then the number of bits becomes irrelevant as it is at this point, the apks coming from the Google Play Store are native bytecode (A "by-product" of generated Java code compiled into a portable bytecode) which targets the DalvikVM (Virtual Machine) which in turn interprets and translates the bytecode targetting the raw ARM instruction set.
Froyo was the last Android that enabled compilation under a 32bit hosted environment in which it was cross-compiled targetting the ARM chipset.
Gingerbread was the first of "future" Android, back then circa, three years ago, that introduced a requirement to use a 64bit hosted environment in which it was built. There was many hacks to get Gingerbread to be built under 32bit hosted environment.
ICS and JB, and upwards now definitely requires a 64bit environment to speed up compilation and to reduce turn-around time in building.
So to sum up, what you see on the Play Store has no bearing on whether 32bit or 64bit are used and thus irrelevant.
Side note: Typical 16GB RAM/Quad core/64bit Linux distribution, the time it takes to build ICS from scratch, takes 30minutes maximum, had this being a 32bit Linux distribution, it would have taken longer, in fact, may cause a CPU meltdown as there is simply, not enough processing power to churn and crank out cross-compiled code, which is a very demanding and taxing process!
Proof of this.
Pull in any native ARM binary found in
Now, examine the binary by issuing this command:
Notice the reference to 32-bit ELF, and is cross-compiled to ARM and is a binary executable.
Right, moving on, let's inspect a native shared library found in
Again, notice, its 32-bit ELF, cross-compiled to ARM and is a shared library.
The key to the host's cross-compilation can be found in the AOSP source, i.e., Gingerbread build originally had a requirement to be built on a 64bit host system, here's the newsgroup linky referring to how to patch the scripts to get it to build on 32bit host which has two patches, found here, for
As a subsequent result, this patch had made its way to ICS's build scripts in which I did have the privilege of compiling ICS on a 32bit platform which took 3 days to build (it was a port of ICS for the Zte Blade). Now, the requirements are ramped up, you do definitely need 64bit host to enable cross-compilation of building AOSP from ICS upwards :)
All ARM chips are currently 32-bit. Because of this, Android currently executes all code in a 32-bit environment.
64-bit processors set to launch in 2014.
Neither actually. Android is a Dalvik VM-based OS, and Google Play hosts Dalvik applications. Dalvik VM itself, like Java VM, is always 32-bit regardless of the bitness of the physical machine.
As you suspected, applications that ships with native binaries and NDK applications must ship with binaries compiled for every architectures it is intended to run at. The most common architecture that Android runs on is ARM 32-bit; however there are also devices that runs on x86 and MIPS.