8

In the manual on the page 19 there is an info on temperature sensor in S5.

Temperature and Humidity sensor allows your device to read both temperature and humidity conditions. This is useful to calculate calories burned within S Health

But I cannot seem to find any data on how to use this sensor.

Did anyone find any way to use this sensor in our own app?

EDIT

Take note that if you install any 3rd party temperature application, it will say that your device (S5) does not have temperature sensor. So I cannot use the standard code to access the sensor because sensor is not being detected. But Samsung app S Health is using this sensor and I am not sure which API it uses.

sandalone
  • 41,141
  • 63
  • 222
  • 338
  • 1
    See if it is available elsewhere in the Samsung Mobile SDK. Or, list all of the sensors and see if there is one that looks like it might match: https://github.com/commonsguy/cw-omnibus/tree/master/Sensor/Monitor – CommonsWare May 06 '14 at 18:53
  • @CommonsWare Tried all sensors types which deal with temperature, but each produces `exception`. So with usual sensor types we cannot access temperature sensor since the exceptions say that S5 does not have temperature sensor. But manual says the opposite. Also Samsung mobile SDK does not refer to any temperature sensor. The closest one is its S Health API which also does not mention retrieving temperature data. Do you have any suggestions? You have far more experience then me in cases like this. – sandalone May 09 '14 at 10:07
  • I would recommend running the program that I linked to in my earlier comment and examining the results. It builds a `ListView` of all available sensors, plus allows you to view the values coming off of that sensor. By definition, it only shows sensors that exist and therefore will not raise an exception. – CommonsWare May 09 '14 at 11:16
  • @CommonsWare Did that as well as with my own code writing sensors into `Log.i()`. Both shows 19 sensors and not a clue of temperature. I also noticed that there is no clue of humidity sensor as well. Both are stated in the official manual. Can you suggest what else I can do? – sandalone May 09 '14 at 18:05
  • 2
    To quote the Wicked Witch of the West: "Surrender, Dorothy!" This, of course, assumes that your name is Dorothy -- feel free to replace that with your actual name. :-) If they aren't exposing it through the sensor system, and they aren't exposing it through the Mobile SDK, then probably they're not going to be accessible in any supported or stable fashion. You're welcome to ask questions on Samsung's developer forums, if you haven't done so already. – CommonsWare May 09 '14 at 18:17
  • @CommonsWare I can also bang my head against the wall :). Thanks, have not thought about its forum, but will definitely ask there as well. – sandalone May 09 '14 at 18:38

2 Answers2

5

Galaxy S5 does not have Temperature and Humidity sensors, unlike S4. Samsung announced it and close to publishing decided not to ship it. It seems that the reason was the fact that these two sensors could not work along with water-proof feature.

S Health app has ability to measure body temperature but its API is hidden at this moment. It means that we have no clue if it measures temperature via external devices (Gear) or it can measure it using heart-rate sensor. Also we don't know if it can measure air temperature (probably not).

sandalone
  • 41,141
  • 63
  • 222
  • 338
0

http://developer.android.com/reference/android/hardware/Sensor.html#TYPE_AMBIENT_TEMPERATURE

I think this is what you're looking for

  • 1
    @sandalone I saw it, but have you tried what I have suggested? TYPE_AMBIENT_TEMPERATURE is new, previously to read temperatures you had to use TYPE_TEMPERATURE. Maybe the 3rd party apps still use that? Also, why dont you try decompiling the Samsung app which uses temp sensor, you might find the details on how to use it. It might be unethical but it's a sure way to find out if they are using custom code or relying on official Android APIs. – user3573421 May 06 '14 at 19:22
  • Also, see this: http://www.reddit.com/r/tasker/comments/1fvdo8/request_access_sensor_values_on_gs4_temperature Might work for S5 too – user3573421 May 06 '14 at 19:24
  • 1
    It breaks on this sensor as well. – sandalone May 08 '14 at 19:02