You can create a new folder by inserting a file with this MIME type and a folder title. " In the Drive API, a folder is essentially a file - one identified by the special folder MIME type application/. Sure, just modify the example to your needs: before uploading your file, set the correct Content-Type, see alsoĪlso in procedure updateTitle set the new filename accordingly.
Q2: Can I change the file upload and download format of jpg to doc or pdf? You can copy the relevant blocks from Screen1 of the example project. Q1: Can I use the example also in a "one screen only" app?Ī: Yes, just make sure to refresh the access token using the refresh token before uploading the file to Google Drive. Into your Google Drive and store a public link to the image in a fusiontable. In case you are interested, I also can offer a Google Drive - Fusiontable example: Take a picture or pick an image, upload it into a public folder
Tested successfully on HTC Desire running Android 2.2, Samsung Galaxy Tab 10.1N running Android 3.2 and Nexus 5 running Android 4.2.2. I did not take a look into modifyingīut this should also be possible from within App Inventor. The Google Drive API offers lots of possibilities. In the authorization process, I'm currently using the following scope. Then use these blocks for the further basic steps of the OAuth process. In "APIs", just enable the Drive API and Drive SDK instead.
To be able to use OAuth to access Google APIs. (similar to the App Inventor - Fusiontable interface.)įor your own app, first register your application as described here, Your Google account is required on first start of the app My Google Drive will be used as some kind of public file storage for everybody who uses this example.Īlso the user can get a file list of the 10 last uploaded images and download one of them.Īlternatively of course you can use this example to access your own Google Drive instead of mine. In this example the user can pick an image with the image picker and upload it to my Google Drive without need to login. Someone will have to write a Google Drive extension. Which means, this solution to receive an access token via webview unfortunately does not work anymore starting from April 20, 2017.Ĭurrently there is no workaround available.
Note: Google was modernizing OAuth interactions in Native Apps for Better Usability and Security,