JSPM

android-model-names

1.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 34
  • Score
    100M100P100Q50393F
  • License MIT

Convert Android device strings to human-readable manufacturer and model names

Package Exports

  • android-model-names

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (android-model-names) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Android Model Names

A tiny helper library to convert Android hardware strings ("GT-I9060") into human-readable model names ("Galaxy Grand Neo").

Supports all devices that are compatible with Google Play. See Translation Sources for more info.

Usage

First, install the library:

npm install --save android-model-names

Then, import and use:

import getModelName from 'android-model-names';

getModelName('GT-I9060'); // 'Galaxy Grand Neo'
getModelName('GT-I9060', { full: true }); // { manufacturer: 'Samsung', model: 'Galaxy Grand Neo', key: 'GT-I9060' }

// Examples with no matching result
getModelName('GT-I9999'); // 'GT-I9999'
getModelName('GT-I9999', { full: true }); // { key: 'GT-I9060' }

Options

An options hash can be passed in as a second parameter to customize the return data. Here are the available options:

Option Default Value Description
full false Return an object with manufacturer, marketing name (model), and original string key.

Translation Sources

The translations are pulled straight from Google's support page on supported Google Play devices, which is an exhaustive enough list for this purpose.

View the full device list here in CSV format.

Missing a model? Found a bug?

We welcome contributions! Feel free to open an issue (or a PR!) if you notice any missing models (new releases, etc.), or spot a bug. Thanks!

License

Copyright 2016 Twitter, Inc.

Licensed under the MIT License: https://opensource.org/licenses/MIT