Google Cloud Storage in an android app - android

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.

Related

Backend setup for images and videos to download and use inside android app

I want to store some images and gifs on cloud and download to use it inside app by every user via links. I tried with firebase, it gives only 1 gb per day download limit but I want to download 50-200 gb per day because of 2-3 k users and 50-60 mb for each, which it cost 10-20 $ per day. then I tried google drive but I found that can't use it for such big bandwidth and also its links are not encrypted, if anyone get that link from app and paste it on browser then he can access that file, but firebase links don't open that it only opens asset from inside app.
So can anyone guide me, what is the best and cheapest way to achieve it considering growth in future.
Thanks in advance
You can try this solution:
Using a cloud computing solution (Azure, AWS etc) or buy a hosting place. Write a small backend code for access to the links. I usually create a REST API using Slim Framework and for every call, maybe you can use an API key so that only a device with an API (your app) key can access the link.
Slim Framework: http://www.slimframework.com/
Azure: https://portal.azure.com/
[Update]
If you get hosting, you can do the following:
Set up Slim Framework on your server to create REST API. Follow the link above for documentation. Create a Database in your CPanel of your hosting and use this DB in the API to manage your data.

Google Drive API access files from Server

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.

How to upload an image to Google Cloud Storage in Android App

I am attempting to use Google Cloud Storage to store images for an Android Application I'm building. I'm a beginner with cloud stuff but I've already set up an endpoint to store structured data in the google cloud datastore and I'm using app engines standard environment.
I've read conflicting things about how to go about this but I'm currently using this guide: https://cloud.google.com/storage/docs/object-basics#storage-upload-object-java and trying to do it in the endpoint I've already set up. I did try to use the library directly in the app however trying to run with the dependency for it caused the app to crash on startup.
The guide I'm using doesn't talk at all about setup like how to get a bucket object of a given name (I've found how to create one but I want to use my apps default bucket which already exists).
Questions:
1) Is doing it in the endpoint the best approach? I want the simplest possible solution so I don't really want to use an extra thing like firebase if I can avoid it
2) For whatever solution is the best, can you give/link me a comprehensive explanation of how to hook it up starting from the Uri I get from the FilePicker all the way to uploading it to GCS? I've found so many explanations which explain part of the process but they don't fit together.
https://github.com/TdevM/FirebaseStorageTest/blob/master/app/src/main/java/tdevm/storagetest/ui/GalleryActivity.java
Here's my test project which i created to upload images on Firebase Storage. Firebase Storage is based on Google Cloud Storage.Comment back if it helped !
If google drive app is installed on the device where your app runs you can simply use intent `ACTION_CREATE_DOCUMENT to create a file in the cloud.

Use Google Cloud Storage with GCS Library on Android

I am trying to figure out how I can use Google Cloud Storage in my Android Application via the Google Cloud Storage Library.
So far I already use the appengine datastore to save some user data. However, to store images I want to use the Google Cloud Storage but I wasn't able to get it to work yet.
The official google "Getting started" does not really help and I can't find any other proper tutorial that tells me how this is done.
Can somebody please explain the basic steps that are needed or recommend a tutorial that works for using on android?
Thank you very much in advance!

Google Cloud Messaging for synchronizing folder

I'm trying to develop an App whose purpose is to share files in my smartphone with some friends, kind of Dropbox. I have a FileObserver watching a directory and when any change is applyed to one of its files, the App should read and do some stuff with it, write the result in another different folder and upload it to a server in order for my friends to get them when they sync in their smartphones using, obviously, the same App.
I've been taking a look at Dropbox API but I think it's not possible to programme something like that, I don't know with Google Drive.
The thing is, I've come across Google Cloud Messaging and wondering if this could be the solution I'm looking for.
So I'd like to know if this is possible with GCM and how it could be done. If you know another way to do so it'll be welcome.
Thanks in advance.

Categories

Resources