title: Setting up Google phone Account programmatically
body: <p>I am interested in adding and setting up a hard-coded Google Account with a given username and password programmatically on the phone without any user intervention.</p>
  
  <p>I have tried using </p>
  
  <pre><code>AccountsManager.addAccountExplicitly(newAccount("xxxxxx@gmail.com","com.google",password,null) 
  </code></pre>
  
  <p>It works perfectly for all the <code>accountsType</code> except for the <strong>com.google</strong> <code>accountsType</code> throwing the "uid not matching authenticator
  id" exception.</p>
  
  <p>I have already followed all the suggestions given in this particular thread for fixing the error but of no use, the error persists for <strong>com.google</strong> accounts type</p>
  
  <p><a href="https://stackoverflow.com/questions/3774282/securityexception-caller-uid-xxxx-is-different-than-the-authenticators-uid">SecurityException: caller uid XXXX is different than the authenticator&#39;s uid</a></p>
  
  <p>The other alternative approach I tried was using the <code>samplesyncadapter</code> code, it works perfectly fine, the authentication part is done in <code>NetworkUtilities</code> file which I believe need to be changed to Google accounts <code>clientlogin</code></p>
  
  <p>Is there anyway this can be performed directly without user intervention for captcha??</p>