Upgrade to Pro — share decks privately, control downloads, hide ads and more …

FlutterとAndroidの 連携を変えるかもしれないjni

FlutterとAndroidの 連携を変えるかもしれないjni

Mikami Hiroki

May 22, 2023
Tweet

More Decks by Mikami Hiroki

Other Decks in Programming

Transcript

  1. jniパッケージの概要 • Dart / Flutter から Java Native Interface(JNI) への

    アクセスをサポートするパッケージ[4] • Android側でDartと連携する処理が不要 🎉 ◦ DartだけでAndroid側の処理を呼び出せる ◦ ContextやActivityを取得するメソッドも用意 [4] jin, https://pub.dev/packages/jni
  2. jniのイメージ [5] jnigen/README.md, https://github.com/dart-lang/jnigen/blob/main/README.md C bindings dart bindings Flutter Java

    code JNI jnigen.yaml (設定ファイル) 1. 設定 & 自動生成 2. dart bindings を扱う
  3. References • [1] Rethinking Dart interoperability with Android, https://youtu.be/ZWp2FJ2TuJs •

    [2] Writing custom platform-specific code, https://docs.flutter.dev/platform-integration/platform-channels • [3] Pigeon, https://pub.dev/packages/pigeon • [4] jin, https://pub.dev/packages/jni • [5] jnigen/README.md, https://github.com/dart-lang/jnigen/blob/main/README.md • [6] jnigen, https://pub.dev/packages/jnigen • [7] ffi, https://pub.dev/packages/ffi • [8] ffigen, https://pub.dev/packages/ffigen • [9] pedometer, https://github.com/flutter/samples/tree/main/experimental/pedometer
  4. CREDITS: This presentation template was created by Slidesgo, including icons

    by Flaticon, infographics & images by Freepik. Thanks!