Using C, C++ code for android apps

This is exactly what Android NDK is for.  Its document is a very good guide, must-read for using Android NDK.  It is quite common to use open source C or C++ libraries that are managed via Git for Android apps.  The following are the steps:

  1. Understand the libraries well.  This is by far the most important one.
  2. Use Git to manage local copies of the libraries.
  3. Understand JNI (Java Native Interface) well.
  4. Follow the instructions of Andorid NDK to integrate the libraries into apps.