• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Working with Sensor

saariko

Lurker
I have a Galaxy Tab 1000.

I am trying to write a code, that will identify ANY movement.

I have version 2.2 on the phone.

This is the oncreate code.
Code:
OnCreate()
		mySensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE); 
		mySensorManager.registerListener(mySensorEventListener, mySensorManager
				.getDefaultSensor(Sensor.TYPE_ACCELEROMETER),
				SensorManager.SENSOR_DELAY_NORMAL); //


This is the sensor onsensorchanged implementation (very simple I think) but not working
Code:
			if (event.sensor.getType() == SensorManager.SENSOR_ACCELEROMETER)
				// Do WORKL



The event.sensor.getType() returns 1

If I do: getSensorList(Sensor.TYPE_ALL);
I get sensors
compass, compass, BMA150 (accel), temp, magnet, proximity, light and Gyro (weird - I thought it's only up in 3.0

please advise, how can I get motion detection on the phone.

thanks


------
 
Hi,

I can help with this but am wondering if this is still an active thread. Can you let me know if you are still monitoring for responses?
 
Back
Top Bottom