GithubHelp home page GithubHelp logo

elissatong / device-year-class Goto Github PK

View Code? Open in Web Editor NEW

This project forked from facebookarchive/device-year-class

0.0 2.0 0.0 716 KB

A library that analyzes an Android device's specifications and calculates which year the device would be considered "high end”.

License: Other

Java 100.00%

device-year-class's Introduction

Devices by Year Class Device Year Class

Device Year Class is an Android library that implements a simple algorithm that maps a device's RAM, CPU cores, and clock speed to the year where those combination of specs were considered high end. This allows a developer to easily modify application behavior based on the capabilities of the phone's hardware.

Most Popular Devices by Year Class

Mappings as of this writing (ceilings, aside from the final row):

Year Cores Clock RAM
2008 1 528MHz 192MB
2009 n/a 600MHz 290MB
2010 n/a 1.0GHz 512MB
2011 2 1.2GHz 1GB
2012 4 1.5GHz 1.5GB
2013 n/a 2.0GHz 2GB
2014 n/a >2GHz >2GB

Integration

Download

Download the latest JARs or grab via Gradle:

compile 'com.facebook.device.yearclass:yearclass:1.0.1'

or Maven:

<dependency>
  <groupId>com.facebook.device.yearclass</groupId>
  <artifactId>yearclass</artifactId>
  <version>1.0.1</version>
</dependency>

Calculate Device Year Class

Calculating the current device's Year Class is simple.

int year = YearClass.get(getApplicationContext());

Then, later on, you can use the year class to make decisions in your app, or send it along with your analytics.

if (year >= 2013) {
    // Do advanced animation
} else if (year > 2010) {
    // Do simple animation
} else {
    // Phone too slow, don't do any animations
}

See the yearclass-sample project for more details.

Improve Device Year Class!

See the CONTRIBUTING.md file for how to help out.

License

Device Year Class is BSD-licensed. We also provide an additional patent grant.

device-year-class's People

Contributors

seyelenteco avatar macarse avatar rrong avatar dasmer avatar

Watchers

James Cloos avatar Elissa Tong avatar

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.