Program-Me-Rev
Program-Me-Rev

Reputation: 6624

What does cpp, jni, jniLibs directories, and android.mk and CMake.txt do in Android

When configuring a project to add C and C++ in an Android project a few things come up in a project's directory tree.

There's the cpp, jniLibs, and the jni directories.

There are also android.mk and CMakeLists.txt files.

  1. What are the purposes \ what should be included in the cpp, jniLibs, and the jni directories?

  2. Do android.mk and CMakeLists.txt work interchangeably?

Thank you all in advance.

Upvotes: 0

Views: 186

Answers (1)

Abdo21
Abdo21

Reputation: 1507

  1. cpp is a directory where you put your cpp code.

    jniLibs is an optional directory, can be added if you need to include some external libs (.so files).

    CMakeLists.txt is a configuration file for CMake, which is a build tool for c++ code.

    android.mk is a configuration file used to build cpp code, similar to GNU makefile. No longer used now, replaced by CMake tool. You should use CMake now instead of android.mk, but you can still used if you want.

  2. CMakeLists.txt is a replacement of the old way android.mk

Upvotes: 1

Related Questions