Screen Always On, PowerManager, WakeLock, Backlight

Quickly share your Android Code Snippets here...

Re: Screen Always On, PowerManager, WakeLock, Backlight

Postby zuerst » Thu Nov 03, 2011 9:12 am

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.
mySensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
mySensorManager.registerListener(mySensorEventListener, mySensorManager
SensorManager.SENSOR_DELAY_NORMAL); //

This is the sensor onsensorchanged implementation (very simple I think) but not working
if (event.sensor.getType() == SensorManager.SENSOR_ACCELEROMETER) // Do WORK
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.
Posts: 4
Joined: Wed Nov 02, 2011 8:06 am


Return to Code Snippets for Android

Who is online

Users browsing this forum: Google Feedfetcher and 5 guests