1. Premise
Android Studio version: Android Studio Electric Eel | 2022.1.1 Patch 1
2. Create a Native C++ project
1. Create a new project
2. Select to create a new Native C++ project
3.New Project
4. Select the supported version of the C++ standard library
5. The default generated code that comes with the project
6.build.gradle also comes with the configuration of CMakeList (including the path and version of CMakeList)
7.Implementation of C++ code
8. The library files after compilation and running are in the build directory.
9.Default program running effect
The string displayed on the interface comes from C++ code, indicating that Java calls the C++ code successfully.