简体   繁体   English

如何从Android手机向配对的Google Glass发送Intent

[英]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.

相关问题 如何从Google Glass中的卡片启动意图 - How can I start an intent from a card in Google Glass 检测玻璃与手机配对 - Detect Glass paired with phone 如何将手机中的视频检索到Google Glass中? - How to retrieve videos from phone into Google glass? 如何在不使用intent的情况下将背景中的电子邮件从android手机发送到我的电子邮件 - how to send email in background from the android phone to my email without using intent Android ACTION_SEND意图和Google Analytics - 我怎么知道他们选择了什么? - Android ACTION_SEND Intent and Google Analytics - how do I know what they picked? 将相机流从Google Glass发送到Android设备 - Send camera stream from Google Glass to Android device 如何将OpenCV Mat作为putExtra发送到Android Intent? - How do I send OpenCV Mat as a putExtra to Android Intent? Android Google Maps的GeoCoords发送意图 - GeoCoords from Android Google Maps SEND Intent 如何配置我的Android手机以通过MMS将图像发送到Twilio? - How do I configure my Android phone to send images to Twilio via MMS? 我的Google Glass应用程序启动后如何启动线程? - How do I start a Thread as soon as my Google Glass application starts?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM