1
我想獲取我的運行活動位置數據並使用我的android應用程序中的數據,因此我使用Microsoft健康雲API。我可以使用我的實時ID進行登錄,並且可以閱讀我的活動數據,包括MapPoint,但我無法獲取任何GPS位置信息。 '緯度'和'經度'值爲0. 我已經將oauth2.0的範圍設置爲「offline_access mshealth.ReadProfile mshealth.ReadActivityHistory mshealth.ReadActivityLocation mshealth.ReadDevices」,但它仍然不起作用。 我使用android async httpclient來獲取數據。無法通過微軟健康API獲取地圖上的GPS位置
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);
}
});
你能告訴我們一些你試過的代碼嗎? – Scorpio
@Scorpio我添加了一些用於請求活動數據的示例代碼,感謝您的回覆 –
我看到同樣的事情(來自WP8.1應用程序) – ScottIsAFool