Skip to content

Commit

Permalink
Initial Withings work
Browse files Browse the repository at this point in the history
  • Loading branch information
audaciouscode committed Mar 19, 2017
1 parent 257fab6 commit 78e528a
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 11 deletions.
13 changes: 13 additions & 0 deletions AndroidManifest.xml
Expand Up @@ -19,5 +19,18 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.audacious_software.passive_data_kit.activities.OAuthResponseActivity"
android:label="@string/app_name"
android:launchMode="singleTop"
android:screenOrientation="portrait" >
<intent-filter>
<data android:scheme="pdk" />
<data android:host="pennyworth"/>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
</application>
</manifest>
2 changes: 1 addition & 1 deletion PassiveDataKit-Android
17 changes: 13 additions & 4 deletions build.gradle
Expand Up @@ -2,23 +2,29 @@ apply plugin: 'com.android.application'
buildscript {
repositories {
jcenter()
flatDir {
dirs 'libs'
}
}

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

allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
flatDir {
dirs 'libs'
}
}
}

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

sourceSets {
main {
Expand All @@ -31,14 +37,14 @@ android {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'net.hockeyapp.android:HockeySDK:3.7.2'
compile project(':PassiveDataKit')
}

defaultConfig {
applicationId "com.audacious_software.pennyworth"
minSdkVersion 14
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
Expand All @@ -54,4 +60,7 @@ android {

dependencies {
compile project(':PassiveDataKit')
// compile project(':libraries-base')
// compile project(':libraries-common')
// compile project(':libraries-controller')
}
Empty file modified settings.gradle 100644 → 100755
Empty file.
18 changes: 12 additions & 6 deletions src/com/audacious_software/pennyworth/MainActivity.java
Expand Up @@ -13,6 +13,7 @@
import com.audacious_software.passive_data_kit.activities.DataStreamActivity;
import com.audacious_software.passive_data_kit.activities.PdkActivity;
import com.audacious_software.passive_data_kit.generators.Generators;
import com.audacious_software.passive_data_kit.generators.wearables.WithingsDevice;
import com.audacious_software.passive_data_kit.transmitters.HttpTransmitter;

import net.hockeyapp.android.CrashManager;
Expand All @@ -28,14 +29,19 @@ protected void onCreate(Bundle savedInstanceState) {

this.setContentView(R.layout.activity_main);

WithingsDevice.getInstance(this).setProperty(WithingsDevice.OPTION_OAUTH_CONSUMER_KEY, this.getString(R.string.withings_api_key));
WithingsDevice.getInstance(this).setProperty(WithingsDevice.OPTION_OAUTH_CONSUMER_SECRET, this.getString(R.string.withings_api_secret));
WithingsDevice.getInstance(this).setProperty(WithingsDevice.OPTION_OAUTH_CALLBACK_URL, "pdk://pennyworth/oauth/withings");
// WithingsDevice.getInstance(this).setProperty(WithingsDevice.OPTION_OAUTH_CALLBACK_URL, "https://pennyworthproject.org/foo");

PassiveDataKit.getInstance(this).start();

Generators.getInstance(this).addNewDataPointListener(new Generators.NewDataPointListener() {
@Override
public void onNewDataPoint(String identifier, Bundle data) {
Log.e("Pennyworth", "DATA[" + identifier + "] = " + data.toString());
}
});
// Generators.getInstance(this).addNewDataPointListener(new Generators.NewDataPointListener() {
// @Override
// public void onNewDataPoint(String identifier, Bundle data) {
// Log.e("Pennyworth", "DATA[" + identifier + "] = " + data.toString());
// }
// });

CrashManager.register(this, this.getString(R.string.hockeyapp_api_key));

Expand Down

0 comments on commit 78e528a

Please sign in to comment.