Android Runtime and Android Native Interface

100 views Asked by At

According to wiki (http://en.wikipedia.org/wiki/Android_Runtime) Dalvik gets entirely replaced by ART in Lollipop i.e. from that release onwards any app will be compiled to native code upon installation. This begs the question, is there a point in writing computing intense routines in NDK if the app will be compiled to native code anyway?

2

There are 2 answers

0
fadden On BEST ANSWER

The Dalvik VM also compiled code to native code. The difference is that Dalvik did it "just in time", and only for the parts of code that were executed frequently.

The compiler in Art has a number of performance improvements over the one in Dalvik, but if you felt the need to go native for performance before, you will most likely continue to feel that need.

0
shkschneider On

ART does not make pure "native code" in the sense of C language etc. It is still bytecode generated from Java sources.

So yes, there is still a lot of advantages to write some routines with the NDK, of course :)