This is sample based on Google Drive API. Simple use case — using Google Drive to backup and restore SQLite Database.
This example uses Java, SQLite DB, Google Sign In, Google Drive API, Constraint Layout. The app connects to Google Drive to backup and restore SQLite Database. This case uses a private directory (application directory) of Google Drive and the owner of Google Drive cannot get access to this folder only the app can do this. This example can help you if you want to save application info and you don't have backend or other storage. Google Drive is free storage and this solution can save your money.
- Connected Google Play services on a phone
- Google account to access Google Drive
- Click to input and write text
- Click "Write to database", the app saves your text to the SQLite
- Click "Save to Google Drive", the app uploads your DB to the Google Drive private storage
- Click "Restore from Google Drive", the app downloads your DB from the Google Drive, than restore local DB and shows string from DB in input.