Skip to content
pubscout

android_id

1.0.0, released 5 days ago by achim.io

A Flutter plugin for retrieving the Android ID on Android devices.

WASM-ready
$ flutter pub add android_id
Source repository

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.

Works with

Packages commonly used together with android_id: ones it builds on, ones built on it, and its own family.