Questions tagged [android-sensors]

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)

Sensor Class Reference

1574 questions
208
votes
11 answers

How do I find out if the GPS of an Android device is enabled

On an Android Cupcake (1.5) enabled device, how do I check and activate the GPS?
Marcus
  • 8,321
  • 4
  • 19
  • 23
46
votes
7 answers

How is it possible that Google Fit app measures number of steps all the time without draining battery?

The Google Fit app, when installed, measures the duration you are walking or running, and also the number of steps all the time. However, strangely, using it does not seem to drain the battery. Other apps like Moves which seems to record number of…
Randy Sugianto 'Yuku'
  • 64,635
  • 54
  • 168
  • 216
46
votes
7 answers

getSystemServices is undefined when called in a Fragment?

I want TextViews to display the sensors readings in a Fragment. When trying to initialize the SensorManager the getSystemServices is undefined in the Fragment, eclipse says.Why and how to fix it. Fragment public class FragSensors extends Fragment…
user2121
  • 6,401
  • 13
  • 57
  • 121
27
votes
5 answers

Android 4.3: BLE: Filtering behaviour of startLeScan()

I'm working on a BluetoothLE sensor device, for which I need to form a one-to-many broadcast of data. As per the spec, peripherals may only have a single master, and due to limitations of the chip and stack I'm designing on, a master can only have…
25
votes
4 answers

Turn off screen programmatically when face is close the screen on Android

My app is a dialer and when user holding the phone near his head I need to turn screen off and prevent clicking on the controls - like native Android dialer behavior. What API level I need and how can I do this in right way?
Solkin
  • 856
  • 1
  • 9
  • 15
23
votes
1 answer

How can i replace type_orientation (is deprecated) for android 4.0.3?

Hello I want to use the type type_orientation but it is deprecated for the android 4.0.3 . I use it for the augmented reality. I tried to find on the net but without success. My application works but my text inside stay in the same place! Here my…
mhsc90
  • 234
  • 1
  • 2
  • 11
23
votes
4 answers

What's the conceptual difference between rotation vector sensor and orientation sensor in Android?

Android provides both the rotation vector sensor and the orientation sensor. I know they returns different data, because for vector sensor we have sin of angles, in orientation sensor we have angles. But what's the conceptual difference? I can't…
user1781028
  • 1,348
  • 3
  • 19
  • 44
23
votes
3 answers

extract yaw, pitch, and roll from a rotationMatrix

I have a sensor manager that returns a rotationMatrix based on the devices Magnetometer and Accelerometer. I have been trying to also calculate the yaw pitch and roll of the user's device but am finding that pitch and roll interfere with each other…
erik
  • 4,698
  • 11
  • 64
  • 111
22
votes
6 answers

Android Compass that can Compensate for Tilt and Pitch

I'm trying to make a application on my Android phone (Nexus 4), which will be used in a model boat. I've added low pass filters to filter out the gitter from the sensors. However, the compass is only stable when the phone is flat on its back. If I…
Adam Davies
  • 2,590
  • 4
  • 29
  • 52
22
votes
2 answers

What is the difference between "gravity" and "acceleration" sensors in Android?

What is the difference between gravity and acceleration sensors in Android? From my point of view the physical value is the same in both cases. Which one measures the force acting on unit mass inside the device? ADDITION The question is: what…
Suzan Cioc
  • 26,725
  • 49
  • 190
  • 355
20
votes
2 answers

How i will detect motion sensor in broadcast receiver?

I had written one receiver to detect device motion is changed or not like this in Manifest.xml
Hanuman
  • 908
  • 14
  • 35
19
votes
1 answer

Android: How to get Google Fit data from Wearable device?

I'm following the same steps described here (the Google Fit client connection part is working fine). final DataType dataType=TYPE_STEP_COUNT_DELTA; DataSourcesRequest requestData = new DataSourcesRequest.Builder() …
user3290180
  • 3,590
  • 9
  • 38
  • 69
18
votes
2 answers

MultiSelect gesture like Google Photos app

I want to implement multi select gesture in my app like in new Google Photos App here: I have tried following this answer, but couldn't do this. Can anyone just guide me?
17
votes
1 answer

Reference coordinate system changes between OpenCV, OpenGL and Android Sensor

I am working with OpenCV, Android and OpenGL for an Augmented Reality project. As far as I know the coordintate system in OpenGL is The OpenCV coordinate system is: When combining these devices with android sensors how can I do the coordinate…
Jav_Rock
  • 21,011
  • 18
  • 115
  • 164
17
votes
1 answer

How to make an accurate compass on android

my android application shows the direction of a particular place in the world and therefore in needs to get the compass degree. This is the code I've been using to calculate the degrees: public void getDirection() { mySensorManager =…
eladrich
  • 745
  • 1
  • 5
  • 15
1
2 3
99 100