2010-09-26 83 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