Bachelor’s Thesis by Andreas Ulvesand & Daniel Eriksson

Native code on Android - A performance comparison of Java and native C on Android

Abstract

This report evaluates possible performance differences between Java and native C on the operating system Android, by developing tests and analyzing the execution. The ambition is that each test should evaluate the performance of a certain task, such as memory access or arithmetic operations of different data types. The results were in some cases unexpected and show that the executed implementations were faster on C compared to Java on one of the test devices, but not the other. The conclusion partly opposes earlier research and this is probably partly due to the fact that the Java Virtual Machine has been improved vastly in the latest versions of Android.

Keywords: Android, smartphone, Java, C, native, NDK, performance evaluation