Package selection guidance compiled from public package information, community data, and project usage.
A Flutter plugin that provides access to Android-specific platform APIs, enabling developers to leverage native Android functionality within Flutter apps. By centralizing Android bindings in one package, it reduces code duplication and streamlines development across projects. The plugin is designed for seamless integration with Flutter’s platform channel system, allowing efficient communication between Dart and native Android code. It supports a range of device-level features and system interactions unique to Android.
Use cases
Accessing Android-specific system features
Integrating native Android libraries
Reducing code duplication across Flutter projects
Building platform-optimized Android experiences
Enabling advanced device control from Flutter
Key features
Centralized Android API bindings
Minimal boilerplate for native integration
Supports Flutter's platform channel
Designed for maintainability
Open-source and community-driven
Suitable for
Android-focused Flutter developers
Teams maintaining multiple Flutter apps
Projects requiring deep Android integration
Developers avoiding redundant platform code
Considerations
Limited to Android platform
Requires knowledge of Android native development
Not suitable for cross-platform-only use cases
Depends on proper setup of platform channels
May require updates for new Android SDK versions
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
Flutter Android Bindings
This is a Flutter plugin for using Android's
numerous platform-specific APIs in Flutter apps.
import'package:flutter_android/android_os.dart'showParcel;
var parcel = Parcel.obtain()
..writeBoolean(true)
..writeInt(42)
..writeDouble(3.1415)
..writeString("Hello, world!")
..writeList(<Object>[1, 2, 3])
..writeMap(<String, Object>{"a": 1, "b": 2, "c": 3});
await _channel.invokeMethod('someJavaMethod', parcel.asUint8List());
// In Java, your MethodCallHandler's call.arguments contains the marshaled Parcel
Face detection
import'package:flutter_android/android_graphics.dart'showBitmap;
import'package:flutter_android/android_media.dart'showFace, FaceDetector;
var photo = Image.asset("images/einstein.png");
var bitmap = Bitmap.fromAssetImage(photo.image asAssetImage);
var detector = FaceDetector(width: 280, height: 396);
for (var face inawait detector.findFaces(bitmap)) {
if (face.confidence < Face.CONFIDENCE_THRESHOLD) {
continue; // skip dubious results below the cut-off threshold
}
print("Found a face at (${face.midPoint.x}, ${face.midPoint.y}) with confidence ${face.confidence}");
}
Heart-rate monitoring
import'package:flutter_android/android_hardware.dart'showSensor, SensorEvent, SensorManager;
var sensor = awaitSensorManager.getDefaultSensor(Sensor.TYPE_HEART_RATE);
var events = await sensor.subscribe();
events.listen((SensorEvent event) {
print(event.values[0]);
});
Frequently Asked Questions
TODO
Caveats
iOS is not and cannot be supported.
All flutter_android APIs throw an AssertionError if they are invoked
when running on iOS. For cross-platform apps, we recommend that you depend
on the platform package to
conditionalize your use of Android APIs.