Do I need Drive API, or Spreadsheet API, or both? - gwt

Currently, I am developing a web-app in GoogleWebToolkit (ie. java back-end) that should:
Copy an existing google drive spreadsheet document on the same drive
Modify this copied version based on some business logic.
I looked into the Google Spreadsheet API, but had hard time dealing with the oAuth logic. Then I looked at the google Drive API, and found the Dr.Edit example project.
This last project looks good, and I can create and edit text files, but is it now also possible to use some sort of API that reads out SpreadSheet documents instead?
Bottom line is: should i combine Spreadsheet API and Drive API here. What is recommended? I am confused.

You can manage files (create/edit/delete/view) with Google Drive SDK but need Spreadsheets API to modify the worksheets, rows and cells individually.
Once you acquire an access token, you can use it to access Spreadsheets endpoints too. Make sure that you're authorizing for the following scope as well:
https://spreadsheets.google.com/feeds

Related

How to download a csv file from Google Drive to show the content in a mobile app

I am totally new in mobile app development and consequently very confused about how to get going (independent from how much I have read Google Drive API documentation over and over again.)
The way I would like to implement my (initially "android") mobile app (which I will develop by using ionic):
I will have a Google Drive account where I will have 1 CSV file. I will periodically renew the content of the file in the background (possibly twice a week).
The mobile app that I will develop will just retrieve the file from Google Drive, process the content and show it to the user in a more readable (easy to understand) format.
My app will not upload any data/file from the user device to the Google Drive. The app will only retrieve a file from Google Drive to show the content to the user.
Question 1) Does this approach make sense? I ideally would like to eliminate the work for back-end development. Or would you suggest another approach to do the same thing (with or without Google Drive)?
Question 2) The authorization process looks quite confusing to me as it is explained in Google's documentation. I could not find relevant information only addressing the scenario I have in my use case. Requirements: The mobile apps can fetch the corresponding file (or the content of it) and process it to show to the end user, but mobile apps (or any other client) may not update/edit/delete the file, cannot add a new file either. The only purpose of using the Google Drive will be to enable the mobile app fetching the data that will be shown to the user. How can this problem be solved by using Google's OAuth framework? A step by step action plan would really be appreciated.
ADDENDUM
You are also welcome to share your view if I should instead consider using Firebase for my problem, which I guess will be more costly.
Based on discussing the requirements with you, I would recommend against trying to do this with Google Drive API.
There are no tutorials out there for Ionic 4 + Google Drive API, and only a few for older versions. It will be an uphill struggle to create a solution that isn't going to scale well.
Instead you should start looking into using Firebase.
There are lots of tutorials which show you the basics: setting up a login system, and reading some data from the database.
The free limits are quite generous.
You can implement caching into your app so that you store a copy of the data on the device, and only refresh it either weekly, or more advanced, put a second table in that records the last updated date for the main table.
Firebase charges by reads so if you can set it up so that you only read one record (last updated) instead of downloading the whole database every time, then you can stretch your free tier a lot further.
If you do outgrow the free tier and the app is not generating enough to cover the costs then you have the option of investing time instead of money. There are guides in the docs about exporting the users and they provide tools so that the passwords can be put into another system without requiring the users to reset their passwords. The database can be similarly exported.

What is goolge drive API?

Can anyone give me an overview about google drive API, please?
What are its abilities?
What are its drawbacks?
How is access obtained?
I searched about it but,don't understand any things.
Using Google drive API like any API, you can send request to Authenticate, do some thing or get data.
In case of google drive you can upload, download, rename ,share files more and more.
to find all possibilities have a look on this link (look at the left pane):
https://developers.google.com/drive/api/v3/about-sdk
It helps you save, read and sync files stored in your Google Drive account directly from an app. For example: if you want to save a file from an application and don't want to store it on your mobile, you can store it in Google Drive. Likewise if you want to upload a file to an app or just see a file from Drive in you app.
Here are the steps to enable the Drive API for your project: https://developers.google.com/drive/api/v3/enable-sdk
Google Drive API is a REST API gives you a group of APIs along with client libraries, language-specific examples, and documentation to help you develop apps that integrate with Drive.
The core functionality of Drive apps is to download and upload files in Google Drive. Think of the drive api as simply a file store. The information you have avalaibe is only the information about the files themselves. Name, size, type ... drive api also contains the information about sharing files and who last accessed the file. The Drive api also has a limited ablity to conert files from one type to another. The google drive api does NOT give you the ability to edit the continence of the files. The google sheets api does however give you the ability to edit a google sheet but that is a different api.
Access
The information available on Google drive api is private user data. That means that in order to access that data you must have the permission of the user who owns it. Gaining this permission is most often done though Oauth2 where by the application in question request the users consent to access the data.
Libraries
If you are considering developing an application to use the Google Drive api I recommend that you look for a client library in your chosen language. The client libraries are designed to help you develop your application quickly. There is normally a lot of documentation found for the different libraries. You can find a number of quickstarts within the documentation.

Generate single download url for multiple files in Google Cloud Storage

I have my files residing in Google Cloud Storage bucket and I am using the java API to upload files there. In my application, for single file downloads, I am generating signed URLs but I want to provide a functionality where users can select multiple files and download them as a zip. Is there a way to achieve this with the current API?
This is not possible with the current API. You could do it yourself with a fairly simple AppEngine app though.

Packaged App: syncFileSystem / fileSystem API - For *large* files

I am looking to develop a Chrome Packaged App that will (at a very simple level) provide a dynamic form filling UI - but allow users to attach large attachments to the forms (could be upwards of 10 files of 10MB each). I would like to have the ability to save and share the form data and the attachment via Google Drive. The forms will be completed collaboratively by multiple team members who also need to all see the attachments. Imagine a form front-end/metadata that sits on top of a shared Google Drive folder...
I have read the documentation, and learnt that the syncFileSystem API is not intended for use for general and/or large files to be stored in Google Drive, but rather for small configuration data.
I then looked at the fileSytem API - hoping that I could include the Sandboxed folder for the app in the folders that the Google Drive Client App (so that the files get synced automatically) - but it doesn't look like the sandbox is meant to be accessed externally.
My current thinking is to recreate a windows explorer type UI in the packaged app (can use drag and drop) - then store the files in the sandbox using the fileSystem API. I can reuse the code from the Google Drive sample packaged app to implement cloud syncing. Good idea?
Two questions stem from this:
How persistent is the fileSystem API. The documentation mentions that the user can purge all stored files - is this done through 'clearing all browser history' ? In which case they could very easily accidentally wipe many hundreds of MB of useful information that I am storing in the packaged app.
I have read that you can use a 3rd party authentication services (which I want to do). If I use a non-Google account to authenticate my users, how would the Google Drive authentication work ? Would I be able to use a different Google account to perform the cloud storage (i.e. unrelated to the actual end user, who may or may not have a Google account already - which may already be signed in)
It seems like waiting for this https://code.google.com/p/chromium/issues/detail?id=148486 (getting read access to non-sandbox directories) would be the easiest way forward.
I don't think clearing browser history deletes temporary sandbox filesystem files, they're supposed to be sort of automatically garbage collected when space is required. It would make sense if that were another checkbox in the "Clear browsing data" section of chrome's options. Perhaps that would make the answer to your first question more clear :-)
The second point, I am not sure how to do this, but it looks like you have already figured out something? At least that's what this page https://groups.google.com/a/chromium.org/forum/#!topic/chromium-apps/hOYu75Cv0AE seems to indicate

Accessing Google Spreadsheets with C# using ADO.Net Data Providers?

I want use Google Spreadsheets as data storage, but transparently via ADO.Net Data Provider. There is in some place an implementation?
I don't think there's any ADO.Net provider for Google spreadsheets, but I'm not sure. However, Google have their own API called Google Spreadsheets API that can be used from .Net. You can find more information about this here.
It seems like it'll be a webservice you'll have to connect to it. But you can access it either as a list of rows or on a cell by cell basis and you can use queries to filter the data.
Edit: Here's a sample .Net project using it.
There is a commercial Google Sheets ADO.NET Provider by CData, but I have not yet found an open source or free one.