Search packages, repositories and app categories

Package detailsv1.1.2

jni

A library to access JNI from Dart and Flutter that acts as a support library for package:jnigen.

AndroidWindowsLinux
30-day downloads
10.5M
Likes
64
Pub points
160

Install package

flutter pub add jni

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The jni package provides a Dart library for accessing Java Native Interface (JNI) from Flutter and Dart, enabling seamless interoperability with native Android code. It serves as a foundational support library for jnigen, simplifying the integration of native code written in languages like C or C++ with Dart applications. Designed for Android, Windows, and Linux platforms, it allows developers to call native functions directly from Dart, facilitating performance-critical operations and access to platform-specific features. The package is part of the Dart Native ecosystem, promoting efficient cross-platform native integration.

Use cases

  • Calling native C/C++ functions from Dart
  • Integrating Android native libraries
  • Building high-performance Flutter plugins
  • Extending Flutter apps with platform-specific code
  • Enabling low-level system access via JNI

Key features

  • Direct JNI access from Dart
  • Support for Android, Windows, and Linux
  • Integration with jnigen for code generation
  • Low-level native function calling
  • Cross-platform native interoperability

Suitable for

  • Developers building native plugins
  • Teams requiring high-performance native calls
  • Projects using C/C++ libraries on Android
  • Flutter apps needing direct JNI interaction
  • Advanced Flutter developers working with native code

Considerations

  • Requires knowledge of JNI and native development
  • Limited to platforms supporting JNI
  • Not recommended for beginners
  • May increase app complexity
  • Dependent on jnigen for full functionality

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

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.

Categories

Dependencies

Dependency list 8 items

Source repository

Projects using this package