title: How to read file from App folder google drive without DriveId?
body: <p>i have function and working fine ! but its by pass Drive id ? what if Drive id deleted or destroy !</p>
  
  <p>is their any method to find drive id? </p>
  
  <p>i faced difficulties in such scenario</p>
  
  <ol>
  <li>user re-join my app or change device</li>
  <li>if i missed my drive id from shared preference </li>
  </ol>
  
  <p>=======================================================
  my working functon</p>
  
  <pre><code> readFromGooDrive(DriveId mDriveId) {
        byte[] buf = null;
        if (getGoogleApiClient() != null &amp;&amp; getGoogleApiClient().isConnected()) try {
          DriveFile df = Drive.DriveApi.getFile(getGoogleApiClient(), mDriveId);
          df.open(getGoogleApiClient(), DriveFile.MODE_READ_ONLY, null)
            .setResultCallback(new ResultCallback&lt;DriveContentsResult&gt;() {
            @Override
            public void onResult(DriveContentsResult driveContentsResult) {
              if ((driveContentsResult != null) &amp;&amp; driveContentsResult.getStatus().isSuccess()) {
                DriveContents contents = driveContentsResult.getDriveContents();
                  BufferedInputStream bis = new BufferedInputStream(contents.getInputStream());
                  byte[] buffer = new byte[1024];
                  int bytesread = 0;
                  FileOutputStream outStream;
                  try
                  {
                      String databasePath = getBaseContext().getDatabasePath("my database").getPath();
                      outStream = new FileOutputStream(databasePath);
                      while( (bytesread = bis.read(buffer)) != -1)
                      {
                          outStream.write(buffer,0,bytesread);
                      }
  
                      outStream.flush();
                      bis.close();
                      outStream.close();
                  }
                  catch (FileNotFoundException e)
                  {
                      Log.i(TAG,e.getMessage());
                  }
                  catch (IOException e)
                  {
                      Log.i(TAG,e.getMessage());
                  }
                  finally {
                      Toast.makeText(getBaseContext(),"Data from Google Drive restored successfully." , Toast.LENGTH_LONG).show();
                  }
                  contents.discard(getGoogleApiClient());
              }
            }
          });
        } catch (Exception e) { e.printStackTrace(); }
      }
  </code></pre>