Background
I have a sensor "A" which connects to my mobile app over Bluetooth. This sensor generates 512 data points per seconds.
What I need
I need to send send this data to Google BigTable via Cloud pub/sub. I have already created a topic and I can push message to the topic.
What is the problem
This answer says that I need to create an app engine and connect my app to that app engine. The app engine will receive the data and send it to Bigtable via pub/sub and dataflow.I get this, but now I have two sub problem here -
a. How can stream the data from my mobile app to app engine? Websocket? Because I think I can't do simple post request to post the data to a route (/publishdata), Am I correct?
b. I am authenticating my user on mobile app via firebasea authentication. Can I validate my user on app engine via firebase-admin sdk? I can do that by passing the tokenId but is it the correct method? or can I use firebase to authenticate my users on app engine?
I have seen projects where people are suggesting to create a service account and add it into the app. The problem is I don't want to expose my credentials to client. Another talk
Can anyone suggest me tackle this problem?
Thoughts that I have
I can send data to firebase realtime database and then thinking of moving that data to Bigtable via pubsub or cloud function. I couldn't find any example of an app engine connecting to a firebase and reading data from realtime database. I thought in this example this guys sending data to Realtime database and then using pubsub to move data into Bigtable. If this is possible then can I authenticate my user on the app engine via firebase-admin sdk?
Firstly, you should take a look for this Build an Android App Using Firebase and the App Engine Flexible Environment article, which demonstrates how to write a mobile app with backend data storage, real-time synchronization, and user-event logging using Firebase.
Regarding to your first question about sending data to App Engine, you can send it as an HTTP POST. Please, take a look to following questions on Stackoverflow: 1, 2.
With reference to create a service account and add it into the app, it's not secure option. In this case, you can use Callable Cloud Functions. Refer to this Stackoverflow thread.
You can get data out of the Firebase Realtime Database via backup service which allows for exporting data to GCS Bucket. Then, you can move it to Bigtable, by using open-source Dataflow templates, for instance Cloud Storage Avro to Bigtable. Please, refer to official documentation, to find more about exporting data to Bigtable.
I hope it helps.
Related
Can I send data from firebase to my website? I am interested in storing data of android app to the firebase, then retrieve the data in my website. Is this possible to do?
Yes, you can connect an Web app and an Android app to the same Firebase project and then share the same database, cloud storage, and other resources between them.
You can retrieve the data using javascript, then you'd need to create the logic to deal with that info.
The proccess is quite similar to Android: you get the app info from your firebase app and you can use very similar methods to retrieve the data.
This process is way to long to describe here but you can refer to https://firebase.google.com/docs/web/setup?hl=pt-br to get started.
Currently, I have an App that sends data to web server.
But, if website sends data to the server, my App does not receive any data from the server.
I want to create an app like Evernote where I don't have to refresh the app to receive data from the server.
So when I sends data from mobile, it has to sync with all other devices.
How do I implement it?? Which method is best for android?
Is GCM the only way to do it?
We need more information regarding what you have tried implementing for us to provide a better solution since your issue is about code implementation.
You may check Firebase Realtime Database as this seems perfect for your situation because with Firebase, "data are synced across all clients in realtime, and remains available when your app goes offline". Since you are using Android, you can check this document: Set up Firebase Realtime Database for Android.
I am trying to develop an Android app using Bluemix as server. Please show me the sample code with simple use case of signup from android client to store the data in the cloudant database. I am comfortable with client side that is android. I want am not able to start in server side. please help
I'm assuming your application stores data that other users shouldn't be able to access, so you should be looking at the one DB per user model. The web service running in bluemix with admin level access the Cloudant (You should use API keys). The web service would handle the creation of the user's database and passing the credentials to the user, there is an example of a web service to do this here.
Link to documentation of Cloudant NoSQL DB service on Bluemix is at https://console.ng.bluemix.net/docs/services/Cloudant/index.html#web-console, sign-in with Bluemix id. When you click on one of the methods to access this service, last one is Bluemix applications it will point you to get started.
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.
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.