title: Read file from App folder in android from google drive
body: <p>I have created a file in App folder in Google drive.and i want to read the file which i have created.i have write some string to file which is created in App folder.Now i want to know that how i can read that data which is written to that file in app folder.Bellow i am mentioning the code through which i have created the file in app folder on google drive.If anybody knows then please help me how to read that? i have searched a lot and i also see Google's demo but i didn't understand. is there any simple way to do this?
   can anybody please help me i will be very thankful to you.The below code is done from <a href="https://github.com/googledrive/android-demos/blob/master/src/com/google/android/gms/drive/sample/demo/CreateFileInAppFolderActivity.java" rel="nofollow">https://github.com/googledrive/android-demos/blob/master/src/com/google/android/gms/drive/sample/demo/CreateFileInAppFolderActivity.java</a> link.</p>
  
  <pre><code> public class Fifth extends BaseDemoActivity {
  
                      @Override
                      protected void onCreate(Bundle savedInstanceState) {
                          super.onCreate(savedInstanceState);
                          setContentView(R.layout.activity_fifth);
                      }
  
                       @Override
                          public void onConnected(Bundle connectionHint) {
                              super.onConnected(connectionHint);
                              // create new contents resource
  
                              Drive.DriveApi.newContents(getGoogleApiClient())
                                      .setResultCallback(contentsCallback);
                          }
  
                          final private ResultCallback&lt;ContentsResult&gt; contentsCallback = new
                                  ResultCallback&lt;ContentsResult&gt;() {
                              @Override
                              public void onResult(ContentsResult result) {
                                  if (!result.getStatus().isSuccess()) {
                                      showMessage("Error while trying to create new file contents");
                                      return;
                                  }
                                  // Get an output stream for the contents.
                                  OutputStream outputStream = result.getContents().getOutputStream();
                                  // Write the bitmap data from it.
                                  String data="hello world";
                                   byte[] bytes = data.getBytes();
  
                                //  ByteArrayOutputStream bitmapStream = new ByteArrayOutputStream();
  
                           //      image.compress(Bitmap.CompressFormat.PNG, 100, bitmapStream);
                                  try {
                                      Log.i("Success", "able to write file contents.");
                                      outputStream.write(bytes);
                                  } catch (IOException e1) {
                                      Log.i("Failier", "Unable to write file contents.");
                                  }
                                  MetadataChangeSet changeSet = new MetadataChangeSet.Builder()
                                          .setTitle("appfile.txt")
                                          .setMimeType("text/plain")
                                          .build();
  
                                  Drive.DriveApi.getAppFolder(getGoogleApiClient())
                                          .createFile(getGoogleApiClient(), changeSet, result.getContents())
                                          .setResultCallback(fileCallback);
                              }
                          };
  
                          final private ResultCallback&lt;DriveFileResult&gt; fileCallback = new
                                  ResultCallback&lt;DriveFileResult&gt;() {
                              @Override
                              public void onResult(DriveFileResult result) {
                                  if (!result.getStatus().isSuccess()) {
                                      showMessage("Error while trying to create the file");
                                      return;
                                  }
  
  
                                  showMessage("Created a file in App Folder: "
                                          + result.getDriveFile().getDriveId());
                                  Log.i("Drioved_ID", ""+result.getDriveFile().getDriveId());
                              }
                          };
  
                  }
  </code></pre>