Android-sensors tag unites questions that are connected with different hardware sensors that are embedded into Android devices (barometer, accelerometer, magnetometer, microphone, camera and so on)
Questions tagged [android-sensors]
1574 questions
0
votes
2 answers
Get only 1 event from sensor
I'm trying to get only 1 event from orientation sensor.
My code is:
@Override
public void onSensorChanged(SensorEvent event) {
Log(event);
unregisterSensor(...);
}
Then in a thread every 1000ms I do:
registerSensor();
Thread.sleep(2000);
The…
![](../../users/profiles/1293578.webp)
Hoconosc
- 386
- 8
- 21
0
votes
1 answer
Determine height and width of billboard using Android sensors
In the Google Play store there is an app titled Smart Measure that can be used to measure the height and width of an object. I would like to integrate this functionality into a survey app I am developing.
Firstly I have done a test or two with this…
![](../../users/profiles/1257074.webp)
Rynardt
- 5,397
- 7
- 29
- 41
0
votes
1 answer
Light sensor issue
The code mentioned below works perfectly on samasung galaxy s(GB) but i didnt worked on SE neo v(ics) and tipo(ics). it is a sony issue or a ics issue.when started app starts and immediately display the toast "No Light Sensor! quit-".
import…
![](../../users/profiles/1560965.webp)
dreamer1989
- 954
- 3
- 10
- 29
0
votes
1 answer
best sensor selection for ar application
Hello i want to ask which is the best sensor i can use for an augmented-reality application? my augmented reality app is using the mobiles camera and finds points of interest in the live view. i want to detect when the poi is in the field of view of…
![](../../users/profiles/1429370.webp)
userX
- 59
- 10
0
votes
1 answer
shake not working beyond certain value
I want to measure a big shake(Eg: Measure when bike or car gets into accident. I want to measure that phone shake). I have code for play audio when my mobile is shaken. But when I changed SHAKE_THRESHOLD value to a high level it wasn't working.
Is…
![](../../users/profiles/1597030.webp)
Ram
- 1,717
- 3
- 17
- 28
0
votes
1 answer
Implementing SensorEventListener in a BroadcastReceiver... is it possible?
Why can't I have a class extending BroadcastReceiver and implementing SensorEventListener? This class receives alarm intents set in my application.
I have a class instance variable that is set inside the implemented onSensorChanged method. In the…
![](../../users/profiles/1445030.webp)
jsstp24n5
- 594
- 1
- 6
- 13
0
votes
2 answers
Sampling Android Sensors
Is there a way to get the values from an Android sensor say every 5 minutes?
For example, is there a way I can poll the AMBIENT_TEMPERATURE sensor every 5 minutes regardless of there being a change in temperature or not?
Right now, I can only access…
![](../../users/profiles/3984077.webp)
corgichu
- 2,488
- 3
- 27
- 43
0
votes
1 answer
Camera Invalidate() can't work in onSensorChanged method
I have a Variable "azimuth_angle"
I hope when i touch the screen and change the direction
the Variable "azimuth_angle" will be decrease
in my code
touch the screen the variable can decrease
but change the direction it cant work
i use the…
![](../../users/profiles/1584912.webp)
user1584912
- 93
- 1
- 4
0
votes
1 answer
Checking long cover of sensor
I've got some probmel with checking long time cover of my sensor (which is used to turn off the screen while phone is near ear). I want to detect short and long cover of this sensor (for example by my finger). It's my code, I can detect cover but I…
![](../../users/profiles/1320033.webp)
PatLas
- 149
- 1
- 4
- 15
0
votes
2 answers
Get accelerometer and Location values without listener
I'd like to simply get these values whenever I want and not on events...is it possible?
I can't see any method getXValue(), getLatitude(),ecc ...
![](../../users/profiles/1610075.webp)
user1610075
- 1,483
- 3
- 15
- 31
0
votes
1 answer
Setting one element in array changes others
I checked other similar tags with almost same title. Those answers were not relevant
When setting element at one position of array, both the elements have the same value.
public class LogActivity extends Activity
{
@Override
public void…
![](../../users/profiles/434708.webp)
Dheepak
- 1,381
- 2
- 11
- 14
0
votes
1 answer
Multiple sensor data logging in Android
I am working on a datalog application to log data of all the sensor's available on the android device. I wanted to know which is an efficient way? Registering a single listener for all the sensors or individual listeners to each…
![](../../users/profiles/434708.webp)
Dheepak
- 1,381
- 2
- 11
- 14
0
votes
1 answer
Mono for Android - SensorType.RotationVector missing
According to the documentation, the SensorType enum includes a RotationVector value. Which looks like it will do what I want it to. However when I try to use it in my code it tells me 'Android.Hardware.SensorType' does not contain a definition for…
![](../../users/profiles/45068.webp)
gbanfill
- 2,196
- 13
- 21
0
votes
1 answer
Obtaining sensors data while the screen is off (Android 4.0+)
As far as I know on Android devices there is no 100%-sure way to get the data from device sensors while the screen is off. There are some workarounds, but they do not work always. But all the posts I read were describing Android versions ~2.2.
Does…
![](../../users/profiles/1185254.webp)
alex
- 9,184
- 12
- 64
- 86
0
votes
2 answers
Sound sensor, Android
I want to make an test application which will be capable of recording sound of the environment and will generate a graph in android. Please someone suggest me how to capture the surroundings' sound and analyze it to detect noise or something like…
![](../../users/profiles/1357883.webp)
Emon Emoni
- 133
- 5
- 17