Understanding Cross Compiling and How it Relates to Android
Cross compiling is the process of creating executable code for a platform other than the one actually doing the compiling. There are many reasons why this is of use, but arguably the most relevant is compiling for a platform that doesn’t have the required tools to build for itself.
A great example of cross compiling is building Android from source on your x86 machine. But even those who have built AOSP-based ROMs may not be familiar with the cross compiling process, as there are various tools available to make this incredibly streamlined. This then becomes a bit problematic when one wants to compile an external binary for use on the alternate platform.
Luckily, XDA Recognized Contributor JustArchi created a thorough and well explained guide on cross compiling. The guide itself begins with defining cross compiling and why it’s important. It then continues by showing users how to properly create a build environment. Then, the guide covers how to build a native C application for Android, as well as how to optimize the newly created native binaries.
If you wish to build external apps for Android devices or simply want to learn more about cross compiling on Linux, head over to the guide thread, grab a coffee, and read up.
Want something on the XDA Portal? Send us a tip!