For faster navigation, this Iframe is preloading the Wikiwand page for Android Native Development Kit.

Android Native Development Kit

Android NDK
開発元 Google
最新版
r27 (27.0.12077973)[1][2] / 2024年7月11日 (36日前) (2024-07-11)[3]
リポジトリ https://android.googlesource.com/platform/ndk.git
対応OS Android 5.0 Lollipop (API 21) 以降
プラットフォーム x86 / x64 / ARM / ARM64[4]
種別 ソフトウェア開発キット
ライセンス Apache License v2.0[5]
公式サイト https://developer.android.com/ndk
テンプレートを表示

Android Native Development Kit (Android NDK) は、Androidオペレーティングシステム上で動作するアプリケーションソフトウェアを、C言語あるいはC++を用いたネイティブコードによって開発できるようにするためのソフトウェア開発キット[6]GCC/Clangツールチェイン、標準CライブラリBionic libc英語版標準C++ライブラリのlibstdc++/libc++、AndroidネイティブAPIなどを含む。なお、GCCが同梱されている最後のNDKバージョンはr17cであり、r18では取り除かれた[7][8]リンカに関しては、NDK r21まではldがデフォルトで使われていたが、r22からはLLVMのLLDがデフォルトで使われるようになった。

概要

[編集]

Androidのアプリケーション開発には通例Java仮想マシンDalvik仮想マシン/Android Runtime)上で動作するJavaあるいはKotlinといったJVMマネージ言語を利用する。マネージ言語はメモリ管理や生産性、移植性の点で優れているが、メモリへの直接アクセスによるパフォーマンス向上や、x86SSEあるいはARMのNEONといったプロセッサ (CPU) アーキテクチャ固有の拡張命令の使用、またOpenCVのような既存のC/C++コード資産を活用する目的で、NDKを用いたマシンネイティブな開発が許可されている。ただしNDKを利用すると、CPUアーキテクチャごとにバイナリを用意しなければならなくなるというデメリットもある。

Android 2.3以降ではNativeActivityのサポートにより、制約はあるもののC/C++のみでアプリケーション開発をすることもできるようになっている。JVMとネイティブコード間の相互運用には、一般的なデスクトップのJavaアプリケーション開発時と同様、Java Native Interface (JNI) を利用できる。Androidのグラフィカルユーザーインターフェイス (GUI) ライブラリ(ウィジェット・ツールキット)など、上位レベルのAPIはAndroid SDKに含まれるが、大半はJVM言語向けにしか提供されておらず、C/C++向けには提供されていないため、C/C++から利用するにはJNIを経由する必要がある。

NDKにおけるAndroid固有のネイティブAPI[9]は、"A" で始まる名前が付けられており、JVM言語用APIとよく似たものも提供されている。

最新のNDKでは、ある程度古いバージョンのAndroid OSはサポートが打ち切られている。r18ではIce Cream Sandwich (Android 4.0; API 14, 15) のサポートが打ち切られた。r24ではJelly Bean (Android 4.1-4.3; API 16-18) のサポートが打ち切られた。r26ではKitKat (Android 4.4; API 19-20) のサポートが打ち切られた[7][8]

脚注

[編集]

関連項目

[編集]

外部リンク

[編集]
{{bottomLinkPreText}} {{bottomLinkText}}
Android Native Development Kit
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?