title: How to backup (or sync) app's data (stored in sqlite database) to google (or gmail) from Android application?
body: <p>I'm developing an Android application that needs to backup (and restore) some data stored in an sqlite database to (from) google (or gmail). But I don't have a clue about where to start. I read the backup guide in the <a href="http://developer.android.com/guide/topics/data/backup.html" rel="nofollow noreferrer">Android documentation</a>. But that's not what I need since the backup operation in that way might not be taken immediately, and it needs the device user to turn on the backup option in &quot;settings-&gt;privacy&quot;.<br />
  I need a way that first authenticates the user's account (already on the device) using OAuth or OAuth 2.0, then after authentication, the app sends the data to gmail and can later get it back from gmail to restore it to the device.<br />
  How can I implement this?<br />
  Another question: when I send the data to gmail, what format should i use? The database file, XML, or something else?</p>