A simple device name lookup package. Map e.g. 'SM-G980F' to 'Galaxy S20'. No internet connection or database required.
- Lookup Android marketing names
- Get the marketing name(s) of the current device or by an already known Android model
- Uses the
Build.MODEL
information and device_identifiers which maps those to the marketing names.
Add this to your app build.gradle
file:
dependencies {
...
implementation 'de.boehrsi:devicemarketingnames:0.6.3'
}
Versions prior to 0.4.0 are available via Jitpack with the package name com.github.Boehrsi:DeviceMarketingNames
.
Starting with version 0.4.0 new versions are deployed via Maven Central with the new package name de.boehrsi:devicemarketingnames
.
To migrate please adjust your current build.gradle
entry from
dependencies {
...
implementation 'com.github.Boehrsi:DeviceMarketingNames:0.3.x'
}
to the new package
dependencies {
...
implementation 'de.boehrsi:devicemarketingnames:0.4.0'
}
The additional repository definition in your root build.gradle
file can be removed.
For full examples please see the example app.
// Get one marketing name of the device.
val deviceName = DeviceMarketingNames.getSingleName()
// Get all marketing names of the device.
val deviceNames = DeviceMarketingNames.getNames()
// Get one marketing name for the given model.
val deviceNameFromModel = DeviceMarketingNames.getSingleNameFromModel("ONEPLUS A5010")
// Get all marketing names for the given model.
val deviceNamesFromModel = DeviceMarketingNames.getNamesFromModel("ONEPLUS A5010");
If you are interested in contributing, please have a look into the contribution guide. Every idea, bug report or line of code is heavily appreciated.