Native libraries part I - Common pitfalls

by Rolf Smit | 01 November 2016 |

Native libraries on Android are great, they allow developers to include native C/C++ code into an app. Native code is in general faster than Java code because the code is compiled directly to CPU instructions (instead of Java byte-code). This seems great, why should we even use Java if native code is faster? Well one of the reasons might be that not every CPU has the same architecture and therefore the same instruction set. In this blog post we will explore which CPU architectures Android supports, how Android picks the correct native libraries and how to avoid the famous `UnsatisfiedLinkError` by covering some common pitfalls.

Continue reading…