Incorporate Google Drive solution in existing Android app project? - google-drive-api

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.

Related

Can google script be used to make the list broadcast

Can google script be used to make the list broadcast api for you tube and the stream and basically can you make the broadcast samples using scripts i have made the other samples but it is unclear if scripts can be used to the broadcast. Also it appears that depending on the manor of which i access the scripts app I get different options. For instance if i access the the scripts app using google drive I can share and other stuff that is not available if i access the google drive though api and the regular free account. I wonder if there is a better way to access to get all the services? I think before the scripts service would not work for the broadcast. however it appears it has been updated is that because i have a credit card on file now? i notice i have more options now than before in scripts.
I found the answer yes you can make broadcast api from you tube ver (3) on google scripts as long as you have a credit card on file. That's cool google deserves to get paid. With out your card key elements are missing in scripts and everyplace else. Makeing it difficult if not impossible for hacks like me to get the api back on the internet. But with a credit card on file wow two clicks and its done no coding nada just change out the public api credential. I just wish this would have been told to me months ago. and please everyone forget about java, go, java-script and everything else if you want a web-service or web app from youtube api. Use in this order Python .php google scripts. But i did learn how to become a expert developer its called master card. this is my experience only and i still think its a great thing but if your not a genius use your card you will feel like one.

Google Drive Android SDK: where to start from?

I have been looking all day at the Google Drive SDK for Android,
but I am a bit confused.
I need to make the list of folders and files in the user Google Drive account.
I thought that was a simple, basic standard feature, but maybe not...
Please can you help me?
You have two possible ways to go:
use RESTful API, or
use Google Drive Android Api (GDAA)
I would say the former would be easier to start with.
If you decide to go with the REST, you may use the GitHub demo here, that has both the REST and the GDAA 'CRUD' implementations (you just comment out the one you don't need). It also has some code to deal with the authentication / authorization which you need to do anything on Google Drive. See SO 28439129.
In case you decide to use GDAA, (you still have to get the authorization done), the 'official' to get you started demos are here and here.
You will definitely run into a lot of roadblocks and the solutions are mostly found here under the tag 'google-drive-android-api'.
Good Luck.

Adding Google Charts or Similar to Chrome Packaged App

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.

Questions webstore

I need some light on the matter of Chrome Webstore registration.
I'm still confused despite searching through the web: the "app" will be only private for the site (we're trying to develop a Elgg plugin for our website that will allow users to access their drives).
1) for testing, do I need to register it (I did a search but some say yes like in the Google Drive SDK documentation, some say no in the google-drive-sdk tags)?
2) when the plugin is finished, tested and ready to go live for our users, do I still need to register it and pay 5$?
Thanks you for the answer you can provide us.
You don't need to register your app on the Chrome Web Store if you don't want to integrate with the Google Drive web UI: having the option to create a new file or open a file with your app directly from Google Drive.
Also, it might be easier for you not to create a Chrome Web Store listing while developing.
If you do need to integrate with the Google Drive web UI, but don't want your app to be public, you can publish your app to Trusted Testers only.

I am facing "The authenticated user has not installed the app with client id" error even after installing the app [duplicate]

I'm working on a Google Drive interface for Emacs. The concept is that Emacs could provide a platform-agnostic way to load, modify and save text documents stored in Google Drive. I've registered my app and can authenticate with OAuth2 and get a file listing with the Docs List API, but when I try to execute an Insert with the Google Drive API, I see an error:
"The authenticated user has not installed the app with client id ..."
Reading further, it seems I need to publish my Emacs application in the Chrome Web Store to get access to the Drive API. That doesn't make sense to me...I noticed that there is a FUSE project in development for Google Drive, which suggests that native development is possible. When I skimmed the code, however, I didn't see a Chrome Web Store component to getting it working.
Am I trying to misuse the API, or is there an route to make this work that makes more sense?
EDIT:
According to Ali Afshar, of the Google Drive team, installation is no longer required to use this API. So what follows may no longer be relevant, but will be left for historical purposes.
So, first off the API does not support application development in the sense that we are both doing it, I wouldn't use the word native though. The good news is I have been doing some research and Google Drive is really just a rebranding of Google Docs. So the Google Docs API could be a good choice as well for the same purposes.
Anyway, here's the steps to solve the error: "The authenticated user has not installed the app with client id ..." Which is a 403 error, for the sake of this answer. These steps assume you have set up an app in the chrome web store as is required, and installed it. I am working on my local machine too, with my project: http://github.com/tom-dignan/gdrive-cli which I have gotten past this error, so I think you should keep plugging away at your emacs version, because I think we can make this work.
a. Open the Google APIs console.
b. Confirm you've already enabled the apis under "API Access" both the API and SDK for Google drive should be enabled. There you get your client secrets/api keys and such. I am almost positive you've done this already, so go ahead to C. (this is here for others who may have missed it)
c. In the left navigation bar, under "Drive SDK" you will need to do the following:
Add a "Support URL" (required)
Add at least a small 16x16 application icon (required)
Add "OAuth Client ID (Required)" under Drive Integration (I was just tinkering and this seems to be the key field.)
Add "Open URL (Required) URL to open for your app from the google drive UI."
Check off "Multiple File Support"
Add some MIME types and file extensions, "text/plain", and txt for example
Add the the auth scopes:
https://www.googleapis.com/auth/userinfo.email
https://www.googleapis.com/auth/userinfo.profile
Don't bother trying to add the auth scopes for Google Docs here, because it won't work. Google does not want us to use it that way because files that drive apps create should be private to that app. Integration with Google Docs will have to be separate.
Now I know you must be thinking "why do I have to add some of these..." It's because the form makes them required fields. In mine, I put a couple URLs that point to static HTML pages.
Once you've done the above, clean up your state and reinstall your chrome app. Then try your code again, and it should stop giving you a 403.