【问题标题】:Can we make calls to any number in Android Wear 2.0?我们可以拨打 Android Wear 2.0 中的任何号码吗?
【发布时间】:2017-08-17 08:41:27
【问题描述】:

我正在开发 Android Wear 应用程序,我正在开发一个有助于在紧急情况下拨打 911 的功能。我还没有看到android wear 2.0。

我知道 2.0 中有互联网连接和 Google Play 商店,但我不知道我们是否也可以拨打 2.0 中的任何号码。有人可以回答我的问题。

【问题讨论】:

    标签: android wear-os


    【解决方案1】:

    是的,如果您的设备具有蜂窝网络功能(例如 LG Watch Urbane 2nd Edition LTE)和 SIM 卡,您就可以拨打电话。

    在代码中它可能看起来像这样:

     Uri number = Uri.parse("tel:" + phoneNumber);
     Intent callIntent = new Intent(Intent.ACTION_DIAL, number);
     startActivity(callIntent);
    

    这不需要任何权限,因为它实际上并没有拨打电话,只是打开可穿戴设备上的拨号器。据我所知,也应该可以在没有用户确认的情况下拨打电话,但这需要处理运行时权限。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-01
      相关资源
      最近更新 更多