{
	"id": "7070ca4d-8448-4863-87bb-c5c777729027",
	"created_at": "2026-04-06T00:21:35.179182Z",
	"updated_at": "2026-04-10T13:12:44.196665Z",
	"deleted_at": null,
	"sha1_hash": "99fe923969e5b704caded72d8ea63811986769fe",
	"title": "Get started with the NDK",
	"llm_title": "",
	"authors": "",
	"file_creation_date": "0001-01-01T00:00:00Z",
	"file_modification_date": "0001-01-01T00:00:00Z",
	"file_size": 53785,
	"plain_text": "Get started with the NDK\r\nArchived: 2026-04-05 21:54:16 UTC\r\nThe Native Development Kit (NDK) is a set of tools that allows you to use C and C++ code with Android, and\r\nprovides platform libraries you can use to manage native activities and access physical device components, such\r\nas sensors and touch input. The NDK may not be appropriate for most novice Android programmers who need to\r\nuse only Java code and framework APIs to develop their apps. However, the NDK can be useful for cases in\r\nwhich you need to do one or more of the following:\r\nSqueeze extra performance out of a device to achieve low latency or run computationally intensive\r\napplications, such as games or physics simulations.\r\nReuse your own or other developers' C or C++ libraries.\r\nUsing Android Studio 2.2 and higher, you can use the NDK to compile C and C++ code into a native library and\r\npackage it into your APK using Gradle, the IDE's integrated build system. Your Java code can then call functions\r\nin your native library through the Java Native Interface (JNI) framework. To learn more about Gradle and the\r\nAndroid build system, read Configure Your Build.\r\nAndroid Studio's default build tool to compile native libraries is CMake. Android Studio also supports ndk-build\r\ndue to the large number of existing projects that use the build toolkit. However, if you are creating a new native\r\nlibrary, you should use CMake.\r\nThis guide gives you the information you need to get up and running with the NDK on Android Studio. If you\r\ndon't have the latest version of Android Studio, download and install it now.\r\nAttention experimental Gradle users: Consider migrating to plugin version 2.2.0 or higher, and using CMake or\r\nndk-build to build your native libraries if any of the following apply to you: Your native project already uses\r\nCMake or ndk-build; you would rather use a stable version of the Gradle build system; or you want support for\r\nadd-on tools, such as CCache. Otherwise, you can continue to use the experimental version of Gradle and the\r\nAndroid plugin.\r\nDownload the NDK and tools\r\nTo compile and debug native code for your app, you need the following components:\r\nThe Android Native Development Kit (NDK): a set of tools that allows you to use C and C++ code with\r\nAndroid.\r\nCMake: an external build tool that works alongside Gradle to build your native library. You do not need\r\nthis component if you only plan to use ndk-build.\r\nLLDB: the debugger Android Studio uses to debug native code.\r\nFor information on installing these components, see Install and configure the NDK and CMake.\r\nhttps://developer.android.com/ndk/guides\r\nPage 1 of 2\n\nCreate or import a native project\r\nOnce you set up Android Studio, you can simply Create a New Project with C/C++ Support. However, if you want\r\nto add or import native code to an existing Android Studio project, you need to follow this basic process:\r\n1. Create new native source files and add them to your Android Studio project.\r\nYou can skip this step if you already have native code or want to import a prebuilt native library.\r\n2. Create a CMake build script to tell CMake how to build your native sources into a library. You also require\r\nthis build script if you are importing and linking against prebuilt or platform libraries.\r\nYou can skip this step if your existing native library already has a CMakeLists.txt build script, or\r\nuses ndk-build and includes an Android.mk build script.\r\n3. Link Gradle to your native library by providing a path to your CMake or ndk-build script file. Gradle uses\r\nthe build script to import source code into your Android Studio project and package your native library (the\r\nSO file) into the APK.\r\nNote: If your existing project uses the deprecated ndkCompile tool, you should open your\r\nbuild.properties file and remove the following line of code before configuring Gradle to use CMake or\r\nndk-build:\r\n// Remove this line\r\nandroid.useDeprecatedNdk = true\r\n4. Build and run your app by clicking Run . Gradle adds your CMake or ndk-build process as a\r\ndependency to compile, build, and package your native library with your APK.\r\nOnce your app is running on a physical device or the emulator, you can use Android Studio to Debug your app.\r\nOtherwise, to learn more about the NDK and its components, read the Concepts page.\r\nSource: https://developer.android.com/ndk/guides\r\nhttps://developer.android.com/ndk/guides\r\nPage 2 of 2",
	"extraction_quality": 1,
	"language": "EN",
	"sources": [
		"MITRE"
	],
	"origins": [
		"web"
	],
	"references": [
		"https://developer.android.com/ndk/guides"
	],
	"report_names": [
		"guides"
	],
	"threat_actors": [],
	"ts_created_at": 1775434895,
	"ts_updated_at": 1775826764,
	"ts_creation_date": 0,
	"ts_modification_date": 0,
	"files": {
		"pdf": "https://archive.orkl.eu/99fe923969e5b704caded72d8ea63811986769fe.pdf",
		"text": "https://archive.orkl.eu/99fe923969e5b704caded72d8ea63811986769fe.txt",
		"img": "https://archive.orkl.eu/99fe923969e5b704caded72d8ea63811986769fe.jpg"
	}
}