android-model-names
v1.1.0
Published
Convert Android device strings to human-readable manufacturer and model names
Downloads
38
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