(1、 What is NDK? Why use it? To put it simply, NDK is a cross compilation tool that can help you compile code written in C or C into. The so (similar to the. dll under win) format file allows you to call these codes in the Java language (JNI) when you want to call your C and C code in Java, When are you likely to consider using C and C code? For example, you used to write a game program in C and C , which contains a lot of your encapsulated game business logic, algorithm and other code. Now you want to transplant this game to Android, how do you do? Is it possible that these business logic and algorithms should be completely rewritten in Java? Now that NDK is available, you can directly compile and transplant the code. So if you have code reuse requirements, you can use it. Take another example. For example, you now use the camera of your Android phone to collect image information. For the collected images, you use Java to write a compression algorithm for compression. This algorithm is very time-consuming, consumes CPU, and does not work well. At this time, you can test and adopt C to write the compression algorithm. Then you may find that the efficiency is improved several times or even more than ten times after using C code to perform. When your customers have high requirements for program performance and speed, you can also consider using C, C code to write some code to meet customer requirements. So without NDK compilation, your code can't run on Android. 2、 It looks good. I want to try now. How do I do it? What is cygwin? Why use it? Because it is necessary to use make and gcc when NDK compiles code, you need to get a Linux environment first. What if you only have Windows and don't want to install a Linux environment? At this time, cygwin came on the stage. Cygwin is a unix simulation environment running on the Windows platform. It is used to learn the unix/linux operating environment. Perhaps the migration of user programs from unix to Windows is very effective. With it, you can use NDK to compile C and C code without installing Linux. This document includes the following annexes:
Configuring the NDK Integrated Development Environment Version 1. doc
.....)