I have read allot about Google drive integration and I want to save STRING into Google drive and also to retrieve, I have used this demo but it is giving me errors. please anyone provide me demo for my requirement
-
What is the errors? post it – M D Mar 12 '14 at 09:25
-
when i import that demo , it is giving me errors, in all the packages, or can you provide any demo to save STRING into Google drive and also to retrieve? – Achin Mar 12 '14 at 09:27
-
Go to this: [https://github.com/googledrive/android-quickstart](https://github.com/googledrive/android-quickstart) – M D Mar 12 '14 at 09:31
-
ok i have read that, but how can i retrieve the data that i saved? – Achin Mar 12 '14 at 09:34
-
that only saved the data to drive, is there any code to get that particular data – Achin Mar 12 '14 at 09:38
-
Goo to this: [http://stackoverflow.com/questions/12164024/android-open-and-save-files-to-from-google-drive-sdk](http://stackoverflow.com/questions/12164024/android-open-and-save-files-to-from-google-drive-sdk) – M D Mar 12 '14 at 09:40
-
hi, i have used the above code and when i run that code it first capture the image and just crates the FOLDER only into my google drive, i does not saving the image into my google drive. – Achin Mar 12 '14 at 10:14
-
you added READ and WRITE PERMISSION in manifest.xml? – M D Mar 12 '14 at 10:15
-
yes i have done that , no issue of PERMISSION – Achin Mar 12 '14 at 10:16
-
OutputStream outputStream = result.getContents().getOutputStream(); // Write the bitmap data from it. ByteArrayOutputStream bitmapStream = new ByteArrayOutputStream(); image.compress(Bitmap.CompressFormat.PNG, 100, bitmapStream); try { outputStream.write(bitmapStream.toByteArray()); } catch (IOException e1) { Log.i(TAG, "Unable to write file contents."); } – Achin Mar 12 '14 at 10:16
-
this is code in that link you send me, but it does not send the image to google drive it only writes the image to outputStream – Achin Mar 12 '14 at 10:18
-
and one more thig i am getting error Cannot find DriveId. Are you authorized to view this file? – Achin Mar 12 '14 at 11:53
-
It has been answered here - [SO 22350825][1]. [1]: http://stackoverflow.com/questions/22350825/cannot-find-driveid-are-you-authorized-to-view-this-file-android-google-drive – seanpj Mar 12 '14 at 17:41
1 Answers
First, let's clear the confusion here. Your original question refers to a demo that uses the original RESTful API (aka DriveSDKv2), where Simple Plan mentions a different API, the new Google Drive Android API (GDAA).
The GDAA, does not have the full functionality at the moment, but it can be combined with the DriveSDKv2 to supplement what's missing (delete, description, indexable, ...). On the other hand, the GDAA takes care of all synchronization, offline and caching issues. You just create, retrieve, update the files as if they were local and the magic of up/down synchronization is left to GDAA. And the missing functionality is promised soon.
If you decide to dive into GDAA, there are 3 demos available on Github at the moment:
- quick start
- full-blown demo
- trivial example with wrapper class to create, retrieve files/folders
Both demo and trivial examples have the create functionality with a text written to a file. If you pull any of them and step through, you'll get the idea.

- 6,735
- 2
- 33
- 54