Hi,
I have an b4A app which stores data in an SQLLITE db. The database is stored in the mobile device.
I want to provide the following feature for the client
Assume: Google User-id would be picked from a 'settings file'.
:
When the client clicks on a 'BACKUP DATABASE TO GOOGLE DRIVE' button (say), the following should take place:
a) The application should detect if 'the end-user has already logged into Google'.
If not, it should display the 'STANDARD User-id and password dialog' of Google[the Google-Authentication dialog]
but with the 'user-id already pasted' from the 'Settings'
b) Upon typing the password and clicking on Login, the application should directly 'STORE/OVERWRITE' the existing SQLLITE.DB database in a 'pre-created folder under GOOGLE DRIVE of the client'.
c) if that folder is not created already in Google Drive, then the app should create that folder in Google Drive before saving the database file
d) if a) is already done .. meaning 'end-user has already logged into Google Drive' then it should directly do step c) [meaning app should detect that Google Authentication has already been done and directly access the Google Drive of the client and perform the activity in c) ]...
Requesting for help on:
1) Whether the below code is the right way to get to full path of my 'SQLLITE database file' in the MOBILE and copy to GoogleDrive ?
Presently thinking of doing the actual copy operation in this way ...(assuming I will get the PathInGoogleDrive which I do not know how to presently)
Wwanted to know whether this will work with Google Drive Folder as the Target path...
2) How to do a),b), c) and d) above.
Thanks
I have an b4A app which stores data in an SQLLITE db. The database is stored in the mobile device.
I want to provide the following feature for the client
Assume: Google User-id would be picked from a 'settings file'.
:
When the client clicks on a 'BACKUP DATABASE TO GOOGLE DRIVE' button (say), the following should take place:
a) The application should detect if 'the end-user has already logged into Google'.
If not, it should display the 'STANDARD User-id and password dialog' of Google[the Google-Authentication dialog]
but with the 'user-id already pasted' from the 'Settings'
b) Upon typing the password and clicking on Login, the application should directly 'STORE/OVERWRITE' the existing SQLLITE.DB database in a 'pre-created folder under GOOGLE DRIVE of the client'.
c) if that folder is not created already in Google Drive, then the app should create that folder in Google Drive before saving the database file
d) if a) is already done .. meaning 'end-user has already logged into Google Drive' then it should directly do step c) [meaning app should detect that Google Authentication has already been done and directly access the Google Drive of the client and perform the activity in c) ]...
Requesting for help on:
1) Whether the below code is the right way to get to full path of my 'SQLLITE database file' in the MOBILE and copy to GoogleDrive ?
Presently thinking of doing the actual copy operation in this way ...(assuming I will get the PathInGoogleDrive which I do not know how to presently)
B4X:
Public RTP As RuntimePermissions
PUBLIC DBName="xyz.db"
Public PathInGoogleDrive as string 'the above string will hold the target path in the Google Drive..
SafeDirectory = RTP.GetSafeDirDefaultExternal("")
If File.Exists(SafeDirectory, DBName) = TRUE Then
Wait For (File.CopyAsync(SafeDirectory,DBName,PathInGoogleDrive, DBName)) Complete (Success As Boolean)
End If
Wwanted to know whether this will work with Google Drive Folder as the Target path...
2) How to do a),b), c) and d) above.
Thanks
Last edited: