0
0

More than 1 year has passed since last update.

vistaでandroid studio その18

Last updated at Posted at 2022-09-08

概要

vistaでandroid studio 1.1.0やってみた。
jniが、やりたいので調査。

jniの仕組み

cソースをコンパイルして、soを作る。

  • ndkをインストール。
  • src/main/jniフォルダを作る。
  • src/main/libsフォルダを作る。
  • hello.cを書く。
  • Android.mkを書く。
  • ndk-buildにpathを通す。
  • ndk-buildを実行して、hello.soを作る。

apkにsoを挿入する。

  • gradleを書いて、soを挿入。
sourceSets {
	main {
		jni.srcDirs = []
		jniLibs.srcDir "src/main/libs"
	}
}

javaソースを、書いて、jniを呼び出す。

  • System.loadLibrary("hello")
  • private native

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0