Can`t get GPS location in map point via microsoft health API

霸气de小男生 提交于 2019-12-11 04:35:08

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!