1

As I am doing live streaming in google glass, how can get the google glass heat programmatically and shows alert to the user when heat reaches some predefined threshold value?

Cœur
  • 37,241
  • 25
  • 195
  • 267

3 Answers3

3

You can check battery temperature and battery health:

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);
    }
};

In onCreate:

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

On Android devices, we can get BATTERY_HEALTH_OVERHEAT when the device's overheating.

Please see:

  1. how to get battery temperature in android
  2. How is the Android battery health determined?
Community
  • 1
  • 1
pt2121
  • 11,720
  • 8
  • 52
  • 69
1

There is no temperature API in Google Glass that you can access.

LongZheng
  • 1,873
  • 17
  • 18
0

I haven't used Glass in a while so maybe it's changed, but this was a built in feature a while back. If you it got too hot you'd receive a warning at the OS level.

CodyEngel
  • 1,501
  • 14
  • 22