logging into youtube from android
I am trying t开发者_如何学Pythono log into you tube using the following code
mService = new YouTubeService("Nothing", developer_key);
//Authentication
try
{
mService.setUserCredentials(mUsername, mPassword);
}
catch (AuthenticationException e)
{
Log.v(TAG, e.toString());
}
but I am getting:
ConnectYouTube: com.google.gdata.util.AuthenticationException: Error connecting with login URI
This code seems pretty basic to me and I can't figure out what mistake am I making here.
Make sure you have to following permissions:
- android.permission.INTERNET
- android.permission.GET_ACCOUNTS
- android.permission.USE_CREDENTIALS
- android.permission.MANAGE_ACCOUNTS
精彩评论