# jni 0.5.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.5.0'
```
Published: 2023-05-31T19:05:14.914295Z
Expected archive SHA-256: a19d9f6374e745f9a14b80c8dec9f7c5ef1aa877b36be551a1335bdbf7b0143c

Available in cache; verification: upstream_checksum
## Direct dependencies
- args: ^2.3.1
- collection: ^1.0.0
- ffi: ^2.0.1
- 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.5.0
* **Breaking Change** ([#137](https://github.com/dart-lang/jnigen/issues/137)): Java primitive types are now all lowercase like `jint`, `jshort`, ...
* The bindings for `java.util.Set`, `java.util.Map`, `java.util.List` and the numeric types like `java.lang.Integer`, `java.lang.Boolean`, ... are now included in `package:jni`.

## 0.4.0
* Type classes now have `superCount` and `superType` getters used for type inference.

## 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








 
