android - How to find coustom history in Google Fit -
i working on android application wristband devices , devices have specific ble protocol, google fit can't work directly. , add application google fit historyapi, when receive steps,distance,calories device, store in fit server via api using code this
datasource dstep_source = new datasource.builder() .setapppackagename(app.mcontext.getpackagename()) .setdatatype(datatype.type_step_count_delta) .setname("geekfit steps") .setstreamname("geekfit steps") .settype(datasource.type_raw) .build(); // steps data dataset dataset = dataset.create(dstep_source); datapoint datapoint = dataset.createdatapoint(); datapoint.settimestamp(sport.gettimestamp(), timeunit.milliseconds); datapoint.getvalue(field.field_steps).setint(sport.getsteps() - lastsport.getsteps()); dataset.add(datapoint); log.i(tag, "inserting dataset in history api"); com.google.android.gms.common.api.status insertstatus = fitness.historyapi.insertdata(mclient, dataset).await(1, timeunit.minutes); // before querying data, check see if insertion succeeded. if (!insertstatus.issuccess()) { log.i(tag, "there problem inserting dataset."); return null; } log.i(tag, "fit insert success!");
i have success callbacks, cant find inserted data on google fit application, see steps counted mobile device , that's all.
what wrong?
Comments
Post a Comment