6

I am creating a thermometer app in android when I test on Galaxy S3 it shows that

TYPE_AMBIENT_TEMPERATURE NOT Available

TYPE_TEMPERATURE NOT Available

I want to know that Galaxy S3 has above sensors or not? or How I can solve this issue to get temperature ?

Lucifer
  • 29,392
  • 25
  • 90
  • 143
user3409263
  • 117
  • 1
  • 4
  • 11
  • 2
    Galaxy S3 doesn't have a temperature sensor.. – Yohanes Khosiawan 许先汉 Apr 02 '14 at 04:53
  • will you please tell me that is there any alternative way to get temperature? – user3409263 Apr 02 '14 at 05:02
  • reference: in here (https://play.google.com/store/apps/details?id=com.envyandroid.tempsens) they said `..Galaxy S4 and Galaxy Note 3, which currently are the only devices with a real temperature sensor..`; I'm not sure about other workaround, but you only have barometer in S3, maybe you can estimate the temperature from the barometer data? well, I'm really not sure about that.. – Yohanes Khosiawan 许先汉 Apr 02 '14 at 05:36
  • What are you trying to achieve exactly? What's the purpose of measuring temperature? – Defozo Sep 03 '16 at 22:29

3 Answers3

1

As Yohannes said in the comment you can only calculate standard atmospheric temperature which is not useful to for daily use mostly used in aviation.

Here is the temperature estimation vs barometric height. http://home.anadolu.edu.tr/~mcavcar/common/ISAweb.pdf (page 2).

It seems only way to use an external temperature sensor with bluetooth or similar stuff and require this sensor in your app promotion.

This is really cool one: http://www.bee-wi.com/bbw200,us,4,BBW200-A1.cfm

ugur
  • 3,604
  • 3
  • 26
  • 57
0

An easy way to check if a sensor exists on a specific target phone is to install an app like AndroSensor. This will list all the available sensors.

I doubt if the underlying sensor is missing you'll be able to do much. You can use a weather service to get the current temperature of the device's location but that won't help with a thermometer.

SidJ
  • 669
  • 12
  • 29
  • how i can get the temperature without using sensors? – user3409263 Apr 02 '14 at 09:34
  • 1
    You can't really. You can connect to a web service that provides weather based on the phone's location like this app https://play.google.com/store/apps/details?id=com.xiaad.android.thermometertrial – SidJ Apr 02 '14 at 23:04
  • 1
    @user3409263 I would actually recommended looking this route if you want to make your app available for something like 98% of users. Very few devices have a temp sensor, but almost all of them have an internet and gps signal. – zgc7009 May 04 '16 at 14:57
0

Not sure if this also applies to the Galaxy S3, but you can try to look for sensors with a type value above TYPE_DEVICE_PRIVATE_BASE. Many phones (for example Nexus 5x and Pixel 3) have one or even multiple sensors that exhibit a temperature reading through this and you usually can tell by the name of the sensor (for example "BMI160 Temperature" or "BMP380 Temperature", both on a Pixel 3).

These "vendor defined sensors" are usually from sensors that require a temperature reading for compensation/calibration (BMI160 is the IMU and BMP380 the barometer of the Pixel 3). Especially barometers are very likely to have a temperature channel.

However, there is a good reason that the manufacturer does not offer these temperature readings through the official TYPE_AMBIENT_TEMPERATURE type: Placing a thermometer inside an enclosed device that heats itself from the inside is not a good method to measure the ambient temperature. Especially if the temperature reading is only meant to compensate temperature drift of the sensor, you will not get anything useful as you mostly measure the temperature of the inside of your phone. Even if a phone officially measures ambient temperature, the results will not be very precise for the same reasons.