无法通过Microsoft Health API获取地图点中的GPS位置 [英] Can`t get GPS location in map point via microsoft health API

查看:88
本文介绍了无法通过Microsoft Health API获取地图点中的GPS位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获取我的跑步活动位置数据并在我的android应用中使用这些数据,因此我使用了Microsoft health cloud API.我可以使用自己的实时ID登录,并且可以读取我的活动数据,包括MapPoints,但是我无法获取任何GPS位置信息. 纬度"和经度"值为0. 我已将oauth2.0的范围设置为"offline_access mshealth.ReadProfile mshealth.ReadActivityHistory mshealth.ReadActivityLocation mshealth.ReadDevices",但它仍然无法正常工作. 我使用android async httpclient获取数据.

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);
    }
});

推荐答案

Microsoft说他们已经修复了该错误,而我对其进行了测试,现在可以了.

Microsoft said they have been fix the bug,and I tested it,it's ok now.

这篇关于无法通过Microsoft Health API获取地图点中的GPS位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆