android_device_info 1.0.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 86

android_device_info #

A Flutter plugin for getting device information on Android devices.

This package is a binding for EasyDeviceInfo.

usage #

import 'package:android_device_info/android_device_info.dart';

var batteryInfo = await AndroidDeviceInfo().getBatteryInfo();
{isBatteryPresent: true,
 batteryPercentage: 71,
 batteryTechnology: Li-ion,
 chargingSource: AC,
 batteryTemperature: 0.0,
 batteryHealth: Having issues,
 isDeviceCharging: false,
 batteryVoltage: 0}

permissions #

Add required permissions to:

<your project>/android/app/src/main/AndroidManifest.xml

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- Network Info -->
<uses-permission android:name="android.permission.INTERNET" /> <!-- Network Info -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <!-- WiFI Info -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> <!-- SIM Info / Phone # -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!-- Location Info -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <!-- Location Info -->
<uses-permission android:name="android.permission.USE_FINGERPRINT" /> <!-- Fingerprint Info -->

Permissions are not handled by the library, please use permission_handler to handle permissions.

implemented apis #

  • Device getDeviceInfo()
  • Memory getMemoryInfo()
  • Battery getBatteryInfo()
  • Sensors getSensorInfo()
  • Network getNetworkInfo()
  • Display getDisplayInfo()
  • NFC getNfcInfo()
  • SIM getSimInfo()
  • Config getConfigInfo()
  • Location getLocationInfo()
  • ABI getAbiInfo()
  • Fingerprint getFingerprintInfo()

demo app #

check Flutter Android Device Info for a working demo.

credits #

Nishant Srivastava for EasyDeviceInfo.

license #

Apache 2.0

1.0.0 #

  • Initial release.


android_device_info_example #

Demonstrates how to use the android_device_info plugin.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  android_device_info: ^1.0.0

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:android_device_info/android_device_info.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Oct 18, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-1 points)

18 out of 18 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies