0

I am developing an Android application that will keep track of the temperature of the battery of the phone. When the temperature of the battery exceeds some certain value, another activity will then give an alert which is an alarm.

How can I let my application keep track of the temperature of the battery and send that info to another activity (an alarm system) to compare values and determine whether to set off the alarm?

I am using Eclipse and Android 4.1.2.

Pops
  • 30,199
  • 37
  • 136
  • 151
WeSiang
  • 1
  • 1

1 Answers1

0

There's a sensor. For Android:

http://developer.android.com/reference/android/os/BatteryManager.html#EXTRA_TEMPERATURE

Also relevant: Android Hardware Battery temperature, where is the sensor?

Community
  • 1
  • 1
We Are All Monica
  • 13,000
  • 8
  • 46
  • 72
  • Thanks BradLarson, By the way, what i need is about the algorithm. i understood that by using that function can get the integer value of the current temperature of the mobile phone. but is there anyway, we can know the algorithm how they actually detect ? – WeSiang Aug 22 '12 at 15:41