Coder Social home page Coder Social logo

devicefarmer / stf-device-db Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openstf/stf-device-db

3.0 2.0 6.0 289.64 MB

A JSON-based database of smartphones, tablets and wearables.

License: Other

Makefile 64.17% JavaScript 35.83%
hacktoberfest

stf-device-db's Introduction

stf-device-db

stf-device-db is a JSON-based database of smartphones, tablets and wearables. The database includes thumbnails for each device and some basic information about the default model at the time of release. It is not complete; currently it mainly covers devices sold in the Japanese market. Data is added as required.

This database is currently being used in STF.

Features

For each device, the following information is provided:

  • Model code (e.g. "SCV31")
  • Product name (e.g. "Galaxy S6 edge")
  • Thumbnail
  • Larger image
  • Carrier (most devices in the Japanese market are carrier-specific models)
  • Manufacturer
  • OS
  • CPU
  • Memory
  • Disk space (if multiple sizes, lowest)
  • Release date (on the Japanese market)
  • Display size

The model code can usually be retrieved from a device quite easily, which then allows fairly straightforward mapping to the device data. Note that some carriers may sometimes prefix models numbers with their own code, which you must strip first.

Sources

The data in this repository is updated regularly from various sources.

  • ULTRAZONE's Japanese smartphone database is currently our main provider for phone data. While their data is not open source, we have asked and obtained a permission to use it. The database is unfortunately limited to phones and does not currently offer useful data for tablets or other devices.
  • Official press releases. We try to keep model-specific sources in CREDITS.md.
  • Manual investigation especially for tablets.

Requirements

On OS X, you can install the last three with:

brew install jq jpegoptim graphicsmagick

Building

Simply run make at the top of the repo after making sure you have the requirements installed. You will then have a complete list of resized icons and photos in the dist folder.

Usage

Install via NPM:

npm install --save stf-device-db

The module is prebuilt before publishing, so you don't need the build requirements if you just want to use the library.

Then you must find your device's model number and possibly the internal product name. On Android, this can be done with:

adb shell getprop ro.product.model
adb shell getprop ro.product.name

The internal product name is not required, but helps make a more specific match for some devices (mainly Nexus devices which reuse the model code for newer models of the same size).

For example, for a Nexus 5 these values would be:

{
  "model": "Nexus 5",
  "name": "hammerhead"
}

You can then require the database and use it to find matching data based on the above values:

var db = require('stf-device-db')

var data = db.find({
  model: 'Nexus 5',
  name: 'hammerhead'
})

data would then be:

{ carrier: { code: 'e', name: 'イー・モバイル' },
  cpu: { cores: 4, freq: 2.26, name: 'Qualcomm Snapdragon 800 MSM8974' },
  date: '2013-11-14T15:00:00.000Z',
  display: { h: 1920, s: 5, w: 1080 },
  maker: { code: 'l', name: 'LG' },
  memory: { ram: 2048, rom: 32768 },
  name: { id: 'Nexus 5', long: 'EM01L' },
  os: { type: 'android', ver: '5.1' },
  image: 'Nexus_5.jpg' }

If no match is found, find() returns null.

Device thumbnails and photos are provided in the dist folder. It can be served as a static folder.

Contributing

See CONTRIBUTING.md.

License

See LICENSE.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

stf-device-db's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

stf-device-db's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.