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.
Related
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.
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/
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.
I searched through a lot of questions on SO but I can't find the answer, that's why I ask the following question:
An Android app should be able to play an encrypted video file (stored on the SD card and retrieved from a webserver).
The file has to be stored on the SD card so that the app can play the video file without having an active internet connection.
Because the video files may not be copied, the plan is to encrypt them server side when uploading the files to a webserver.
What is the best option?
1) I have seen suggestions for running a local webserver which decrypts the file (and how to do this?)
2) or should we decrypt the file, save it as a temporary file and set this temporary file as the source for the videoplayer?
3) something completely different?
You are trying to implement a DRM scheme, and a naive one at that. Look into DRM schemes and report back if you cannot implement the impossible. All you can hope for is obfuscation, and there are plenty of ways of doing that (none of them are secure of course).
What you need is DRM. Digital Rights Management (DRM) controls the access to your digital content such as video. Firstly, you need to encrypt the video with an encryption video like AES-128. Then with the use of DRM play in exoplayer. Exoplayer has DRM support. you can check here. https://exoplayer.dev/drm.html
You will expose the user to a waiting time if you choose to decrypt a entire big video beforehand. As of the security, you can guess it's a poor idea to have the contents in clear in a file, even temporary. The local webserver is a better choice because it's a streaming method, so without file storage. There is no class for an http server in the SDK, you have to implement your own one, otherwise look for an existing library similar to LocalSingleHttpServer.