2016-01-06 53 views

回答

0

您可以在這裏找到有關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. 
      } 
     }); 
    } 
}); 

我想如果你從這裏開始進一步挖掘和探索使用的類,你」我會弄清楚如何提取你想要的其他信息。

+0

我沒有得到client.getAsync,在使用IOneDriveClient時,我認爲上面的方法是從舊的API。 – IshRoid

+0

你是否聲明'client'是'LiveConnectClient'的一個實例?請參閱頁面上的第三步。 – AndroidMechanic

+0

https://msdn.microsoft.com/zh-cn/library/office/hh846831.aspx – AndroidMechanic

相關問題