简体   繁体   中英

How can I get weather information to be shown on the android watchface?

I am making an Android WatchFace and would like to know how I can get weather information from the phone to the watch which I can then display on the WatchFace.

I would like to know if there are any specific APIs for the same.

Excuse me if this is a dumb question, I am new to this!

Thanks, Shashwat

You need to obtain the weather information, using any means available to you, on the phone side and then send that data to the watch (if you want to target a specific watch) or, using DataApis, sync that data across the whole network of nodes. Then on the watch side, you need to have a component (can be part of your watch face) that can listen to changes in the data and capture the data that was received and show that in the watch face. In other words, you cannot get the weather data directly on the watch, you need to use the phone component as a proxy or so. Each of these steps can be found in the official docs (for example for data exchange see here ) or among our official samples on GitHub.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM