added method to retrieve heartbeats, needs to be tested

This commit is contained in:
Giulia
2018-06-08 12:39:37 +02:00
parent 59aaba9b63
commit caff07bc5b
5 changed files with 38 additions and 33 deletions

View File

@@ -1,9 +1,14 @@
import manage.AuthFITBIT;
import manage.FITBITData.HeartRate;
import manage.FITBITData.Sleep;
public class Main {
public static void main(String[] args) throws Exception {
AuthFITBIT fitbit = new AuthFITBIT();
fitbit.run("https://api.fitbit.com/1/user/-/activities/heart/date/today/1d.json");
HeartRate h = fitbit.run("https://api.fitbit.com/1/user/-/activities/heart/date/today/1d.json", HeartRate.class); // 1sec/time/00:00/00:01.json
Sleep s = fitbit.run("https://api.fitbit.com/1.2/user/-/sleep/date/today.json", Sleep.class);
System.out.println(h.dateTime + " " + h.average);
}
}