# jni 0.3.0

Library to access JNI from dart and flutter




## Installing
```
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add 'jni:0.3.0'
```
Published: 2023-02-16T09:58:59.023236Z
Expected archive SHA-256: d13615809094831d7db722cd5eca384eede118ac38e551c04346ca177c7feb3d

Available in cache; verification: upstream_checksum
## Direct dependencies
- args: ^2.3.1
- collection: ^1.0.0
- ffi: ^2.0.0
- package_config: ^2.1.0
- path: ^1.8.0
- plugin_platform_interface: ^2.0.2

## Package README (untrusted upstream documentation)
# jni

This is a support library to access JNI from Dart / Flutter code. This provides the common infrastructure to bindings generated by [jnigen](https://pub.dev/packages/jnigen), as well as some utility methods.

This library contains:

* functions to access the JNIEnv and JavaVM variables from JNI, and wrapper functions to those provided by JNI. JNIEnv is exposed via `GlobalJniEnv` type which provides a thin abstraction over JNIEnv, so that it can be used from multiple threads.

* Functions to spawn a JVM on desktop platforms (`Jni.spawn`).

* Some Android-specific helpers (get application context and current activity references).

* `JObject` class, which provides base class for classes generated by jnigen.

Apart from being the base library for code generated by `jnigen` this can also be used for one-off uses of the JNI and debugging. __To generate type-safe bindings from Java libraries, use `jnigen`.__

## Documentation
The test/ directory contains files with comments explaining the basics of this module, and the example/ directory contains a flutter example which also touches some Android-specifics.

Using this library assumes some familiarity with JNI - it's threading model and object references, among other things.

## Changelog
## 0.3.0
* Added `PortContinuation` used for `suspend fun` in Kotlin.
* `dartjni` now depends on `dart_api_dl.h`.

## 0.2.1
* Added `.clang-format` to pub.

## 0.2.0
* Added array support
* Added generic support
* `JniX` turned into `JX` for a more terse code.

## 0.1.1
* Windows support for running tests and examples on development machines.

## 0.1.0
* Initial version: Android and Linux support, JObject API








 
