0

Android devices have different processors like ARM and Intel processors. Can Android apps run just the same regardless of which architecture the device has? Or are there apps that will only run on ARM-architecture, etc?

Fiksdal
  • 1,211
  • 8
  • 31
  • 60

1 Answers1

3

Yes, applications (APKs) are independent of the architecture.

Android is made up of 4 major levels. Android Architecture

The apps you write is compiled into Dalvik EXecutable (DEX) code, which is finally converted into assembly code (according to the required architecture) by the kernel to send to the processor.

So, the kernel is the final one that's responsible to act according to the required architecture and it's compiled by the ROM developer accordingly.

The DEX code is always independent of the architecture, so that application developers needn't worry about the type of processor.

Gokul NC
  • 1,909
  • 3
  • 18
  • 30
  • Gokul, hi, is that where JIT compiler comes into play? At least for android 4.x and dalvik runtime ? – moonbutt74 Dec 26 '15 at 19:54
  • 1
    @moonbutt74 JIT is used during compilation (dynamic codes may or may not compile) and finally converted into corresponding DEX code which is processed accordingly by executing. More info here: http://m.pocketnow.com/2012/09/11/what-is-jit – Gokul NC Dec 27 '15 at 03:47
  • So there is actually some sort of local, device-specific compilation going on as the app is being installed on any given device? – Fiksdal Dec 27 '15 at 10:56
  • Regarding the question in my last comment, the top answer here answers it very well: http://android.stackexchange.com/questions/82978/are-ios-apps-faster-than-android-apps-since-android-apps-are-interpreted – Fiksdal Apr 04 '16 at 05:46