question about sensor, orientationListener and light sensor

by birdy » Tue, 31 Mar 2009 03:10:52 GMT


Sponsored Links
 Hi all:

I studying set rotation by sensor now. I modify
mCurrentAppOrientation from SCREEN_ORIENTATION_UNSPECIFIED to
SCREEN_ORIENTATION_SENSOR. So OrientationListenerwill be enabled
at initial time. When enable mOrientationListener, sensorManager
should register a listener by registerListener and retuen true. But it
return false. I traced the code in SensorManager.java and found I do
not have a sensorList.
There are some questions:
1.How can I build up a sensor list (or I should ask : How can I init
SensorManager or SensorService)?
2.When enable mOrientationListener, there is a parameter :
SENSOR_ACCELEROMETER , is this parameter used for rotation detector?
What functin is SENSOR_ORIENTATION used for?.
3.Does android support SENSOR_LIGHT? If I want add light sensor, how
should I do?

Thanks a lot
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Built-in Activity for sending text messages

Is there a built in activity for sending picture text messages?

If so, what does the intent look like that fires it off?
--~--~---------~--~----~------------~-------~--~----~

2. ALSA build error

My local_manifest.xml:

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="platform/vendor/asus/eee_701" path="vendor/asus/
eee_701"/>
<project name="platform/external/alsa-lib" path="external/alsa-lib"/>
<project name="platform/hardware/alsa_sound" path="hardware/
alsa_sound"/>
</manifest>

I changed BoardConfig with BOARD_USES_ALSA_AUDIO := true

I'm getting the following error:
In file included from hardware/alsa_sound/AudioHardwareInterface.cpp:
27:
hardware/alsa_sound/AudioHardwareStub.h:24:45: error: hardware/
AudioHardwareInterface.h: No such file or directory
In file included from hardware/alsa_sound/AudioHardwareInterface.cpp:
27:
hardware/alsa_sound/AudioHardwareStub.h:30: error: expected class-name
before '{' token
hardware/alsa_sound/AudioHardwareStub.h:39: error: expected ',' or
'...' before '<' token
hardware/alsa_sound/AudioHardwareStub.h:39: error: ISO C++ forbids
declaration of 'Vector' with no type
hardware/alsa_sound/AudioHardwareStub.h: In member function 'virtual
int android::AudioStreamOutStub::format() const':
hardware/alsa_sound/AudioHardwareStub.h:36: error: 'AudioSystem' has
not been declared
hardware/alsa_sound/AudioHardwareStub.h: At global scope:
hardware/alsa_sound/AudioHardwareStub.h:42: error: expected class-name
before '{' token
hardware/alsa_sound/AudioHardwareStub.h:51: error: expected ',' or
'...' before '<' token
hardware/alsa_sound/AudioHardwareStub.h:51: error: ISO C++ forbids
declaration of 'Vector' with no type
hardware/alsa_sound/AudioHardwareStub.h: In member function 'virtual
int android::AudioStreamInStub::format() const':
hardware/alsa_sound/AudioHardwareStub.h:48: error: 'AudioSystem' has
not been declared
hardware/alsa_sound/AudioHardwareStub.h: At global scope:
hardware/alsa_sound/AudioHardwareStub.h:55: error: expected class-name
before '{' token
hardware/alsa_sound/AudioHardwareStub.h:72: error: ISO C++ forbids
declaration of 'AudioStreamOut' with no type
hardware/alsa_sound/AudioHardwareStub.h:72: error: 'AudioStreamOut'
declared as a 'virtual' field
hardware/alsa_sound/AudioHardwareStub.h:72: error: expected ';' before
'*' token
hardware/alsa_sound/AudioHardwareStub.h:77: error: ISO C++ forbids
declaration of 'AudioStreamIn' with no type
hardware/alsa_sound/AudioHardwareStub.h:77: error: 'AudioStreamIn'
declared as a 'virtual' field
hardware/alsa_sound/AudioHardwareStub.h:77: error: expected ';' before
'*' token
hardware/alsa_sound/AudioHardwareStub.h:84: error: expected ',' or
'...' before '<' token
hardware/alsa_sound/AudioHardwareStub.h:84: error: ISO C++ forbids
declaration of 'Vector' with no type
hardware/alsa_sound/AudioHardwareStub.h:88: error: expected ',' or
'...' before '<' token
hardware/alsa_sound/AudioHardwareStub.h:88: error: ISO C++ forbids
declaration of 'Vector' with no type
In file included from hardware/alsa_sound/AudioHardwareInterface.cpp:
28:
hardware/alsa_sound/AudioHardwareALSA.h:116: error: 'Mutex' does not
name a type
hardware/alsa_sound/AudioHardwareALSA.h:130: error: expected class-
name before ',' token
hardware/alsa_sound/AudioHardwareALSA.h:161: error: expected ',' or
'...' before '<' token
hardware/alsa_sound/AudioHardwareALSA.h:161: error: ISO C++ forbids
declaration of 'Vector' with no type
hardware/alsa_sound/AudioHardwareALSA.h:177: error: expected class-
name before ',' token
hardware/alsa_sound/AudioHardwareALSA.h:211: error: expected ',' or
'...' before '<' token
hardware/alsa_sound/AudioHardwareALSA.h:211: error: ISO C++ forbids
declaration of 'Vector' with no type
hardware/alsa_sound/AudioHardwareALSA.h:224: error: expected class-
name before '{' token
hardware/alsa_sound/AudioHardwareALSA.h:234: error: ISO C++ forbids
declaration of 'AudioStreamOut' with no type
hardware/alsa_sound/AudioHardwareALSA.h:234: error: 'AudioStreamOut'
declared as a 'virtual' field
hardware/alsa_sound/AudioHardwareALSA.h:234: error: expected ';'
before '*' token
hardware/alsa_sound/AudioHardwareALSA.h:238: error: ISO C++ forbids
declaration of 'AudioStreamIn' with no type
hardware/alsa_sound/AudioHardwareALSA.h:238: error: 'AudioStreamIn'
declared as a 'virtual' field
hardware/alsa_sound/AudioHardwareALSA.h:238: error: expected ';'
before '*' token
hardware/alsa_sound/AudioHardwareALSA.h:249: error: expected ',' or
'...' before '<' token
hardware/alsa_sound/AudioHardwareALSA.h:249: error: ISO C++ forbids
declaration of 'Vector' with no type
hardware/alsa_sound/AudioHardwareALSA.h:259: error: 'Mutex' does not
name a type
hardware/alsa_sound/AudioHardwareInterface.cpp:87: error: expected
constructor, destructor, or type conversion before '*' token
hardware/alsa_sound/AudioHardwareInterface.cpp:230: error: expected
`}' at end of input
make: *** [out/target/product/eee_701/obj/SHARED_LIBRARIES/
libaudio_intermediates/AudioHardwareInterface.o] Error 1

Why is that? I notice AudioHardwareInterface.h is missing?


--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. Fwd: Market and Developer Frustration

4. IMX31 warning msg: "unable to open an initial console"

5. Copy File to file system

6. Very Basic question regarding Activities

7. App folder and JNI privilege