Coder Social home page Coder Social logo

packages_apps_zapstats's Introduction

ROM Stats

Description: Usage statistics for ROM developer (a la Cyanogenmod Stats)

CyanogenMod has a feature to report anonymous Statistics to the Cyanogenmod Team: on first boot the user is given the choice to send anonymous statistics to CyanogenMod website (http://stats.cyanogenmod.com).

I went ahead and got the source code of the CyanogenMod GitHub, made some modifications to make it run on any Rom (Android > 2.3.3).

By default, when the user aggree to send anonymous statistics, the app will report to the server once every 7 days (or the number of days defined in the parameter tframe, check below).

Usage:

To use this in a ROM, it should contain the APK as either a User or a System application, and then add these lines in the build.prop in the System directory:

# ROM Statistics and ROM Identification
ro.romstats.url=http://www.[domainname].com/[subfolder]/
ro.romstats.name=[The desired ROM name]
ro.romstats.version=[ROM Version]
ro.romstats.tframe=7

Then there needs to be a web application on the server as the domain (the URL parameter) where the data is submitted. For that now I wrote a simple php page with a mysql database to save the data. I will also post the code for this little web app.

The submitted data contains:

  • Device hash: which is a salted MD5 hash of the IMEI (or wifi MAC, if imei is unavailable for some reason)
  • Device name: the property "ro.product.model" of build.prop
  • Device version: the property "ro.build.display.id" of build.prop
  • Country: from the Android API, getNetworkCountryIso
  • Carrier: from the Android API, getNetworkOperatorName
  • Carier ID: from the Android API, getNetworkOperator
  • ROM Name: from the newly added property "ro.romstats.name"
  • ROM version: from the newly added property "ro.romstats.version"

in addition to this data, the database has an extra 2 columns:

  • First registration date: the first time the device registered on the server
  • Last check-in date: the last time the device (with same device hash) checked in, to remove inactive devices after X days

Updates:

Update 1 (20/01/2013): I added a new option in the main screen, Uninstall, which will appear the app is installed as a User app, which allows the end user to uninstall the stats app completely from the deivce, and not just opt-out of stat submitting.

Update 2 (02/02/2013): A new parameter (tframe) has been added, to allow the developer decide on the frequency of reporting to the server, by default it reports once every 7 days, but with this parameter it can be customized.

packages_apps_zapstats's People

Contributors

deadman96385 avatar beegee-tokyo avatar johnnyslt avatar jsnweitzel avatar zeetherocker avatar mcbyte-it avatar thebr0ken avatar

Watchers

James Cloos avatar  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.