i'm currently making an app that can read and possibly edit document file via android. the files.list API is already work, so i can read drive content from any google account. the question is how to open all those file?
is there any API to read the file content, or should i download the file first and then open it with corresponding app in my phone? which way better actually?
Yes, you can use the API to download the file. See the examples for the files.get method.
Related
I want to use google drive app on android to scan some documents, create file and then get the link. I know there's a google api which I can use but then I would have to implement my own document scanner.
For the scanning of documents, try checking out Google Drive's own OCR feature, though it might be pretty limited. As for the creation of files, you can use Google Drive API's DriveResourceClient.createFile() method.
When you call DriveResourceClient.createFile(), the Drive for Android API places the new file in the folder that you passed in as an argument.
After creating the file, you can get the file's webViewLink property for the link. webViewLink is a link for opening the file in a relevant Google editor or viewer in a browser.
I'm developing an Android app that lets users upload files from their Google Drive using Google Drive Android API. Instead of having users download the file to the device and then upload it to my server, I would like to generate a download link which the user can post to the server and have it download the file directly from the Google Drive API.
Is this possible in any way? The only way I can think of is having the user authenticate in both the app and through a browser window, but that is quite a hassle for something that seems like a pretty common use case.
I would like to generate a download link..and have it download the file directly from the Google Drive API.
This is certainly doable and I've tried it. Try this tutorial on Creating Direct Links From Drive. Just take note of your file type- doc, ppt, img ,etc. and the corresponding FILE ID.
For Google Docs files:
https://docs.google.com/document/d/FILE_ID/export?format=doc
https://docs.google.com/document/d/FILE_ID/export?format=pdf
For Google Presentations files:
https://docs.google.com/presentation/d/FILE_ID/export/pptx
https://docs.google.com/presentation/d/FILE_ID/export/pdf
For Google Spreadsheets files:
https://docs.google.com/spreadsheets/d/FILE_ID/edit?usp=sharing
Here's an SS of a direct download I got using the pptx format.
How to get the direct download link of a file by google drive api v3 in java ?
Hi all,
I've worked with Google Drive Api in Android for a week, I used both Android Drive SDK and Drive Rest Api for java but I can't find the way how to how to get the direct download link of a file (anyone can read) on Drive.
I've try How to get the url of a file of google drive to download in android but it's not work.
Please help me.
Thanks.
Given that you have the actual FILE-ID for the file , you can download it using the download link
drive.google.com/uc?id=FILE-ID&export=download
If you want to have the direct download link of a file, DriveFile doesn't seem to be what you're looking for. What you can do is to use the Drive API web service instead. Note that you're still required to be authenticated for you to use the API.
Check out the Download Files section of the documentation, there are 3 ways for you to download the file.
Download a file — files.get with alt=media file resource
Download and export a Google Doc — files.export
Link a user to a file — webContentLink from the file resource
Another alternative is for you to use the webContentLink for you to download the file. However, this is only available for files with binary content in Drive.
I am working on Android application in which i have to download audio files from google drive and then save these files in sd-card.. Is there any api or sample project that helps me in downloading mp3 files from google drive
OR
Is there any other way to to download mp3 file from google drive programatically...
Can we use public downloadable url for achieving above mentioned purpose
Thanks
There are two a APIs that that allow you to do it. The GDAA and the REST. None of them deals with the mp3 files specifically, though. The APIs deal with a binary file content only. That means you:
Find the file first. Either you know the name, mime type,... or you know it's Id. If you use REST, the Id can be extracted from the file's URL.
Download the content as a binary stream.
Save the content as an mp3 file on Android.
If you insist on applying the URL based Id, it is easier to use the REST, since:
the URL directly corresponds with the REST Id (aka ResourceId in GDAA)
you can use the REST playground (bottom) to test things interactively
Also, you may use the demo code here to see the (dis)advantages of using one API or another. It deals with jpg content instead of mp3, but it has all the building blocks you need. Be sure you understand the relation of DriveId and ResourceId.
Good Luck
Go to Developers Google Website click here
you will get information how to download file.
Hi I am new to use Google App Engine.My requirement is store Large Zip file in a Blob Store and retrieve to my android application when user click a download option It is possible?Can some one Give Tutorial link to how can effectively use android app engine blob store in android application.
Thank's in advance.
The short answer is: yes you can.
First of all you will have to complete the example on how to upload stuff using Google App Engine and then experimenting with the Google Cloud Storage because it will be much cheaper in the long run.
After completing that you will realise that in order to upload, all you'll have to do is to POST multipart data either from Android or using any other method you would like. In that tutorial is also very obvious on how you could download any file back to your Android application.
You could also experiment with one of my examples for uploading files either on Blobstore or on Cloud Storage. In that particular example you are allowed to upload only images and PDF documents, but it's very easy to modify and accepting only ZIP files or whatever else you might want.
Perhaps Google Cloud Storage would be more appropriate.
https://developers.google.com/appengine/docs/python/googlestorage/