GithubHelp home page GithubHelp logo

fhellmann / uniatron Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 3.0 12.23 MB

This project is part of the course Mobile Application Development at the University of Augsburg

Home Page: https://play.google.com/store/apps/details?id=com.edu.uni.augsburg.uniatron

License: Apache License 2.0

Java 100.00%

uniatron's Introduction

Hi there 👋 it's Fabio,

I am currently a Ph.D. student at the chair for Human-Centered Artificial Intelligence at the University of Augsburg in Germany.

My research interests include biomedical image and signal processing, deep learning, human-computer interaction, and explainable AI. I am passionate about using technology to improve people’s lives and am dedicated to advancing the field of medicine with AI through my work.

Website


🛠 Technologies & Tools

OS OS OS OS OS OS OS


📈 Stats

Fabio's GitHub stats


🧑🏼‍💻 Languages

Top Langs

uniatron's People

Contributors

anja-h avatar fhellmann avatar leonpoint avatar speedyhoopster3 avatar

Watchers

 avatar  avatar  avatar

uniatron's Issues

Presentation

Prepare the slides for the final presentation. Therefor a github-page can be introduced with reveal-js as presentation framework.

Crash on settings

Describe the bug

FATAL EXCEPTION: main
    Process: com.edu.uni.augsburg.uniatron, PID: 8014
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.edu.uni.augsburg.uniatron/com.edu.uni.augsburg.uniatron.ui.setting.SettingActivity}: java.lang.RuntimeException: Cannot create an instance of class com.edu.uni.augsburg.uniatron.ui.setting.SettingViewModel
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2831)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2906)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1605)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:172)
        at android.app.ActivityThread.main(ActivityThread.java:6637)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
     Caused by: java.lang.RuntimeException: Cannot create an instance of class com.edu.uni.augsburg.uniatron.ui.setting.SettingViewModel
        at android.arch.lifecycle.ViewModelProvider$AndroidViewModelFactory.create(ViewModelProvider.java:201)
        at android.arch.lifecycle.ViewModelProvider.get(ViewModelProvider.java:134)
        at android.arch.lifecycle.ViewModelProvider.get(ViewModelProvider.java:102)
        at com.edu.uni.augsburg.uniatron.ui.setting.SettingActivity$GeneralPreferences.onCreatePreferences(SettingActivity.java:64)
        at android.support.v7.preference.PreferenceFragmentCompat.onCreate(PreferenceFragmentCompat.java:225)
        at android.support.v4.app.Fragment.performCreate(Fragment.java:2400)
        at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1418)
        at android.support.v4.app.FragmentTransition.addToFirstInLastOut(FragmentTransition.java:1190)
        at android.support.v4.app.FragmentTransition.calculateFragments(FragmentTransition.java:1073)
        at android.support.v4.app.FragmentTransition.startTransitions(FragmentTransition.java:117)
        at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2407)
        at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2365)
        at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2272)
        at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3271)
        at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3227)
        at android.support.v4.app.FragmentController.dispatchActivityCreated(FragmentController.java:201)
        at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:610)
        at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:178)
        at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1334)
        at android.app.Activity.performStart(Activity.java:6992)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2794)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2906at android.app.ActivityThread.-wrap11(Unknown Source:0at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1605at android.os.Handler.dispatchMessage(Handler.java:105at android.os.Looper.loop(Looper.java:172at android.app.ActivityThread.main(ActivityThread.java:6637at java.lang.reflect.Method.invoke(Native Methodat com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767Caused by: java.lang.NoSuchMethodException: <init> [class android.app.Application]
        at java.lang.Class.getConstructor0(Class.java:2320)
        at java.lang.Class.getConstructor(Class.java:1725)
        at android.arch.lifecycle.ViewModelProvider$AndroidViewModelFactory.create(ViewModelProvider.java:199)
        at android.arch.lifecycle.ViewModelProvider.get(ViewModelProvider.java:134at android.arch.lifecycle.ViewModelProvider.get(ViewModelProvider.java:102at com.edu.uni.augsburg.uniatron.ui.setting.SettingActivity$GeneralPreferences.onCreatePreferences(SettingActivity.java:64at android.support.v7.preference.PreferenceFragmentCompat.onCreate(PreferenceFragmentCompat.java:225at android.support.v4.app.Fragment.performCreate(Fragment.java:2400at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1418at android.support.v4.app.FragmentTransition.addToFirstInLastOut(FragmentTransition.java:1190at android.support.v4.app.FragmentTransition.calculateFragments(FragmentTransition.java:1073at android.support.v4.app.FragmentTransition.startTransitions(FragmentTransition.java:117at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2407at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2365at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2272at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3271at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3227at android.support.v4.app.FragmentController.dispatchActivityCreated(FragmentController.java:201at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:610at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:178at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1334at android.app.Activity.performStart(Activity.java:6992at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2794at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2906at android.app.ActivityThread.-wrap11(Unknown Source:0at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1605at android.os.Handler.dispatchMessage(Handler.java:105at android.os.Looper.loop(Looper.java:172at android.app.ActivityThread.main(ActivityThread.java:6637at java.lang.reflect.Method.invoke(Native Methodat com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767

Add apps delayed to blacklist

Is your feature request related to a problem? Please describe.
If the user already used an "unblacklisted" app and afterwards add it to the blacklist, then the time account already subtracts the past usage time. This could result in a big amount of minus time.

Describe the solution you'd like
The user add apps to a "delayed"-blacklist, which will start blacklisting the apps from the next day on. But this should only be a feature for the settings. If the user add apps during the onboarding to the blacklist, then these apps should be directly added to the blacklist.

Mood detection

Describe the solution you'd like
When the user enters the Time Credit shop, then the camera should capture an image of the user and analyse the mood out of it. This mood will be shown in the mood selection. If the user feels different to the pre-selected mood by the algorithm, then he can change the selection.

  • If the user changes the selection, a negative feedback will be propagated to the algorithm. However, if the user doesn't change the selection a positive feedback will be propagated.

  • The user should be able to disable this automatic mood detection in the settings.

Menu - today

Is your feature request related to a problem? Please describe.
The "today"-icon in the bottom menu is, by most of the users, assoziated to a calendar view.

Describe the solution you'd like
Move the "today" menu item to the overflow menu. Then the icon can be removed and text with the description can be shown.

Persistence

Create a persistence layer in the domain module.

Documentation

Extend the readme with more detailed information. (e. g. Environment, function, example)

Configurations

Configurable (at which time do the steps reset daily)

Continues Integration

Every new pull-request and their commits should be tested by a continues integration system (e. g. Travis-CI) with automatic static code analysis and junit tests.
To keep the code coverage in glance, a tool for automatic test analysis is also needed (e. g. Coveralls).

ApptrackingService NullPointerException

function blockByLearningAid throws NullPointerException

07-01 23:44:26.223 10066-10066/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.edu.uni.augsburg.uniatron, PID: 10066
java.lang.NullPointerException: Attempt to invoke virtual method 'long java.lang.Long.longValue()' on a null object reference
at com.edu.uni.augsburg.uniatron.service.AppTrackingService.blockByLearningAid(AppTrackingService.java:225)
at com.edu.uni.augsburg.uniatron.service.AppTrackingService.delegateAppUsage(AppTrackingService.java:184)

App usage by blacklisted apps

Describe the bug
The app usage time for a specified time range is collected for all apps.

Expected behavior
The app usage time for a specified time range should be collectable only for the apps which are blacklisted.

Possible solution

  • Rename method to loadRemainingAppUsageTimeByBlacklist
  • Add method parameter: List blacklist
  • Query only for entries which are contained in the blacklist parameter

In the AppUsageDao:

    @Query("SELECT (SELECT TOTAL(time_in_minutes * 60) FROM TimeCreditEntity "
            + "WHERE timestamp BETWEEN :dateFrom AND :dateTo) - TOTAL(usage_time_in_seconds) "
            + "FROM AppUsageEntity WHERE timestamp BETWEEN :dateFrom AND :dateTo")
    LiveData<Integer> loadRemainingAppUsageTime(Date dateFrom, Date dateTo);

Charts

Requested charts:

  • Steps over periode (x-axis of 24-hours/n-days/12-months)
  • App usage time trend over periode (comparing between last periode day/month/year in minutes/hours/days/percent?)
  • Change in the mood as trend over periode (a comparison like for app usage time)

Basic UI, Emotion tracking

The app should track the emotion of the user when a new time credit is traded. Therefor a dialog after choosing the time credit will ask the user of his emotion.

  • Add emtion model structure to database
  • Create basic UI - History
  • Create basic UI - Home
  • Create basic UI - Settings
  • Create a UI to select the emotion
  • Add tests

Static Code Anaylsis

For a great code quality, we would like to use static code analysis tools like:

  • checkstyle
  • findbugs
  • pmd
  • lint

TimeCreditShopActivity can be created multiple times on top of each other

Describe the bug
When the TimeCreditShopActivity is being started multiple times, it takes multiple presses on the back button to get back to the app

To Reproduce
Steps to reproduce the behavior:

  1. have an app be blocked by the learning aid (branch dh-7-applock)
  2. repeatedly try to open the blocked app
  3. the app will be blocked and the timecreditshop will open

alternatively to 1-3 you can just start multiple intents of the shopactivity to test it
4. open the Uniatron app
5. press the back button and watch as you have to close multiple instances of the shop activity

Expected behavior
the shop should close after pressing back once

Lifestyle Assistant

Based on the apps used, their duration and the steps taken throughout the day, a neural network should be able to preview the user's mood. So basically the emotion that the user gives off is used as a rating for the NN. Thus, one can predict to the user how much he should still move and / or which apps help him to a better mood.

History date grouping

Describe the solution you'd like
The user should be able to group the history entries by date, month and year. By clicking on an item, the (generic) detail view will display the data for the specified date or month or year.

Coveralls multi-module

Currently only the domain module is uploaded to coveralls. There should be a merged jacoco file for all sub-modules which will be uploaded to coveralls.

See:

Default emotion

Describe the bug
The default of the tracked emoticon in the history view is always the worst.

Expected behavior
The default emoticon should be neutral.

Additional context
This issue exists, because the Emotions.getAverage(...) always enters the if (x >= 0) because the sql query returns 0 if no value exists.

Visibility of next-/prev-date button

Describe the solution you'd like
The button of the next- and prev-date button should be not visible, when there is no next/prev date to select.

App names in home chart

Describe the bug
The names of the TOP 5 apps are displayed with their package names and not the label names. This is happening, because the AppUsage is saved with the app package name as identifier. This means, that the HomeViewModel must be updated to return the app label and not the package name.

Expected behavior
The TOP 5 chart on the home screen displayes the app labels.

Screenshots
photo5228759174484175181

Detail history day view

With a click on a history item, a detailed view should be opened to display more information about this specific day.
A delightful animation for the detail view would be the animation like google's inbox message.

As a delight startup of the detail view would be a vertical bar chart which depicts the usage time of all apps over a day (x-axis = hours of day 0-23; y-axis = time of usage in minutes).
As an example:
Like this

Final Design

An enhanced design to the final app.

Home

In the new version of the home screen, the user can find all the relevant information above the bottom navigation. The time credit shop is reachable through the orange action button. See the Material Design specs.
wireframe_design_home

Time Credit Shop

The user need's to choose a time credit to buy more usage time. Therefor an overview of all possible credits should be available. These credits shoud be grayed out if they were not available due to less steps. In two columns and five rows every credit has enough place. Maybe it should be discussed whether to create the shop inside a dialog or as a standalone activity (@leonpoint @speedyhoopster3 @anja-h ).
40054415-0e93784a-5845-11e8-9803-dd876d0c4a22

History

The history elements are more structured then before. The emotion is a highlight in front of the element. By clicking on "Details" the detail view #18 can be accessed. To provide a relative date caption, the DateUtils or a library (e. g. timeago) can be used.
The history should be choosable between year, month and day wise.
wireframe_design_history
wireframe_design_history_2

App onboarding

The user should be guided through the first steps to set up a basic configuration. Therefor the material design uses Onboarding. A sample library can be found on GitHub.

1. Introduction

The introduction screen should display a short preview of the main goal of this app.

2. Quickstart

The second screen let the user choose his fitness level. This should be displayed in a way like the following screenshot. Notice: Only one choice is possible. Maybe a little image should be placed on this screen.

3. Quickstart

The third screen contains a pre-selected list of all installed apps on the device. The user can directly choose, which apps will be blacklisted. The circles could contain the App-Icons in four columns.

4. Start App

App Crash after adding app to blacklist via notification

Describe the bug
App crash after adding App to blacklist via notification and then restarting app afterwards

To Reproduce
Steps to reproduce the behavior:

  1. Install Uniatron App
  2. Install another App
  3. Tap the notification which asks to "add app to blacklist"
  4. Open Uniatron App
  5. Search through the App Blacklist. The recently installed App is not listed here.
  6. Kill Uniatron through task manager to check if problem has to do with caching of blacklist
  7. App crashes

FATAL EXCEPTION: main
    Process: com.edu.uni.augsburg.uniatron, PID: 22725
    java.lang.RuntimeException: Unable to start service com.edu.uni.augsburg.uniatron.service.AddBlacklistEntryService@f9ebce2 with null: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Intent.getStringExtra(java.lang.String)' on a null object reference
        at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3694)
        at android.app.ActivityThread.-wrap21(Unknown Source:0)

 Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Intent.getStringExtra(java.lang.String)' on a null object reference
    at com.edu.uni.augsburg.uniatron.service.AddBlacklistEntryService.onStartCommand(AddBlacklistEntryService.java:24)

Smartphone (please complete the following information):

  • Device: S8

#17 #29

Trading steps not working

Describe the bug
Buying time with step credits doesn't work
To Reproduce
Steps to reproduce the behavior:
Was not able to reproduce.

Blacklist chooser sometimes empty

Describe the bug
Sometimes the dialog for choosing the blacklist apps is empty.

To Reproduce
This error comes up very flexible. For now it is not possible to reproduce the

Expected behavior
The blacklist shows up all the installed apps all the time.

Notification override

Describe the bug
When an amount of new apps is installed by the user, the notification of Uniatron to add these apps to the blacklist is always override by itself. This means, that only the last installed app is possible to add to the blacklist.

Expected behavior
For every new app, a new notification need's to be shown.

Smartphone (please complete the following information):

  • Device: Xiaomi Mi A1
  • OS: Android 8.0.0

App updates from PlayStore trigger BlacklistAddNotification

Describe the bug

  1. When updating any app from the PlayStore, the notification "Click here to add to the blacklist" appears.
  2. This also happens with all silent automatic updates (e.g. of the PlayStore app).
    Thus, the notification appears multiple times per week.

Is Nr. 1 intended?
Nr. 2 is fixed when Nr.1 is resolved.

Multiple entries in History tab

If the 'History' tab is open, taking steps wil create multiple entries

Steps to reproduce the behavior:

  1. Open the history tab
  2. Take some steps
  3. Observe the list

Expected behavior
There should be one entry with the sum of the steps taken

Smartphone (please complete the following information):

  • Device: S8
  • OS: 8

Add app to "blacklist" on installation

When the user installs a new app on the device, Uniatron should detect the installed app automaticly and come up with a dialog to ask, if this app should be also "blacklisted"/blocked on above usage time.

  • Detect new app installations
  • Create notification
  • Show notification of installation
  • Add app to blacklist on notification click

Services go to suspend overnight

Services will not start itself after the phone has been idle for a long time. This might be caused by Samsung battery optimization, or Android Doze.

To Reproduce
Steps to reproduce the behavior:

  1. Install a second Android Stepcounter app (e.g. https://play.google.com/store/apps/details?id=pedometer.steptracker.calorieburner.stepcounter&hl=de )

  2. In the morning, take some steps and watch and other app increase its steps

  3. After a while, open Uniatron and see the recorded steps are 0.

Expected behavior
The app should countt steps no matter the state or time

Suggestions:

  1. register to PowerManager and detect the end of a doze state. See:
    https://developer.android.com/reference/android/os/PowerManager#ACTION_POWER_SAVE_MODE_CHANGED
  2. Create a persistent notification
  3. After installation, prompt user to add app to battery optimization whitelist (the Pedometer app does this in a good way) #20

Samsung Galaxy S8, Android 8.0.0

Blocking pre-installed apps

Describe the solution you'd like
Some apps like Chrome, YouTube and some others are pre-installed on the android devices. These apps should also be choosable to blacklist them.

Time credits will not be added after buying them (or theyre simply not showing)

Describe the bug
Buying time credits with your steps will not add them in your credits (or show them in the circular view)

To Reproduce
Steps to reproduce the behavior:

  1. try to exchange steps for time
  2. choose your emotion
  3. ???
  4. profit (well.. at least for your health)

Expected behavior
increase in the time remaining, shown in the circular view

Smartphone (please complete the following information):

  • Device: S8
  • OS: 8.0
  • Version 1.0

App locking

Lock social/fun apps after a certain amount of usage.

Wearables connection

To get a better accurarcy on the step detection, a connection to the users wearable would be helpful. If the wearable is running under the Android Wear OS a direkt connection could be established. Otherwise a web/rest-api need's to be called to collect the data.

App Icon

For a good user feeling a visually appealing icon is needed.

  • Design a visually appealing icon
  • Replace the placeholder icon with the new icon

Improvement to App Lock List (sorted, only apps etc.) (blacklist)

We should improve the app lock list. It should

  • be sorted alphabetically
  • only include Apps, not services
  • inform the user that blocking 'Uniatron' will stop him from editing App locks or trading his steps if the app use time ran out. This will force the user to uninstall the app.
  • not show essential / emergency services and apps, such as the Telephone, Emergency Mode, etc.
  • (show blocked apps at the beginning of the list)

App usage time tracker

A service which tracks the usage time of each app.

  • Create a service
  • Track the usage time of each app
  • Write the collected data to the database

Apptrack Observer goes to suspend

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Maximal app usage per day

Describe the solution you'd like
An option in the settings to choose how long the blacklisted apps can maximal be used per day. For example: A dialog to set a maximal value of time per minutes. The user would enter (e. g.) 120 minutes, which relates to a blocking of all apps after this time was reached.

Every emotion of the day changes when buying Time Credit

Buying Credit and entering your emotion will change the emotion of every entry of the current day in the History tab

Steps to reproduce the behavior:

  1. Open the history tab
  2. Observe the list
  3. Buy some time with your step credits, and choose an emotion different from the one on the history tab
  4. Observe the list

Expected behavior
Only the current History entry should be changed

Smartphone (please complete the following information):

  • Device: S8
  • OS: 8

Learning aid

Learning aid (locking screen/apps for certain time).

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.