【问题标题】:How do I send an Intent from my Android phone to a paired Google Glass如何从我的 Android 手机向配对的 Google Glass 发送 Intent
【发布时间】:2014-07-21 04:20:54
【问题描述】:

我想在手机上创建一个意图并使用它在 Glass 上启动一项服务。或者从手机向 Glass 发送一个意图,使用 BroadcastReceiver 捕获它并让 BC 启动服务。但我看不出有什么方法可以从电话中消除意图。

设备已正确配对。

手机上收到的短信会显示在 Glass 上。

当我在 Glass 上创建一个 BroadcastReceiver 来尝试捕捉收到的 SMS 意图时,它从未被调用过。所以看起来 SMS 通知是通过某种替代机制到达 Glass 的。

<receiver android:name=".SmsListener">
    <intent-filter android:priority="2147483647">
        <action android:name="android.provider.Telephony.SMS_RECEIVED" />
    </intent-filter>
</receiver>

注意,我什至无法让在手机上创建的通知出现在 Glass 上。我使用 NotificationCompat.Builder 构建了通知,并使用 Wea​​rableExtender 使其对可穿戴设备可见(它显示在我配对的 LG G 上),但在 Glass 上不可见。

.extend(new NotificationCompat.WearableExtender().setContentIcon(R.drawable.ic_notif_alert))

关于如何向配对的可穿戴设备发送 Intent 有什么想法吗?

【问题讨论】:

    标签: android android-intent google-glass wear-os


    【解决方案1】:

    虽然 Google Glass 将是 getting Android Wear compatibility,但它还没有该功能,因此不会镜像通知。

    到目前为止,Google 还没有提供将信息直接从设备发送到连接的 Google Glass 的机制,尽管有一些 unofficial libraries

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-03-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-05
      • 2015-10-05
      相关资源
      最近更新 更多