I've spent hours trying to work out how to use SDK. It seems so long winded and has about 20 dependencies but absolutely no examples of usage.
Does anyone know where I could find some examples to learn from. Dropbox was just a case of downloading the SDK and using it. Google drive only seems to have javadoc which is only helpful as a reference if you already know what you are doing.
I'm trying to do what I consider to be the most simple operations. upload, download, delete, create.
I had the same problems originally, finding a SDK that actually worked for Google Docs.
In the end I ended up implementing it on my own using raw HTTP requests, as also suggested in the other answer linked to by Alain. My implementation only handle file transfers and file management, but it is quite straightforward to implement, and works perfectly for Google Drive files also. I basically just implemented what I needed from the Google Documents List API version 3.0 found here: https://developers.google.com/google-apps/documents-list/
It took a little time, but was well worth it, and much more lightweight since I didn't have to include on all the dependencies of the various Google API's.
Google has now a tutorial called Quickstart: Run a Drive App on Android.
The Drive API are at https://developers.google.com/drive/v2/reference/
If your goal is to let users open files directly from the Drive app for Android using your app, see Integrate with the Android Drive App.
Related
Background
I was recently tasked to work on an SDK that Android developers could use via simple dependency (got this working for Jitpack&Github, here).
One of the tasks I was given is to use Firebase for remote-config and Analytics (and maybe Crashlytics too), to be able to gather statistics and have some control of it using the cloud.
The problem
All tutorials, articles and documentations (example here) that I see of Firebase are for Android apps, and so the preparation itself requires a package-name of the app to be set.
This is impossible for an Android library that is supposed to be used as an SDK, as it's meant for many apps, each has its own package name.
What I've tried
I tried to ask Firebase support about this, but they told me they can only talk about Android apps, and gave me a Github link (here), probably hoping I could get something out of it.
I also tried to ask on reddit (here), but nobody knew the answer to this.
Looking at the list of available, official SDKs (here), I think such a thing might be possible if I register as if it's a website (or web-application), and then in code I would reach it as a website (using REST API on Retrofit), but not sure if there is a better way, whether it will work, and whether it's even according to the rules of using Firebase (I think should be ok).
There might be a way to use the C++ library that Firebase offers, too, but this would probably require a lot of adjustments.
Seeing that this might not be offered natively, I even made a request about it., here.
The questions
Is it possible to use Firebase inside Android libraries? As an SDK? Is it according to the rules of Firebase?
How do I do it? Is there perhaps a library for this? Maybe a general Java library ? I guess I should also be able to make it focus on my SDK's classes and functions, and ignore what's on the app itself.
If there is no library, where can I find the various functions that are available for the various services, so that I would implement them?
I want to build an Android Application in which the user gives permission to my server-side script to read their files.
Seems pretty straight-forward, I've made an app where the application can access the user's files.
However, giving access to the server is a lot harder, thanks to OAuth2.0 which has me confused as hell.
Is it even possible to build what I want, and if so, how can I achieve this? Links to tutorials are also accepted.
This is the library I used at a previous job and it saved me a lot of the hassle in dealing with the Google API directly. Just be sure to follow the authentication part carefully as you need the .ovpn file in order to access your drive.
I am trying to understand BlobCache.UserAccount option using akavache. So far I could successfully implemented BlobCache.LocalMachine which works only offline.
Accoridng to akavache documentation;
Xamarin.iOS will may remove data, stored in BlobCache.LocalMachine, to free up disk space (only if your app is not running). The locations BlobCache.UserAccount and BlobCache.Secure will be backed up to iCloud and iTunes.
Windows 10 (UWP) will replicate BlobCache.UserAccount and BlobCache.Secure to the cloud and synchronize it to all user devices on which the app is installed
I guess this is something done automatically by the OS when you place the data into the certain folders, it is being backed up and this is what akavache is doing. Is that correct?
If yes, Is there a way to have something similar with Android. Nothing is described for Android. Is there some backup happening on google drive or we can implement easily?
I think this is iOS specific indeed. I tried to look it up into the code, but couldn't find something specific for the UserAccount. So, I think your assumption is correct. It might be for a different reason though, but I honestly think its iOS specific.
It looks like with android it doesn't store into google drive
https://github.com/akavache/Akavache/blob/master/src/Akavache/Android/AndroidFilesystemProvider.cs#L40
I haven't done that much with saving files into google drive but it doesn't seem quite as straight forward as it is on Windows or iOS. On Windows just save into a Roaming Folder and run with it. Where as with Android it seems less plug and play
https://developers.google.com/drive/android/get-started
Creating a new Android application that uses the Google Drive
Android API requires several steps.
I think in theory you could register your own IFileSystemHandler into Splat if you want to wire that connection up.
So I am having some confusion implementing the YouTube Data Api v3. I tried looking up tutorials and copy pasting the sample code to learn from it (after setting everything up of course) but I run into an error where:
import com.google.api.services.samples.youtube.cmdline.Auth; doesnt exist and hence the whole sample doesn't work. I haven't found a fix online. I hate just copying code and putting on Android and making it run without understanding what it does. I couldn't find a solution to this problem!
What was my solution?
I scraped (using Java) links such as:
https://www.googleapis.com/youtube/v3/channels?part=id%2Csnippet%2Cstatistics%2CcontentDetails%2CtopicDetails&forUsername=&key=
where all I have to do is input my browser key and the youtuber's username in order to retrieve the data that I needed. I am wondering if this is legal to do? These are their JSON sites that the API itself uses. The reason I am worried is because I recently got into scraping and read a lot about it's legal issues.
Thank you!
PS: I am using my browser key, and if I plan to release an app which utilizes this method is it a problem since the key will be used by multiple people?
First, You have to open SDK Manager. Install Google Play Services if you haven't.
Then, You open the build.gradle and add the library to it. (Replace ? with the correct version)
compile 'com.google.android.gms:play-services:?.?.?'
After syncing your gradle, then you should be able to import the library.
Edit:
If you find https://www.googleapis.com/youtube/v3 is useful, then you can use it because it belongs to the official API.
I'm trying to put a text document with highscores inside a bucket on the google cloud storage. So far, so good.
Now I want my app to open this textfile in the bucket, check if there is a new highscore, adapt the file and write it back into the bucket.
I´m trying to find example code, since that makes more sense to me for understanding than the apis, but I´m not able to find it.
The answers I get are all, it´s just simple get and put callbacks, but since it ain't simple for me, I was hoping somebody has a link to an example for an android app using google cloud storage and reading and writing online.
I found this information, but would love to see an example for android in eclipse: http://code.google.com/intl/nl-NL/appengine/docs/python/googlestorage/functions.html
If I'm creating an app in Eclipse, can I use the bucket in the google cloud? Or don't I or future users have access to that bucket for read and write?
Look at the Google api client libraries for java. Google storage has a Json Api (currently in beta and you must email to get turned on). The client libs are fairly straight forward once you get your head around it. All google apis are accessed in the same manner. You can use the Android Tasks example to learn from and apply it to Google Storage Api.
http://code.google.com/p/google-api-java-client/wiki/APIs#Tasks_API
Since you want to change files, I would advise to use Google Appengine's Blobstore or either save images as BlobProperty in GAE. CloudStorage is more for static files, I believe.