How does Android obtain battery temperature? I am curious about the way Android phones obtain the battery temperature. Android has an API called BatteryManager which provides the value of instant battery temperature, but is there an actual temperature sensor inside the battery? Or is this value purely calculated by a certain equation, using the value the current, the voltage and the elapsed time? If it is calculated not measured, is there anyway that we can know how hot the phone really is?
Every mobile battery has an inbuilt thermistor, (which is a transducer which varies its resistance with respect to its temperature) with which the charging circuit constantly measures the battery temperature. It can even prevent charging the battery if the temperature reaches dangerous level and by controlling its temperature, the life of battery is increased.

Mobile battery has more than two terminals, one of which is for this thermistor. See the image in my question asked in this site.