3
我使用OneDrive compile('com.onedrive.sdk:onedrive-sdk-android:1.0.2')
版本如何獲得個人資料的細節使用OneDrive API的Android
,並試圖從IOneDriveClient
得到資料相片和電子郵件細節,但沒有找到一種方式來獲得這個。
- 用戶照片
- 電子郵件
請幫助得到這些細節。
我使用OneDrive compile('com.onedrive.sdk:onedrive-sdk-android:1.0.2')
版本如何獲得個人資料的細節使用OneDrive API的Android
,並試圖從IOneDriveClient
得到資料相片和電子郵件細節,但沒有找到一種方式來獲得這個。
請幫助得到這些細節。
您可以在這裏找到有關OneDrive的Getting user data (Android) using Microsoft Live SDK的文檔。
Live SDK for Android使您的Android應用程序能夠訪問Microsoft OneDrive上的用戶的 信息。
Microsoft Live SDK Home Page (Android Apps)
Documentation for the Classes available in the API
從頁面的示例代碼查找所有者名稱:
this.greetUserButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
client.getAsync("USER ID", new LiveOperationListener() {
public void onComplete(LiveOperation operation) {
try {
JSONObject result = operation.getResult();
String name = result.getString("first_name");
// Display user's first name.
} catch (JSONException e) {
// Display error if first name is unavailable.
return;
}
}
public void onError(LiveOperationException exception, LiveOperation operation) {
// Display error if operation is unsuccessful.
}
});
}
});
我想如果你從這裏開始進一步挖掘和探索使用的類,你」我會弄清楚如何提取你想要的其他信息。
我沒有得到client.getAsync,在使用IOneDriveClient時,我認爲上面的方法是從舊的API。 – IshRoid
你是否聲明'client'是'LiveConnectClient'的一個實例?請參閱頁面上的第三步。 – AndroidMechanic
https://msdn.microsoft.com/zh-cn/library/office/hh846831.aspx – AndroidMechanic