Install Swig
There is no difference in Android Studio. We need to download the code from official website and you can get the file from the fellow link:
http://prdownloads.sourceforge.net/swig/swigwin-3.0.12.zip
Then, extract the file into the specific destination such as D:\setup\tools.
Similar to the other development tools that you have installed, in order to have SWIG easily reachable, its destination directory should be appended to system executable search path. Launch the Environment Variables dialog from System Properties, and click the New button. Using the New System Variable, set the variable name to SWIG_HOME and the variable value to the SWIG installation directory.
From the list of system variables, double-click on the PATH variable, and append ;%SWIG_HOME% to the variable value.
If the installation was successful, you will see the SWIG version number.
Interface File
SWIG interface files contain function prototypes, classes, and variable declarations. Its syntax is the same as any ordinary C/C++ header file. In addition to C/C++ keywords and preprocessor directives that can enable tuning the generated wrapper code.
There is no method to integrate SWIG into Android build process in Android Studio(Windows). When processing, it will prompt some errors, which needs further research and discussion.
The example code is offered by sureshjoshi. It is incompleted, however, which obviously has some fatal errors. So I turn to the project:
https://github.com/tankery/swig-ndk-gradle
This project could generate the code in Java manually. Therefore, it can be further investigation of the usage of SWIG.