Skip to content

Commit

Permalink
Merge branch 'master' into cjk_withings_device_integration
Browse files Browse the repository at this point in the history
* Implements foreground task detector.
  • Loading branch information
audaciouscode committed May 10, 2017
2 parents a1de0d5 + 95eca5e commit f7c0b2c
Show file tree
Hide file tree
Showing 15 changed files with 811 additions and 19 deletions.
5 changes: 4 additions & 1 deletion AndroidManifest.xml
@@ -1,10 +1,13 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.audacious_software.pdk.passivedatakit">
package="com.audacious_software.pdk.passivedatakit"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION" />
<uses-permission android:name="android.permission.READ_CALL_LOG" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" tools:ignore="ProtectedPermissions" />
<application android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" android:theme="@style/AppTheme">
Expand Down
14 changes: 8 additions & 6 deletions build.gradle
Expand Up @@ -16,6 +16,7 @@ buildscript {
repositories {
jcenter()
maven { url "https://jitpack.io" }
maven { url 'https://dl.bintray.com/rvalerio/maven' }
flatDir{
dirs 'libs'
}
Expand All @@ -28,7 +29,7 @@ android {
useLibrary 'org.apache.http.legacy'

defaultConfig {
minSdkVersion 19
minSdkVersion 18
targetSdkVersion 25
versionCode 1
versionName "1.0"
Expand All @@ -54,18 +55,19 @@ android {
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.google.android.gms:play-services-location:10.2.1'
compile 'com.google.android.gms:play-services-maps:10.2.1'
compile 'com.google.android.gms:play-services-nearby:10.2.1'
compile 'com.google.android.gms:play-services-places:10.2.1'
compile 'com.google.android.gms:play-services-awareness:10.2.1'
compile 'com.google.android.gms:play-services-location:10.2.4'
compile 'com.google.android.gms:play-services-maps:10.2.4'
compile 'com.google.android.gms:play-services-nearby:10.2.4'
compile 'com.google.android.gms:play-services-places:10.2.4'
compile 'com.google.android.gms:play-services-awareness:10.2.4'
compile 'com.google.maps.android:android-maps-utils:0.4'
compile 'com.squareup.okhttp3:okhttp:3.2.0'
compile 'commons-io:commons-io:2.4'
compile 'commons-codec:commons-codec:1.10'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'com.fasterxml.jackson.core:jackson-core:2.7.3'
compile 'com.github.philjay:mpandroidchart:v3.0.1'
compile 'com.rvalerio:fgchecker:1.0.1'
}

buildTypes {
Expand Down
Binary file added res/drawable-hdpi/ic_foreground_apps.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_foreground_apps.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_foreground_apps.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxhdpi/ic_foreground_apps.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxxhdpi/ic_foreground_apps.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion res/layout/card_generator_app_event.xml
Expand Up @@ -25,7 +25,7 @@
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginRight="8dp" />
<TextView android:text="@string/generator_app_event"
<TextView android:text="@string/generator_app_events"
android:gravity="center_vertical|start"
android:layout_width="0dp"
android:layout_height="24dp"
Expand Down
333 changes: 333 additions & 0 deletions res/layout/card_generator_foreground_application.xml

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions res/values/databases.xml
Expand Up @@ -27,4 +27,8 @@
<!-- Battery Generator -->
<string name="pdk_generator_device_battery_create_history_table">CREATE TABLE history(_id INTEGER PRIMARY KEY AUTOINCREMENT, fetched INTEGER, transmitted INTEGER, observed INTEGER, health TEXT, level INTERGER, plugged TEXT, present INTEGER, scale INTEGER, temperature INTEGER, voltage INTEGER, technology TEXT, status TEXT);</string>

<!-- Foreground Applications -->
<string name="pdk_generator_foreground_applications_create_history_table">CREATE TABLE history(_id INTEGER PRIMARY KEY AUTOINCREMENT, fetched INTEGER, transmitted INTEGER, observed INTEGER, application TEXT);</string>
<string name="pdk_generator_foreground_applications_history_table_add_duration">ALTER TABLE history ADD duration REAL;</string>

</resources>
3 changes: 3 additions & 0 deletions res/values/diagnostics.xml
Expand Up @@ -19,4 +19,7 @@

<string name="diagnostic_withings_auth_required_title">Access to Withing Account Required</string>
<string name="diagnostic_withings_auth_required">Permission is required to fetch data from the Withings server. Please grant this application the requested permissions.</string>

<string name="diagnostic_usage_stats_permission_required_title">App Usage Data Permission Required</string>
<string name="diagnostic_usage_stats_permission_required">This app requires access to app usage data from your device\'s settings.</string>
</resources>
9 changes: 8 additions & 1 deletion res/values/generators.xml
Expand Up @@ -149,6 +149,13 @@
<color name="generator_battery_header">#1B5E20</color>

<!-- App Event History -->
<string name="generator_app_event">App Event History</string>
<string name="generator_app_events">App Events History</string>
<string name="message_generator_device_app_event_empty">No app events have been logged yet.</string>

<!-- Foreground Application -->
<string name="generator_foreground_application">Foreground Applications</string>
<string name="message_generator_foreground_applications_empty">No application launches have been logged yet.</string>
<string name="generator_foreground_application_top_apps">Most Used (Last 24 Hours)</string>
<string name="generator_foreground_application_recent_apps">Recently Used</string>
<string name="generator_foreground_application_app_name_duration">%1$s: %2$.0fm</string>
</resources>

0 comments on commit f7c0b2c

Please sign in to comment.