Adding Google Charts or Similar to Chrome Packaged App - google-chrome

I have a Chrome Packaged App that I want to be able to graph data for the user. I would ideally like to interface with something along the lines of the Charts/Visualization API, but I'm trying to find a solution that will work offline, possibly through integration with other apps or within my app specifically. Is there a way to insert a Google Chart or something very similar into my packaged app? Is there an API or feature I am unaware of that would make this feasible?

Unfortunately the Google Charts library cannot be downloaded for inclusion in a packaged app due to their terms and conditions:
Sorry; our terms of service do not allow you to download and save or host the google.load or google.visualization code.
- Google Charts FAQ
That said, there are many excellent Javascript libraries that are available for download which you could include with your packaged app and use as if they were included from a remote source.
This stack overflow question should help you decide between the various options. You should then download the Javascript files for the library you chose and place them within the folder of your packaged app and then use them like any local Javascript that you've written.

Related

Can i use Google app script for developing google chrome extension

Can we publish google app-script code in to a chrome extension tool. So far we developed a web app from app-script, which is working as a web application. What need to be done to convert it in to a chrome extension from google app-script Editor. Appreciations are shared for valuable suggestions.
I've developed both GAS Web Apps and Chrome Extensions and I can say with certainty that you cannot use Google Apps Script's GUI editor to develop a Chrome extension. They are two very different beasts.
For one, Google Apps Script, uses its own flavor of server-side javascript. Plus it leverages libraries and services unique to its platform.
A Chrome extension uses client-side javascript and it too has its own libraries and services.
Moreover, they handle user authentication a bit differently (even though they are leveraging the same OAuth2 flows under the hood).
But you might be able to integrate the two. You should be able to make POST requests to a Web App from a Chrome Extension, so that's one approach.
However GAS scripts are limited by quota restrictions so you might be better off rebuilding your app from the ground up as a self-contained Chrome Extension (the better option in my opinion).

Is there a way to "bundle" the graphics with the Web App?

I'm developing a JavaScript application using the Google UI Service that I want to eventually deploy as a Google Web App.
I'd like to include several graphics in the user interface, but I'm finding the documentation for this on the Google developer pages quite thin.
Is there a way to "bundle" the graphics used in the app with the Web App?
Or do they need to be publicly available on a web page and referenced in the Web App by URL?
You cannot bundle them. You have to have them available publicly on the Internet and you can only create an Image object with the URL.

App built using Google Drive PHP SDK keeps redirecting to the same page

I'm following this guide to create a sample web app which implements the Google Drive PHP SDK.
When I access the URL, the app keeps redirecting to the same page in an infinite loop, so no content is shown actually. Any idea why this is happening? Is it due to some mistake I made in the config file?
The document says how to implement the sample app - called DrEdit - as a Google Chrome application. Can anyone tell me if it is possible to use the SDK for creating non-Google Chrome apps? Also, does anyone have any example implementation of the Google Drive SDK?
If you provide more information and code, we can debug your first issue.
Otherwise:
Yes, you can write apps for Drive that are not Chrome apps. Chrome Web Store is an optional distribution mechanism for the API. Your apps will work in any browser.
There are documented PHP snippets for every API method, e.g. https://developers.google.com/drive/v1/reference/files/get

Google docs api file view and download

Has anyone had any luck with the downloading of files using the google docs api?
I've been struggling for weeks now to get this working with no success.
https://developers.google.com/google-apps/documents-list/#downloading_documents_and_files
I can get the list of files successfully and display within my web page. However what i want to do next is allow the user to click on a file link which will then open it up in a google docs viewer allowing them to then view and edit that file.
Please advice.
I'd recommend using the newer Google Drive API which is easier to use, supports multiple programming languages and has documentation for each method, including downloading files:
https://developers.google.com/drive/manage-downloads

Incorporate Google Drive solution in existing Android app project?

I have an existing Android app project which has been already published on the Google Play, and now I would like to incorporate in my app the possibility to use the Google Drive possibilities in order to download *.jpg files directly to the sd card when the app is opened or load for the first time. Like this I liberate the internal memories of the phones where this app is installed (All the images are stored in the resources of the app actually which is >~ 20MB). I have read a lot of forums concerning the Google Drive SDK or API subjects and I can say that I'm a little bit lost on the manner to manage it for my present app. Some ideas or suggestions would be very very very appreciated.
Thank you very much).
Please see this question for the basics on how to integrate your Android app with Google Drive SDK: Access to Google Drive from self implemented Android application
In it, I reference a good Google+ tutorial on how to get started, and it's easy enough to take the concepts and apply them to an existing app. (That's how I did it too.) Before you get started, sign up for the Google APIs (https://code.google.com/apis/console/), get into the API Console, and turn on both the Google Drive API and Drive SDK. This'll make coding go a lot smoother. Let me know if you have any problems.
One addendum for your specific case relating to *.jpg files is you could set a MIME type for fetching strictly the pictures. It'd go something like this:
request = service.files().list(); // .setQ("mimeType=\"text/plain\"");
Unfortunately setQ is commented out because it would fail to return any results when I used it. However, you may have better luck with the image/jpeg MIME type.