2014-07-18 4 views
1

Google Glass에서 실시간 스트리밍을하고 있는데, 프로그래밍 방식으로 Google Glass 열을 얻을 수 있으며 열이 미리 정의 된 임계 값에 도달하면 사용자에게 경고를 보냅니 까? 사전에프로그래밍 방식으로 google 열을받습니다.

감사합니다, 가네 사용자가 액세스 할 수있는 구글 유리에는 온도 API가 없습니다

답변

0

글래스를 잠시 사용하지 않았으므로 변경되었을 수 있습니다. 너무 뜨거워지면 OS 수준에서 경고를 받게됩니다. 우리가 BATTERY_HEALTH_OVERHEAT 장치의 과열을 얻을 수 있습니다, 안드로이드 장치에

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

:

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에서 :

관련 문제