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?
Asked
Active
Viewed 241 times
3 Answers
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:
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