2011-11-01 118 views
1

我正在開發新固件的歡迎應用程序。 此應用將在出廠重置後立即運行。 我想知道是否有創建Google帳戶(如果新用戶還沒有)的聯繫人和callendar同步的方法。 我得到了SimpleSyncAdapter示例,我很難弄清楚如何使用這個自定義活動形式,這將是教程/歡迎程序的一個步驟。在google示例中,AuthenticatorActivity啓動一個AuthenticationService實例化Authentication類。是否可以使用Android API使用自定義窗體創建Google帳戶?

身份驗證類有以下方法:

public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, 
    String authTokenType, String[] requiredFeatures, Bundle options) { 

    final Intent intent = new Intent(mContext, AuthenticatorActivity.class); 
    intent.putExtra(AuthenticatorActivity.PARAM_AUTHTOKEN_TYPE, authTokenType); 
    intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response); 
    final Bundle bundle = new Bundle(); 
    bundle.putParcelable(AccountManager.KEY_INTENT, intent); 
    return bundle; 
} 

但我不能夠實例,在我AccountActivity延伸AbstractAccountAuthenticator認證類。另外,我不確定這是否會幫助我。我不清楚這種方法。

任何人都可以點亮一下嗎?

謝謝大家!

回答

相關問題