Android Open Source - DashBit Fitbit Util






From Project

Back to project page DashBit.

License

The source code is released under:

Apache License

If you think the Android project DashBit listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.jasonphanley.dashbit.api;
/* ww  w  .j ava2s. c  o  m*/
import com.jasonphanley.dashbit.R;
import com.jasonphanley.dashbit.model.Units;

import android.content.Context;

public class FitbitUtil {
    
    private static final String AUTH_CALLBACK_URL = "jph-dashbit://auth";
    
    public static FitbitClient createClient(Context context) {
        return new FitbitClient(context,
                context.getString(R.string.fitbit_api_key),
                context.getString(R.string.fitbit_api_secret),
                AUTH_CALLBACK_URL);
    }
    
    public static Units getUnits(String units) {
        return FitbitClient.FITBIT_API_US_UNITS.equals(units)
                ? Units.US : Units.METRIC;
    }
    
    public static String getUnits(Units units) {
        return units == Units.US ? FitbitClient.FITBIT_API_US_UNITS : null;
    }
    
}




Java Source Code List

com.jasonphanley.dashbit.api.FitbitApi.java
com.jasonphanley.dashbit.api.FitbitClient.java
com.jasonphanley.dashbit.api.FitbitUtil.java
com.jasonphanley.dashbit.app.App.java
com.jasonphanley.dashbit.app.AuthActivity.java
com.jasonphanley.dashbit.app.FitbitExtension.java
com.jasonphanley.dashbit.app.PrefsActivity.java
com.jasonphanley.dashbit.app.PrefsFragment.java
com.jasonphanley.dashbit.model.Activities.java
com.jasonphanley.dashbit.model.Units.java