Android Question Sensors not recognized

mero

New Member
Licensed User
Longtime User
I've tested erel's demo for sensors on a low cost device (inno smartlet2) to test why my app that use TYPE_ORIENTATION and TYPE_LINEAR_ACCELERATION doesnt work on this device.

I've changes a little the utility in this way, just to be sure to test all the official sensors range:
AddSensor(1, "ACCELEROMETER", True)
AddSensor(2, "MAGNETIC_FIELD", True)
AddSensor(3, "ORIENTATION", True)
AddSensor(4, "GYROSCOPE", True)
AddSensor(5, "LIGHT", False)
AddSensor(6, "PRESSURE", False)
AddSensor(7, "TEMPERATURE", False)
AddSensor(8, "PROXIMITY", False)
AddSensor(9, "GRAVITY", False)
AddSensor(10, "LINEAR_ACCELERATION", False)
AddSensor(11, "ROTATION_VECTOR", False)
AddSensor(12, "RELATIVE_HUMIDITY", False)
AddSensor(13, "AMBIENT_TEMPERATURE", False)
AddSensor(14, "MAGNETIC_FIELD_UNCALIBRATED", False)
AddSensor(15, "GAME_ROTATION_VECTOR", False)
AddSensor(16, "GYROSCOPE_UNCALIBRATED", False)
AddSensor(17, "SIGNIFICANT_MOTION", False)
AddSensor(18, "STEP_DETECTOR", False)
AddSensor(19, "STEP_COUNTER", False)
AddSensor(20, "GEOMAGNETIC_ROTATION_VECTOR", False)

the results:
only TYPE_ACCELEROMETER work properly!
Ok is a low cost device...

After a short debug I discover that the following sensor doesnt give the "not present" message like other sensos, and are querable: for example they give the maximum value with ps.MaxValue but no value on sensor_changed.

2,MAGNETIC_FIELD
3,ORIENTATION
4,GYROSCOPE
9,GRAVITY
10,LINEAR_ACCELERATION
11,ROTATION_VECTOR

cannot understand if the sensor doesnt exist or I made some mistake (this is the erel software...so not possible :) )
reading in the forum I've tried to change the phone.jar without success.

Two question for this issue:
1-are there a way to test if these sensors are really not present or not working?
2-if LINEAR_ACCELERATION doesnt exist I can use ACCELEROMETER, it's more or less the same. But for the (deprecated) ORIENTATION sensor are there a different way to have the device orientation?

Lot of games that use tilt work perfectly with this device, so I'm convinced there is something wrong in my software.

I use v3.00 for B4A and android is the 4.2.1
are there something I can do to better understand this strange feedback on orientation sensor?
 
Top