android_id
1.0.0, released 5 days ago by achim.io
A Flutter plugin for retrieving the Android ID on Android devices.
What it does
Provides a simple API to retrieve the unique Android ID string for the device. Returns null on non-Android platforms.
AI-written summary of version 1.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to retrieve the Android ID for analytics or non-advertising tracking
- You are building an Android-specific application or feature requiring device identifiers
Skip it when
- You need a cross-platform solution for getting unique device identifiers
- You require guaranteed uniqueness across factory resets or app signing key changes
Strengths
- Simple and straightforward API
- Gracefully returns null on non-Android platforms instead of throwing exceptions
Weaknesses
- Only works on Android; returns null on iOS, Web, and other platforms
- Android ID is not globally unique on Android 8+ (it depends on the app-signing key, user, and device)
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
Requires Android API 24 or newer and Java 17+
import 'package:android_id/android_id.dart';
const _androidIdPlugin = AndroidId();
final String? androidId = await _androidIdPlugin.getId();Alternatives
Packages that do the same job and could replace android_id.
- unique_device_identifier
Provides a unique device identifier across Android, iOS, Windows, macOS, Linux, and Web.
59Compare - flutter_device_imei
Retrieve device IMEI on Android <10 or ANDROID_ID on newer, and UUID on iOS.
58Compare - serial_port_win32
A SerialPort library using win32 API for connecting real devices via serial port on Windows.
64Compare - proximity_sensor
Flutter plugin to read proximity sensor events on Android and iOS
70Compare
Works with
Packages commonly used together with android_id: ones it builds on, ones built on it, and its own family.