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
0
votes
2 answers

Sensor List in Samsung GT-I9300

Please help.I am trying to get all the available sensors of a android device.But when i tried to get from 'GT_19300' it shows a list given below "LSM330DLC 3-axis Accelerometer AK8975C 3-axis Magnetic field sensor iNemoEngine…
Sree
  • 2,968
  • 2
  • 28
  • 38
0
votes
1 answer

Stopping Sensor from another Thread

I want to stop Sensor manager activity (unregister it) from another Thread or class after some operations to be performed. How can I do that?
metzelder
  • 504
  • 1
  • 11
  • 32
0
votes
1 answer

Android Data Collection

I am trying to log android sensor data and then upload it to a server (using Parse.com) on a 24 hour basis (for testing it I will set this to one hour though). My problem is that I know how to write a way to save the sensor data to a local txt file,…
eWizardII
  • 1,884
  • 4
  • 30
  • 54
0
votes
2 answers

Orientation change nullifies SensorManager reference

I am making an application that attaches both location and sensor listeners, so that it can then record changes from them into a file. What's strange is that one of the phones using the application was Force Closing in some instances, which I…
ravemir
  • 905
  • 2
  • 11
  • 27
0
votes
1 answer

Android: Shakelistener error

i have a shake listener as follows public class ShakeListener implements SensorEventListener { private String TAG = ShakeListener.class.getSimpleName(); private static final int FORCE_THRESHOLD = 800; private static final int…
teekib
  • 2,693
  • 9
  • 37
  • 73
0
votes
1 answer

Linear Acceleration in non zero in steady condition

Possible Duplicate: Android accelerometer accuracy (Inertial navigation) I am an amateur in android programming and currently designing a game where I need to calculate the distance covered when the user moves his/her device. I get the value of…
Varun Gupta
  • 1,349
  • 6
  • 23
  • 51
0
votes
2 answers

exception with SENSOR_ACCELEROMETER

I want to register a SENSOR_ACCELEROMETER in a service, but it turns out to be a nullexception.Following is my code: asensor = new AccerSensor(context);//the sensoreventlistener Log.i("wogua", "creating"+asensor.toString()); …
honeypig
  • 39
  • 4
0
votes
1 answer

Android Sensor Issue

I need to get the data from multiple sensors. I have tried creating a single listener for all the sensors and have tried creating individual listeners for each sensor. Neither method works if more then one sensor is added. If multiple sensors are…
user1832287
  • 199
  • 2
  • 10
0
votes
0 answers

Two listeners for same sensor event

I wanted to learn more about using sensors in Android. I made a small application for testing accelerometer. When it detects shake it displays Toast message. I put appropriate listener in a service. I also have a flashlight application on my phone…
sinisha
  • 973
  • 11
  • 29
0
votes
1 answer

how to use the light sensor

I want to use light sensor to detect the environment of phone changing, then protect the phone from being stolen. But I don't know whether, if the screen is turned off, the sensor still works or not. And, can anybody make some suggestions how can I…
honeypig
  • 39
  • 4
0
votes
1 answer

Onshake method : activity should start only once

i am starting a activity with onShake method..each time i shake, the activity is getting started but i want the activity to start only the first time i shake...i have seen the similar question here: Start new activity using onShake method ..but…
teekib
  • 2,693
  • 9
  • 37
  • 73
0
votes
1 answer

How to calculate end-points of a line whose orientation aligns with real horizon using Android Sensor data

I'd like to calculate two points that align with the real horizon (presuming the user is holding the device virtually). I'd like the line connecting those 2 points to pass through a center point of my choosing. I'm collecting…
navicore
  • 1,601
  • 2
  • 24
  • 43
0
votes
1 answer

Android changing brightness using sensor

I have an app through which I can change the brightness of the device manually. I want to do that using the sensor. What code do I have to add? Also what changes I have to made in the manifest? Here it is my code: package…
Sumedh Tambat
  • 781
  • 9
  • 23
0
votes
1 answer

sensor implementation on different device manufacturer

Samsung phone runs Android operating System and HTC phone runs Android operating system (Assuming both Samsung and HTC phone have accelerometer sensor). Can I use same Java code, which have been written for accessing data from accelerometer…
Pankesh
  • 1,129
  • 2
  • 16
  • 46
0
votes
1 answer

How to register or unregister a sensor event listener on click of a button?

I am using the following code to register and unregister SensorEventListener. //Get the Toggle Button final ToggleButton tb=(ToggleButton) findViewById(R.id.activate); //Listener for ToggleButton tb.setOnClickListener(new…
Ashwin
  • 10,386
  • 29
  • 103
  • 172
1 2 3
99
100