2010-09-26 39 views
4

我嘗試使用下面的代碼登錄到YouTube會從安卓

mService = new YouTubeService("Nothing", developer_key); 

//Authentication 
try 
{ 
    mService.setUserCredentials(mUsername, mPassword); 
} 
catch (AuthenticationException e) 
{ 
    Log.v(TAG, e.toString()); 
} 

登錄到你管,但我得到:
ConnectYouTube: com.google.gdata.util.AuthenticationException: Error connecting with login URI

此代碼似乎很基本的給我,我可以」弄清楚我在這裏犯了什麼錯誤。

+0

你在Android清單文件中檢查互聯網權限..? – Vaibhav 2010-09-26 21:24:21

+0

非常感謝。這就是訣竅! – 2010-09-28 01:07:02

回答

0

請確保您有以下權限:

  • android.permission.INTERNET對
  • android.permission.GET_ACCOUNTS
  • android.permission.USE_CREDENTIALS
  • android.permission.MANAGE_ACCOUNTS