问题
I want get my run activity location data and use the data in my android app,so I use the Microsoft health cloud API. I can login by using my live ID, and I can read my activity data,include MapPoints, but I can`t get any GPS location information. ‘latitude’ and ‘longitude’ value is 0. I have set the scope of oauth2.0 to "offline_access mshealth.ReadProfile mshealth.ReadActivityHistory mshealth.ReadActivityLocation mshealth.ReadDevices",but it still doesn't work. I use android async httpclient to get data.
String msToken = "MSTOKEN...";
String profileUrl = ConstValue.getMSHealthURL(ConstValue.MS_API_HEALTH_URL_ACTIVITIES);
RequestParams params = new RequestParams();
params.add("activityIds","2519604437250480855");
params.add("activityIncludes","Details,MapPoints");
AsyncHttpClient client = new AsyncHttpClient(true, 80, 443);
msToken = String.format("bearer %s", msToken);
client.addHeader("Authorization",msToken);
Log.v("mstoken",msToken);
client.get(profileUrl,params, new TextHttpResponseHandler() {
@Override
public void onFailure(int i, Header[] headers, String s, Throwable throwable) {
}
@Override
public void onSuccess(int i, Header[] headers, String s) {
Log.v("activity",s);
}
});
回答1:
Microsoft said they have been fix the bug,and I tested it,it's ok now.
来源:https://stackoverflow.com/questions/32816456/cant-get-gps-location-in-map-point-via-microsoft-health-api