jni_flutter
1.1.0, released yesterday by dart.dev
Access Flutter Android APIs from Dart.
What it does
Provides Dart bindings to Android-specific Flutter APIs such as application context and activity. It is a lightweight plugin that wraps the native Java/Kotlin code.
AI-written summary of version 1.0.4+1, based on the package's README and metadata. Report an inaccuracy
Use it when
- Need Android application context in Dart
- Need to obtain the Flutter activity from Dart
- Working on an Android-only Flutter app
Skip it when
- Targeting iOS or web
- Using non-Android platform APIs
Strengths
- Simple API surface
- No code generation required
- Stable, well-maintained
Weaknesses
- Android-only
- No support for iOS or web
- Requires plugin integration
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
Add "jni_flutter" to pubspec dependencies and run flutter pub get. No additional native configuration needed.
import 'package:jni_flutter/jni_flutter.dart';
final context = AndroidApplicationContext();
final activity = AndroidActivity();Alternatives
Packages that do the same job and could replace jni_flutter.
- quill_native_bridge
An internal plugin for flutter_quill to access platform-specific clipboard and gallery APIs
70Compare - location
Flutter plugin to get real-time device location across platforms.
94Compare - nfc_manager
A Flutter plugin providing access to NFC features on Android and iOS.
94Compare - system_info2
Provides easy access to system information like architecture, kernel, memory, OS, CPU, and user.
85Compare
Works with
Packages commonly used together with jni_flutter: ones it builds on, ones built on it, and its own family.
- jnijni_flutter depends on itProvides Dart/Flutter bindings to call native Java code via JNI.
- path_provider_androidBuilt on jni_flutterAndroid implementation of the path_provider plugin for finding commonly used locations.
- cronet_httpBuilt on jni_flutterAn Android Flutter plugin providing access to the Cronet HTTP client.
- mediapipe_coreBuilt on jni_flutterShared layer for MediaPipe task packages providing runtime, model downloads, and browser support.
- hand_landmarkerBuilt on jni_flutterReal-time hand landmark detection on Android using Google MediaPipe and JNI.