Giter VIP home page Giter VIP logo

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 (RAM is a ceiling):

RAM condition Year Class
768MB 1 core 2009
2+ cores 2010
1GB <1.3GHz 2011
1.3GHz+ 2012
1.5GB <1.8GHz 2012
1.8GHz+ 2013
2GB 2013
3GB 2014
5GB 2015
more 2016

Integration

Download

Download the latest JARs or grab via Gradle:

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

or Maven:

<dependency>
  <groupId>com.facebook.device.yearclass</groupId>
  <artifactId>yearclass</artifactId>
  <version>2.0.0</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 zlern2k avatar friederbluemle avatar trevor-e avatar divayprakash avatar macarse avatar rrong avatar ashishb avatar dasmer avatar lozzle avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

martina6hall

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.