搜尋套件、儲存庫與 APP 分類

套件詳情v1.1.2

jni

一個用於從 Dart 和 Flutter 訪問 JNI 的庫,作為 package:jnigen 的支援庫。

AndroidWindowsLinux
近 30 天下載
1050萬
喜歡數
64
Pub 分數
160

安裝套件

flutter pub add jni

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

jni 套件提供了一個 Dart 庫,用於從 Flutter 和 Dart 存取 Java 原生介面(JNI),實現與原生 Android 程式碼的無縫互通。它作為 jnigen 的基礎支援套件,簡化了以 C 或 C++ 編寫的原生程式碼與 Dart 應用程式的整合。此套件專為 Android、Windows 和 Linux 平台設計,讓開發者能直接從 Dart 呼叫原生函數,促進效能關鍵作業及存取平台特定功能。該套件屬於 Dart Native 生態系統,推動高效能的跨平台原生整合。

適用情境

  • 從 Dart 呼叫原生 C/C++ 函數
  • 整合 Android 原生庫
  • 建構高性能 Flutter 插件
  • 使用平台特定代碼擴展 Flutter 應用
  • 透過 JNI 啟用底層系統存取

主要特色

  • 從 Dart 直接存取 JNI
  • 支援 Android、Windows 與 Linux
  • 與 jnigen 的程式碼產生整合
  • 低階次原生函數呼叫
  • 跨平台原生互操作性

適合對象

  • 開發原生外掛的開發者
  • 需要高性能量原生呼叫的團隊
  • 在 Android 上使用 C/C++ 庫的專案
  • 需要直接 JNI 互動的 Flutter 應用
  • 使用原生代碼的高級Flutter開發人員

使用建議

  • 需要了解 JNI 與原生開發
  • 僅限支援 JNI 的平台
  • 不建議初學者使用
  • 可能增加應用複雜性
  • 依賴 jnigen 以獲得完整功能

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Coverage Status

Overview

This repository is home to Dart packages related to FFI and native assets building and bundling.

Documentation

See the doc directory for more documentation.

Packages

Package Description Issues Version
code_assets This package contains the Dart API for code assets in hook/build.dart and hook/link.dart. issues pub package
data_assets This package contains the Dart API for data assets in hook/build.dart and hook/link.dart. issues pub package
ffi Utilities for working with Foreign Function Interface (FFI) code. issues pub package
ffigen Generator for FFI bindings, using LibClang to parse C, Objective-C, and Swift files. issues pub package
hooks This package contains the API for hook/build.dart and hook/link.dart. issues pub package
hooks_runner This package is the backend that invokes hook/build.dart and hook/link.dart from Dart and Flutter. issues pub package
jni A library to access JNI from Dart and Flutter that acts as a support library for package:jnigen. issues pub package
jni_flutter A library to access Flutter Android specific APIs from Dart. issues pub package
jni_util A library to access Flutter Android specific APIs from Dart. issues pub package
jnigen A Dart bindings generator for Java and Kotlin that uses JNI under the hood to interop with Java virtual machine. issues pub package
native_toolchain_c A library to invoke the native C compiler installed on the host machine. issues pub package
objective_c A library to access Objective C from Flutter that acts as a support library for package:ffigen. issues pub package
record_use Dart API to access @RecordUse() recorded usages in link hooks. issues pub package
swift2objc A tool for generating bindings that allow interop between Dart and Swift code. issues pub package
swiftgen A tool for generating bindings that allow interop between Dart and Swift code. issues pub package

External packages

Packages not on this repo but also related to FFI and native assets. ❤️

Package Description Version
native_toolchain_cmake A library to invoke CMake for Dart Native Assets. pub package
native_toolchain_go A library to invoke the native Go compiler installed on the host machine. pub package
native_toolchain_ninja A library to invoke Ninja for Dart Native Assets. pub package
native_toolchain_rust A library to build and bundle Rust code for Dart Native Assets. pub package
native_toolchain_zig A library to build and bundle Zig code for Dart Native Assets. pub package

Publishing automation

For information about our publishing automation and release process, see https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

For additional information about contributing, see our contributing page.

所屬分類

依賴

依賴清單 8 項

原始碼儲存庫

使用此套件的專案