Storing data from Android app in Google - android

I am writing an android app which provides scores to users based on Questions and answers. I am planning to bundle the app with the questions. I want to store the user's score on some web server. For this I need to implement some kind of an authentication mechanism as well as I need some web based datastorage. Realized that Google App engine can be used for this purpose.
However, I found only one framework for this Google Cloud Messaging (GCM). Looks like this framework has far more use cases than what i originally require. i.e, it also allows to send messaging from cloud to the device. However i am not sure if we can use this to send data from Android to Google Cloud and store it in Google App Engine.
Just wanted to check if there is any framework which only exactly what i wanted, ie., to store and retrieve the data rather than acting as a messaging service.

Google Cloud Messaging (GCM) is use to send message to all of your app user. Google Cloud Messaging (GCM) is for push notification service.
To store your game scores, better use web service, Like php or ,net or other web service.
Thanks.

You can run a simple Java Servlet on the Google App Engine and send HTTP requests from the Android device with the score data.
On the Android device, you will need to aonfigure Internet access rights and a HTTP client library.

Looks like I can use Google Cloud Storage which serves my purpose. Haven't explored it yet, but will definitely try it.

Related

Google Cloud. Pub/Sub Android App

I'm try to send data throught pub/sub library to my topic in GoogleCloud
projects/navigator-cloud/topics/navigator-location
Here is a project of a google map with a overlay image of a building, which I should use. I want to publish a JSON with some info like this: {"Username": "oscarhmg", "Location": "labproto", "Timestamp": "2016-12-04T15:29:05Z" }.
When the topic receive this info, in the building map appears a marker(This map shows in my application in a web view). This functionality is already implemented, what I still do not understand at all is how to pass the message to publish on this topic through my android application. Any help would appreciate it
Check out this Android Things tutorial that has the device directly publishing messages to Google Cloud Pub/Sub without going through a web server. The way to do the authentication is by building the .json credential into the Android app.
https://github.com/androidthings/weatherstation
As #gunit points out there is a way to connect an android app demonstrated by androidthings. I have not used this method myself.
You will have to manually create a google cloud api token from the console and pass it in while using the API.
When connecting a mobile client directly to PubSub but you may need to setup the topic permissions to enable access.
Alternatively, you can make a web service that your android app connects to (via HTTP POST) to publish a message. That web service will then put the message it receives into the PubSub topic.
If you use use appengine to build the webservice solution then it will automatically be authenticated to work with pubsub (I can confirm the python api does this at least).

Google Cloud Platform for Mobile App Confusion

I am new to android. I am confused about google cloud platform.My focus is on using android app for RESTful service.
Why do I need google cloud platform when I can use native android library to access RESTful web service like this.( I mean using JSON parsing with HTTPClient/Volley etc)
As far as I have understood that to implement google cloud service, I need an android client, a backend and others....( I m not sure). Why do I need this EXTRA stuff/coding when, as I said before, I can get RESTFul response with conventional way with sdk library.The implementation of Mobile Solutions on Google Cloud Platform is difficult and strenuous task.
What are the cases, when I HAVE to use google cloud platform, cant I do it other easy way?
As per zapl's comment, there really is no reason why you need to use Google Cloud Platform with Android. Nowhere in any of Google's docs does it mention that GCP is a requirement for an Android app. Cloud Platform is a service Google offers if you want to develop your own web applications or backends for mobile applications, but you are by no means locked into using this service.

Uploading an SQLite database to Google App engine?

In my application I am saving user's data within an SQlite database on their device. I want to add the functionality that whenever WIFI is available the contents of the Database can be uploaded on to Google App engine's Data Store.
I want to know if this is possible? And if so, how difficult is it to implement?
Of course it's possible to do that, even more, it's an easy stuff. All you have to do is to create a web application with google app engine, than your android application sends its data to GAE. You can do that using HttpURLConnection to send your data and java servlets to intercept your requests and save your data in datastore. You can also use web services.
On GAE side, you need to create backend API using Cloud Endpoints and generate client library for Android devices. Your backend will be responsible to receive the data and save it in datastore. Another alternative will be to use Cloud Datastore API Client Library to interact with datastore directly, but endpoints is a much better option.

How to store data in cloud and How to access data from cloud by using HTTP api?

Sorry for my English(I am not good in english please excuse).
I am working as a android application developer.I try to developing one application with backend support that means i want to use (web services) inside of the application.For that one i am trying to use google cloud for storing my data and access that data in json formt.It is possible to use that cloud data inside of my application.
For storing data in cloud they charge me something?
Please any one help me experts....
Thanks in advance...
At the onset, what you are trying to do is possible within App Engine. To summarise, you want to access some of your data that is stored using one or more of the available choices in the Google Cloud Platform and expose that over a Web Service running in your App Engine app.
When it comes to exposing your existing functionality over REST+JSON, Google Cloud Endpoints is a great way to get started, though nothing prevents you from rolling out your own.
For storage, there are several options and while you need to be mindful of the quotas/pricing, a great deal depends on which mechanism you want to employ as far as your storage API is concerned
Google Datastore API and Blobstore : The Google Datastore API is a non-relational database. The Blobstore is for storing large amounts of data (think images/videos). You have a free quota of 1GB for Datastore and 5GB for Blobstore within your App Engine application quota.
Cloud SQL : If you want to use a relational database , you can use Google Cloud SQL too. The pricing is mentioned on the page.
Google Cloud Storage : This is another storage option available with a Java client API. The pricing is mentioned on the page.
Google Drive : If your application is more of a personal nature and you wish to store some data within a Google Drive account of the user, you could look at that too.
Keep in mind that all these options are available as part of the Google Cloud Platform.
Hope this helps.

Google Cloud Datastore access from Android

I'm trying to use Google Cloud datastore as remote data collector of a bunch of sensors, connected via an android Smartphone.
Firstly I'm trying to make it working in standard java.
The question is if it is possible to access Datastore directly from an android App of I need to build a GAE app that interact with the datastore.
I read for a while the documentation about the google api, but it is not really clear, how to use the Oauth 2.0 protocol.
Thank You all
You can use the oath2 support built into android as long as every user of the app is an admin of your google cloud project/app engine app. If you want to allow untrusted users to upload data, you would have to use your own endpoint and authentication strategy.

Categories

Resources