[英]How do I send an Intent from my Android phone to a paired Google Glass
I want to create an intent on the phone and use it to start a service on Glass. 我想在手机上创建一个意图,并用它在Glass上启动服务。 Or Send an intent from the phone to Glass, catch it using a BroadcastReceiver and have the BC start the service.
或将意图从电话发送到Glass,使用BroadcastReceiver捕获它,然后让BC启动服务。 But I can't see a way of getting the intent off the phone.
但是我看不出有办法消除电话意图。
The devices are paired correctly. 设备已正确配对。
SMS received on my phone shows on Glass. 我的手机上收到的短信显示在Glass上。
When I created a BroadcastReceiver on Glass to try to catch the SMS received intent, it was never called. 当我在Glass上创建一个BroadcastReceiver试图捕获SMS接收到的意图时,它从未被调用过。 So it looks likes the SMS notification is getting to Glass by some alternate mechanism.
因此,似乎SMS通知通过某种备用机制到达了Glass。
<receiver android:name=".SmsListener">
<intent-filter android:priority="2147483647">
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
NB I can't even seem to get a notification created on the phone to appear on Glass. 注意:我什至似乎都没有在手机上创建通知来显示在Glass上。 I constructed the notification using
NotificationCompat.Builder
and used the WearableExtender to make it visible to wearables (it showed on my paired LG G), but not on Glass. 我使用
NotificationCompat.Builder
构造了通知,并使用WearableExtender使它对可穿戴设备可见(在配对的LG G上显示),但对Glass不可见。
.extend(new NotificationCompat.WearableExtender().setContentIcon(R.drawable.ic_notif_alert))
Any ideas on how to send an Intent to a paired wearable? 关于如何向配对可穿戴设备发送Intent的任何想法?
While Google Glass will be getting Android Wear compatibility , it does not yet have that functionality and therefore does not mirror notifications. 虽然Google Glass将获得Android Wear兼容性 ,但它尚不具有该功能,因此不会镜像通知。
As of right now, there is no Google provided mechanism to send information directly from a device to a connected Google Glass, although there are some unofficial libraries . 截至目前,尽管有一些非官方的库 ,但Google还没有提供将信息直接从设备发送到已连接的Google Glass的机制。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.