Skip to content

Commit

Permalink
Initial Withings integration
Browse files Browse the repository at this point in the history
  • Loading branch information
audaciouscode committed Mar 19, 2017
1 parent 4b56ef7 commit 1b79282
Show file tree
Hide file tree
Showing 70 changed files with 4,593 additions and 646 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Expand Up @@ -3,11 +3,11 @@ language: android
jdk: oraclejdk8

before_install:
- wget http://services.gradle.org/distributions/gradle-2.14.1-bin.zip
- unzip gradle-2.14.1-bin.zip
- export GRADLE_HOME=$PWD/gradle-2.14.1
- wget http://services.gradle.org/distributions/gradle-3.3-bin.zip
- unzip gradle-3.3-bin.zip
- export GRADLE_HOME=$PWD/gradle-3.3
- export PATH=$GRADLE_HOME/bin:$PATH
- ( sleep 5 && while [ 1 ]; do sleep 1; echo y; done ) | android update sdk -a --no-ui --filter tool,platform-tool,build-tools-25.0.0
- ( sleep 5 && while [ 1 ]; do sleep 1; echo y; done ) | android update sdk -a --no-ui --filter tool,platform-tool,build-tools-25.0.2

script:
- gradle assembleDebug
Expand Down
9 changes: 7 additions & 2 deletions AndroidManifest.xml
@@ -1,13 +1,18 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.audacious_software.pdk.passivedatakit">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION" />
<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" />
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme">
<uses-permission android:name="android.permission.READ_SMS" />
<application android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" android:theme="@style/AppTheme">
<activity android:name="com.audacious_software.passive_data_kit.activities.generators.MicrosoftBandAuthActivity" android:label="@string/app_name" />
<activity android:name="com.audacious_software.passive_data_kit.activities.generators.RequestPermissionActivity" android:label="@string/app_name" />
<activity android:name="com.audacious_software.passive_data_kit.activities.DiagnosticsActivity" android:label="@string/app_name" />
<activity android:name="com.audacious_software.passive_data_kit.activities.DataStreamActivity" android:label="@string/app_name" />
<activity android:name="com.audacious_software.passive_data_kit.activities.DataDisclosureActivity" android:label="@string/app_name" />
<activity android:name="com.audacious_software.passive_data_kit.activities.DataDisclosureDetailActivity" android:label="@string/app_name" />
</application>
</manifest>
26 changes: 26 additions & 0 deletions assets/html/passive_data_kit/generator_location_disclosure.html
@@ -0,0 +1,26 @@
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<style type="text/css">
body,
* {
font-family:-apple-system,Helvetica Neue;
font-size: 16px;
}

body {
background-color: F5F5F5;
}
</style>

</head>
<body>
<p>
<em>TODO: Write disclosure for use of location data...</em>
</p>

<p>
Place completed file in <code>assets/html/passive_data_kit/generator_location_disclosure.html</code> in your project to override this placeholder.
</p>
</body>
</html>
31 changes: 14 additions & 17 deletions build.gradle
Expand Up @@ -9,7 +9,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.android.tools.build:gradle:2.3.0'
}
}

Expand All @@ -23,7 +23,7 @@ repositories {

android {
compileSdkVersion 25
buildToolsVersion "25"
buildToolsVersion "25.0.2"

useLibrary 'org.apache.http.legacy'

Expand Down Expand Up @@ -51,25 +51,22 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.android.support:recyclerview-v7:25.0.1'
compile 'com.android.support:cardview-v7:25.0.1'
compile 'com.google.android.gms:play-services-location:9.8.0'
compile 'com.google.android.gms:play-services-maps:9.8.0'
compile 'com.google.android.gms:play-services-nearby:9.8.0'
compile 'com.google.android.gms:play-services-places:9.8.0'
compile 'com.google.android.gms:play-services-awareness:9.8.0'
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.android.support:recyclerview-v7:25.3.0'
compile 'com.android.support:cardview-v7:25.3.0'
compile 'com.google.android.gms:play-services-location:10.2.0'
compile 'com.google.android.gms:play-services-maps:10.2.0'
compile 'com.google.android.gms:play-services-nearby:10.2.0'
compile 'com.google.android.gms:play-services-places:10.2.0'
compile 'com.google.android.gms:play-services-awareness:10.2.0'
compile 'com.android.support:customtabs:23.3.0'
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.0'
compile 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7'

compile project(':libraries-base')
compile project(':libraries-common')
compile project(':libraries-controller')
compile 'com.github.philjay:mpandroidchart:v3.0.1'
}

buildTypes {
Expand All @@ -78,4 +75,4 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
}
1 change: 0 additions & 1 deletion gvr-android-sdk
Submodule gvr-android-sdk deleted from 3360cb
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-hdpi/ic_pdk_diagnostic.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-hdpi/ic_text_messages.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-hdpi/ic_withings_device.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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_pdk_diagnostic.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_text_messages.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_withings_device.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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_pdk_diagnostic.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_text_messages.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_withings_device.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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_pdk_diagnostic.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_text_messages.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_withings_device.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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_pdk_diagnostic.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_text_messages.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_withings_device.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions res/drawable/ic_location_heatmap_marker.xml
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<size android:width="8dp" android:height="8dp" />
<solid android:color="#80D50000" />
</shape>
37 changes: 29 additions & 8 deletions res/layout/card_diagnostic_action.xml
@@ -1,20 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
card_view:cardCornerRadius="4dp"
android:layout_margin="16dp">
<TextView
android:id="@+id/message_action"
android:layout_margin="16dp"
android:layout_margin="8dp">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content">
<TextView android:id="@+id/action_title"
android:background="#C62828"
android:padding="8dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical|start"
android:layout_weight="1"
android:textSize="14sp"
android:textStyle="bold"
android:textColor="@android:color/white" />
<TextView android:id="@+id/action_message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:textSize="14sp"
android:textColor="@android:color/black"
android:background="@android:color/white"
android:padding="12dp">
</TextView>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
30 changes: 18 additions & 12 deletions res/layout/card_generator_location_google.xml
Expand Up @@ -2,6 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
Expand Down Expand Up @@ -42,24 +43,29 @@
android:textColor="@android:color/white"
android:layout_marginRight="8dp"/>
</LinearLayout>
<FrameLayout android:orientation="horizontal"
<FrameLayout
android:layout_width="match_parent"
android:layout_height="240dp">
android:layout_height="200dp">
<com.google.android.gms.maps.MapView android:id="@+id/map_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#757575"
app:mapType="hybrid"
app:liteMode="true" />
<TextView android:id="@+id/generator_location_description"
android:layout_width="match_parent"
android:background="#757575" />
<android.support.v7.widget.SwitchCompat
android:id="@+id/pdk_google_location_map_type_hybrid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:textColor="@android:color/white"
android:background="#C0000000"
android:padding="8dp">
</TextView>
android:layout_gravity="bottom|right"
android:layout_marginRight="6dp"
android:layout_marginBottom="104dp" />
</FrameLayout>
<!-- <TextView android:id="@+id/generator_location_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:textColor="@android:color/white"
android:background="#33691E"
android:padding="8dp">
</TextView> -->
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
9 changes: 8 additions & 1 deletion res/layout/card_generator_phone_calls.xml
Expand Up @@ -41,7 +41,8 @@
android:textColor="@android:color/white"
android:layout_marginRight="8dp"/>
</LinearLayout>
<LinearLayout android:orientation="horizontal"
<LinearLayout android:id="@+id/card_content"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="8dp">
Expand Down Expand Up @@ -150,6 +151,12 @@
android:layout_marginBottom="8dp"/>
</LinearLayout>
</LinearLayout>
<TextView android:id="@+id/card_empty"
android:text="@string/message_generator_phone_calls_empty"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="16dp" />
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
9 changes: 8 additions & 1 deletion res/layout/card_generator_screen_state.xml
Expand Up @@ -41,7 +41,8 @@
android:textColor="@android:color/white"
android:layout_marginRight="8dp"/>
</LinearLayout>
<LinearLayout android:orientation="horizontal"
<LinearLayout android:id="@+id/card_content"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="8dp">
Expand Down Expand Up @@ -138,6 +139,12 @@
</LinearLayout>
</LinearLayout>
</LinearLayout>
<TextView android:id="@+id/card_empty"
android:text="@string/message_generator_screen_state_empty"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="16dp" />
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>

0 comments on commit 1b79282

Please sign in to comment.