Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
97 views
in Technique[技术] by (71.8m points)

android - Sending Sensor Data to a Mobile App For Others to See

hope you are all doing well.

I am trying to create a mini project with 3 of my friends. Our aim is to get real time data from several sensors, such as body temperature and location, and displaying them to other people via a mobile application. Two of my friends are little bit experienced in mobile app development and I know how to work with the necessary sensors. We just do not know what would be the best and easiest way to having the app show the real time data. I thought about sending the instant sensor values to Google Cloud and then transmitting the data to the application. I do not know if this is a feasible way, or sensible if it would get the job done.

What are your ideas? I am aware that this might be a very broad question, and apologise for that. Looking forward to your assistance!

question from:https://stackoverflow.com/questions/65911861/sending-sensor-data-to-a-mobile-app-for-others-to-see

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This is likely to be shut down, as it's definitely too broad of a question.

Having said that, in broad terms...if you want to use Google Cloud to do this: Check out Google Cloud IoT Core for getting the sensor data into Google Cloud, which will put it into a Pub/Sub topic. Then from there you can ingest it into a Firebase/Firestore database (using something like a Cloud Function, or an App Engine polling application) which can then serve up the data in real time to your applications. Mobile apps can "subscribe" to data changes in the Firebase database, which allows them to easily read things in real time.

I basically did this for a talk I did at Google Next a few years ago, the code is in this repo:

https://github.com/GabeWeiss/GoogleIoTCoreApp

Device code is for a Raspberry Pi, but if you're comfy with sensors, that part is easy.

gcf are Google Cloud Functions that shuttled the sensor data from Pub/Sub into Firestore.

angular is the front-end web app that we wrote real quick (it's super basic) to display the results in real time.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...