I'm trying to access to Google Drive Android API when my App runs in the background the client is automatically disconnected, is there any method to keep the client connected while in the background or to connect the client.
public void scheduleBackgroundBackup(){
getP().edit().putBoolean(UPDATE_BACKUP, true).apply();
Log.d("--->BACKGROUND ","scheduling BACKUP");
try{
DriveCore m =CoreApp.getDriveManager();
Log.d("--->BG Client","is Connected :"+m.isConnected()+"");
AppState cs = new AppState (this,
m,
CoreApp.getUserID(),
false);
m.connect();
Log.d("--->BG Client2","is Connected :"+m.isConnected()+"");
m.fetchDriveFiles(DriveMode.BACKGROUND_SAVE,this,cs);
}catch (Exception e){
e.printStackTrace();
Log.d("--->BG BACKUP","Cannot Load Drive Core");
}
updateBackupBackground();
}
so after this code I knew that the user is automatically disconnected in the background.