Is there a way for ThingSpeak using REST to send polling/notification data to Android Studio?

조회 수: 2 (최근 30일)
I'm currently making an app in Android Studio (Java) that takes the JSON returned from api.thingspeak.com and presents it to the user. However, this system is connected to an Arduino sensor that sends data to the cloud, and I only need to take the latest one. I'm thinking of running the retrieval and parsing code through a loop, but that's computationally expensive and I want ot avoid that to the extent that I can. My main question is that, is there a way for me to set up my system in such a way that Thingspeak can send some sort of signal to Android Studio that it has received new data, and so I only need to run the Android Studio network connection code everytime something comes in?

답변 (1개)

Sutanu Maiti
Sutanu Maiti 2022년 7월 28일
REST calls are always polling based. You want server to push data to client. For that purpose, you must use MQTT.
REST is a representational state transfer architectural style designed as a request/response model that communicates over HTTP. MQTT is a publish/subscribe model that runs over TCP/IP sockets or WebSockets.
For more details please have a look at below:

카테고리

Help CenterFile Exchange에서 MATLAB Mobile에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by