【问题标题】:get google glass heat programmatically以编程方式获取谷歌玻璃热量
【发布时间】:2014-07-18 08:00:15
【问题描述】:

当我在谷歌眼镜中进行直播时,如何以编程方式获取谷歌眼镜热量并在热量达到某个预定义阈值时向用户显示警报?

【问题讨论】:

    标签: android google-glass google-gdk


    【解决方案1】:

    您可以检查电池温度和电池健康状况:

    private BroadcastReceiver mBatInfoReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context arg0, Intent intent) {
            int temperature = intent.getIntExtra(BatteryManager.EXTRA_TEMPERATURE, 0);
            int health = intent.getIntExtra(BatteryManager.EXTRA_HEALTH, 0);
            Log.v("MainActivity", "temperature " + temperature);
            Log.v("MainActivity", "health " + health);
        }
    };
    

    在 onCreate 中:

    this.registerReceiver(this.mBatInfoReceiver,
                new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
    

    在Android设备上,当设备过热时,我们可以得到BATTERY_HEALTH_OVERHEAT

    请看:

    1. how to get battery temperature in android
    2. How is the Android battery health determined?

    【讨论】:

      【解决方案2】:

      Google Glass 中没有您可以访问的温度 API。

      【讨论】:

        【解决方案3】:

        我有一段时间没用过 Glass,所以也许它已经改变了,但这是不久前的一个内置功能。如果它变得太热,您会在操作系统级别收到警告。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2021-01-23
          • 2015-02-05
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多