How to access Galaxy S5 temperature sensor? - android

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.

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).

http://developer.android.com/reference/android/hardware/Sensor.html#TYPE_AMBIENT_TEMPERATURE
I think this is what you're looking for

Related

Android sensor accuracy

I made an android app that relies heavily on very accurate sensor data (magnetometer, gravitymeter and accelerometer). To achieve this I validate all these device sensors periodically for highest quality of service by checking the sensor status for SENSOR_STATUS_ACCURACY_HIGH. If one of these sensors doesn't have this status I show a calibration screen until the high accuracy can be delivered. On my own device this is working perfectly fine, but I get a lot of app reviews from people who can't get around my calibration screen. My question is, can I rely that every android device is per se capable of delivering SENSOR_STATUS_ACCURACY_HIGH or do I have to lower the minimum accuracy? If so, how is this status even defined cross devices?
No, you can't. And even if you could, its possible for the sensor to be broken and returning the high status incorrectly. And you don't know if OEM A and OEM B have the same definition of high. In the end, you're trusting the individual hardware drivers for each device, and hoping all of them are both acting in good faith and had the same definition of "high accuracy". Neither of which are really reliable.

Light and Proximity Sensors

This question is not exactly about code but rather knowing the sensors on android phones.
My application use sensors. So I would like to know is Light sensor or Proximity sensor is present on most of Devices. I have got some test devices and my observation is only higher end devices have got Light Sensor whereas the same is not available on lower end(low cost) Phones but the Proximity is available on all Phones. There would be someone playing with sensors so far, can share your observation so I can take the decision what to choose to go further with my application.
Thanks.
Check
https://developer.android.com/guide/topics/sensors/sensors_overview.html
and especially the "Sensor Availability" part.
My personal observation is that proximity and light sensors are available at least from 19 and work so far on Samsung, ASUS, Huawei, and other devices. But light sensors are more sensitive on high-end devices. So sometimes an extreme light change is needed for a light sensor on lower-end devices to even show a change from baseline 0.0. Proximity sensors work more reliably across versions, but the distance they support varies from 5cm until 10cm and more.
In short these sensors will work virtually on all relevant devices, but their sensitivity itself will be different.

Samsung Sensor Simulator

Has anyone any idea about the real-time aspect of Samsung Sensor Simulator(http://developer.samsung.com/android/tools-sdks/Samsung-Sensor-Simulator)?
Their site does say indicate it's record-and-replay but not sure if I
get that right from their documentation. So, I have the below questions which
I have asked their forum as well. But, I am curios to know if anyone here
have tried it and have had some experiences to share.
Are the real hardware sensor readings of a linked device available
on the Android emulator available in real-time? I saw it saying
"Sensor Relay" which sounds like only record-and-replay of real
hardware sensor readings on the emulator linked to a real device.
If it's real-time, then how fast are the sensor readings reaching
from the linked device to the emulator?
Can any sensor-based application running on the emulator use these
sensor readings in real-time?
In order to use these sensor readings, do the sensor-based
applications need to be modified to include some extra specific code
to interact with some module of this simulator inside the emulator
from which the sensor readings are got and hence can be used within
that interacting sensor-based application in the emulator?
Why is Samsung Sensor Simulator not compatible with Linux variants
like Ubuntu?
Is it only compatible with Android 2.2 as it's mentioned in the
documentation and not higher?
Android SDK must be of API 9 - is this a must or will it also work
the latest API 19 but with some minor issues which can be ignored?
Can more than one sensor be active and be visualized in the eclipse
IDE plugin interface? If yes, assuming any sensor-based application
running on the emulator can use these sensor readings, can more than
one sensor-based application use the different sensors readings at
the same time in real-time?
Thanks,
Raghavan

Why does Android CDD advise against using a temperature sensor other than CPU temperature sensor

The Android CDD states as follows
7.3.7. Thermometer Device implementations MAY but SHOULD NOT include a thermometer (i.e. temperature sensor.) If a device implementation does
include a thermometer, it MUST measure the temperature of the device
CPU. It MUST NOT measure any other temperature. (Note that this sensor
type is deprecated in the Android 4.2 APIs.)
It says that you can have a temperature sensor only to measure the CPU temperature.
Can anyone please tell me why android does not want environmental temperature sensors?
Android does not require device manufacturers to build any particular types of sensors into their Android-powered devices, so devices can have a wide range of sensor configurations.
Most phones only include cpu temperature measurement sensor Sensor.TYPE_TEMPERATURE (this no longer gives accurate readings) It been replaced with.TYPE_AMBIENT_TEMPERATURE Because of this, there isn't an accurate way to measure temperature of different hardware within most phones; hence the restriction to only CPU temperature which almost all android phones should be able to produce

accelerometer android query

i need to develop an app that needs data from the accelerometer. could some one please suggest which android phone in the market would be good enough for accurate accelerometer data generator. since the entire app is based on data fetched by the accelerometer, the device has to be pretty accurate.
The accelerometers in any smart phone are cheap and the difference in the accuracy of the readings is negligible. Even though these devices are cheap, they're very accurate and can output a few thousand readings per second - so the accuracy of your program is going to be dependent on what you DO with the readings in your code not by the device itself.
If you just want an Android phone for development - not to use with a wireless plan, then go to ebay and swoop a used one up for $30-40. Most of these phones have accelerometers in them, but before you buy it - google the model and make sure.
I own a G1 - the original Android phone, and the accelerometer is very accurate.

Categories

Resources