No light sensor and/or proximity sensor detected on Hero?

by mileoresko » Tue, 09 Feb 2010 18:44:03 GMT


Sponsored Links
 Somebody? Anybody? I really need a tip on this one.
There is just no sense in this output of the getSensorList() function.
There is obviously a light sensor on the device (HTC Hero), yet I can
not programmaticaly access it. Why?

--



No light sensor and/or proximity sensor detected on Hero?

by mileoresko » Thu, 11 Feb 2010 07:49:41 GMT


 Okay, I found a 3rd party application that actually uses the light
sensor (the app is called Proximity Sensor), and it works just fine on
my HTC Hero.

This must mean that I am not dong something right in the procedure
described above.

As far as I read the SDK reference, I see that I need to pass a Sensor
object to the registerLIstener method of the SensorManager, in order
to register my implementation of the SensorEventListener. The only way
I found to get the required Sensor object is by using the
getSensorList() method - as described above.

Before this poor little thread turns into a mono-drama, someone please
provide me with some insight here. Thanks.

--


Sponsored Links


No light sensor and/or proximity sensor detected on Hero?

by Simon » Fri, 12 Feb 2010 09:13:11 GMT


 What is the result of calling
sensorManager.getDefaultSensor(Sensor.TYPE_LIGHT) ?

-- Simon





--



No light sensor and/or proximity sensor detected on Hero?

by mileoresko » Fri, 12 Feb 2010 19:08:10 GMT


 Hi Simon,

sensorManager.getDefaultSensor(Sensor.TYPE_LIGHT) returns: null






--



No light sensor and/or proximity sensor detected on Hero?

by Simon » Sun, 14 Feb 2010 00:02:44 GMT


 ell that may be your problem.. what makes you think the Proximity
sensor app you downloaded uses the Light sensor?





--



No light sensor and/or proximity sensor detected on Hero?

by mileoresko » Sun, 14 Feb 2010 00:09:42 GMT


 I used the ddms tool, and I am not sure what the Proximity Sensor app
uses.
As far as I can see it reads something from a file, then does some
character decoding and stuff like that, so I don't think it uses the
SensorManger API at all.

Nonetheless, I would like to use the SensorManager API to fetch data
from the Light Sensor. If that is not possible, I would like to know
why it isn't.
If there is an alternative way to access this sensor's readings, I
would appreciate if someone could share it with me.

Thanks






--



No light sensor and/or proximity sensor detected on Hero?

by Miecak » Tue, 23 Mar 2010 01:51:51 GMT


 I started fooling around with the sensors on my HTC Magic and I
noticed the same. The sensors you mentioned are the only ones I can
see while the phone specs mention a light sensor as well!

Would be great if somebody could shed some "light" on this issue ;)

Thanks!







--



Other Threads

1. EditText linkfy?

Hi all,
I put "<a href=\"http://www.google.com\">link to google</a> " in my
edittext, When I click "link to google", it works well. But I can't
edit my text. If I click other place of the text, the application
crushed. Why? How to correct this?

Thank you.
--~--~---------~--~----~------------~-------~--~----~

2. Themes - Is it possible to apply a style to a specific view ID (that multiple views share) from the Theme?

You can do this, but in the opposite direction.  Each of the TextViews
would request a specific "android:style", which you could then define
from the theme through attributes.  Here's an example where I started
doing something like this:

http://code.google.com/p/android-sky/source/browse/trunk/Sky/res/layout/widget_med.xml
http://code.google.com/p/android-sky/source/browse/trunk/Sky/res/values/styles.xml

I didn't write the one last level of indirection needed, which is
where you use attributes, like "?attr/textDay".  Then in the theme
definition you would directly point those attributes at the concrete
"@style/Text.Day" definitions.

To apply various themes in your code, just use ContextThemeWrapper to
wrap a specific theme you've defined.  (Use that wrapper class when
inflating view to make sure they inherit through the attributes
correctly.)

This is pretty complex, but hopefully it will be useful.  This type of
indirect inheritance is used across the platform, and in particular
it's how Theme.Light is implemented.

j







-- 
Jeff Sharkey
jshar...@android.com

--~--~---------~--~----~------------~-------~--~----~

3. Why does ProgressDialog launched from OnItemClick wait until a subsequent thread's "run" method returns to show itself

4. How to detect current screen is vertical or horizontal?

5. How to detect current screen is vertical or horizontal?

6. Threading with UI components

7. Connect laptop built-in gps receiver to emulator