简体   繁体   中英

How to Sync Data from a Smartwatch to a Smartphone without Sharing Data with the Google Cloud?

Dear Android community,

I am currently working on an Android application where I would like to share some sensor data from a Smartwatch in real-time with a Smartphone. There are a couple of such projects available on Github. These projects are solely using the DataClient to sync data. My investigation of the Android developer documentation resulted in some confusion regarding when Android shares data with the Google cloud. As I understand the documentation , data seems to be synced by Android with a so-called Cloud Node. Since the information is sensitive to my users, I would like to not share any data with the Google cloud. Therefore I would be happy if someone would support me by answering some of the following questions:

  • Is there a way to use the convenient sync method of the DataClient without enabling the Cloud Node?
  • Is data shared with Google when I use the ChannelClient or the MessageClient instead?

Thank you in advanced, Egregos

Excellent question.

The short answer is no : you can't be certain that any data you transfer via the Wear APIs isn't going to the Google cloud. The communication is handled by Google Play Services (aka GMS), which is opaque. We have no way of knowing that any data sent via GMS only goes to the phone, not to the cloud.

The longer answer is maybe . The DataClient API stores a copy of your data in GMS, and (as you say) syncs it with the "Cloud Node", so that's probably not the right direction to go. But there's no evidence that the MessageClient API keeps messages after they're delivered. So: using the NodeClient API, you can establish that the phone's Node.isNearby() is true; my experience is that this equates to a Bluetooth connection between phone and watch. You could then send your data via the MessageClient API, and it probably will be delivered via Bluetooth to the phone, without remaining in GMS long enough to hit the Google cloud.

If you need a stronger assurance than that, then you probably can't use the Wear APIs as is for your data transfer. A couple of other options that occur to me:

  • Roll your own data transfer, probably based on the raw Bluetooth APIs. This is certainly possible (I've done it), but is a significant amount of work.
  • Encrypt the data before passing it to GMS, then decrypt it in your phone app. This seems easier than building your own comms layer, but encryption isn't really in my wheelhouse, so I can't advise much more on this.

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