Giter VIP home page Giter VIP logo

sensorlog's Introduction

SensorApp

This app has been developed for collecting raw sensor data in android devices.

It listens to changes in the following sensors:

  • Accelerometer sensor
  • Light sensor
  • Screen on/off
  • Battery charging/discharging
  • Power on/off

Various optimizations on the client were also used on client to bring down the battery consumptions. (It's less than 2% per 24hrs in most phones)

The app uses FirebaseDB, so inorder to make it run, you will need to configure FIREBASE_URL in strings.xml, add google-servies.json, as mentioned in the link https://firebase.google.com/docs/android/setup?authuser=0

Currently the app syncs data upon it's launch and all the data is not synced rather the data is contracted as specified in classes like AccDataContracted.java etc.

TODOs :

  • Code commenting and cleaning
  • instead of just supporting firebase-db, support rest endpoint where the user of the sdk can push the sensor data
  • Turn this more into an sdk

sensorlog's People

Contributors

rahulgurnani avatar

Stargazers

 avatar Martin Milan avatar Pradeep Bansal avatar

Watchers

James Cloos avatar Pradeep Bansal avatar

sensorlog's Issues

Issue on syncing in background

Whenever the app tries to sync in background or when we open, it gives an error of "Sync Account Error".
Could you give a small flow diagram of how the flow should be when sending data to server on app launch or when in background.
This will make it easy to debug.
Thanks

Issue in GlobalVariable

private void performLogin(User user) {
Context context = getApplicationContext();

    globalVariable = GlobalVariable.getInstance();
    globalVariable.setUser(user);
    globalVariable.setContext(context);
    SyncUtils.CreateSyncAccount(this);
    SyncAdapter.performSync();
    if (!(dataStoreHelper.getSleepData().getSu() && dataStoreHelper.getSleepData().getEu())) {
        scheduleNotification();
    }
    startActivity(new Intent(MainActivity.this, ViewDataActivity.class));
    finish();

}

In above Function performLogin(...) , when you try to get the instance of GlobalVariable, getContext() is called before setting the context which is done after getting the instance.
I have resolved it by setting the firebase parameter outside the private constructor so that the context is set first and then firebase params are set using the context parameter.

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.