简体   繁体   English

如何知道手机发送的服装数据是否已收到

[英]How to know if data sent from the wear are received on the phone

I'm currently sending data from my wearable app with a "SendFileService". 我目前正在使用“ SendFileService”从可穿戴式应用程序发送数据。 In this service I use the DataApi https://developers.google.com/android/reference/com/google/android/gms/wearable/DataApi to send the data that are stored in a .csv file. 在这项服务中,我使用DataApi https://developers.google.com/android/reference/com/google/android/gms/wearable/DataApi发送存储在.csv文件中的数据。 On the other hand, I have on my mobile app a "ListenerService" that receives the data and write them back in a .csv file on the mobile phone. 另一方面,我在移动应用程序上有一个“ ListenerService”,用于接收数据并将其写回到手机上的.csv文件中。

Now my problem is that I would like to make sure that the data are received on the mobile phone before deleting the .csv file. 现在我的问题是,我想确保在删除.csv文件之前在手机上已接收到数据。 Do I need to implement a "SendService" and "ListenerService" on the other way to send a message from the mobile app to the wearable saying "ok data were received" ? 我是否需要以另一种方式实现“ SendService”和“ ListenerService”,以从移动应用程序向可穿戴设备发送一条消息,说“已收到确定的数据”? I don't feel like it's the best strategy to use here... 我觉得这不是在这里使用的最佳策略...

By the way, I'm already making sure that the phone and the wearable are connected, using the NodeApi. 顺便说一句,我已经使用NodeApi确保手机和可穿戴设备已连接。

Thanks for the help ! 谢谢您的帮助 !

For receive messages events, try using the onMessageReceived(MessageEvent messageEvent) method of WearableListenerService . 对于接收消息事件,请尝试使用WearableListenerServiceonMessageReceived(MessageEvent messageEvent)方法。 This is actually used to receive events from other nodes, such as data changes, messages or connectivity events. 实际上,这用于接收来自其他节点的事件,例如数据更改,消息或连接事件。

See also Sending and Syncing Data for more information. 另请参阅发送和同步数据以获取更多信息。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 手表未收到手表发送的Android Wear消息 - Android Wear message sent from watch is not received by the phone devie 通过Data API从移动设备发送的数据无法在Android Wear中接收? - Data sent through Data API from mobile not received in android wear? 我怎么知道从Android设备上安装的所有应用发送或接收的数据是什么? - how can i know what data is being sent or received from all the apps installed on my android device? 如何知道是否从Android掌上电脑收到了从Android Wear发送的消息? - How to know if a message sended from Android wear is received from Android handheld? 从Wear到Phone发送消息时未收到消息[MessageAPI] - Message not received when sending a message from Wear to Phone [MessageAPI] 如何防止将通知发送给Wear? - How to prevent a notification from being sent to Wear? 未收到电话穿戴消息(通过消息api) - Phone to Wear message (via message api) not received 从Azure发送的Android推送通知如何进入“入队”状态,而无法通过电话接收? - How can an Android push notification sent from Azure get to 'Enqueued' but not get received on the phone? Android Wear:发送到Wearable的DataItem也通过本地绑定接收-如何防止这种情况? - Android Wear: DataItem sent to Wearable also received by local Binding - how to prevent this? 通过蓝牙将数据从Andread Wear Watch传输到手机 - Data Transfer from Andread Wear Watch to phone via bluetooth
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM