I think the post I saw on the Internet is quite good. I just excerpted it.
Q: Android is the core of Linux, but currently only Java-based sdks are officially available. To be honest, if Java is used, the execution rate is really low. It would be nice to open the Linux-based SDK.
A: Although the android kernel is based on Linux, the SDK provides application development support rather than system program support. Applications are restricted to a small range of permissions, because applications developed by free developers on mobile phones can access the entire system without restriction, which may pose a threat to phone applications. Java's Virtual Machine System is a good solution, and Java also has the convenience of porting. You don't need to change the hardware and re-compile it. If you write Linux local applications, you can face such a variety of mobile phone hardware, release will be exhausted. In addition, for execution efficiency, the efficiency of the Dalvik Virtual Machine in Android is much higher than that of sun or Microsoft's Java Virtual Machine. If it is not an computing-intensive application, it doesn't feel much difference. Then, Google has already provided a development tool for local programs, which is known as the ndk development kit. You can use C or C ++ to write programs, of course, the program is still released in the form of APK, and the permission is similar to that of a common Java application. The whole system cannot be accessed, but the speed is faster than that of Java. You can go to the Google website to find the ndk and download it for free.