''@N:GetSensors As returnvalue
''Return a string containing details of all the sensor types available to the program.
''Within the string the details for each sensor are enclosed by braces, {}, and terminated by a CRLF character.
''Within the braces are values for the sensor: Sensor name, vendor, version, type, maxRange, resolution, power and minDelay.
''These values are presented as comma separated declarations of the form: Sensor name="Some sensor", ...,type=1,...
''Type is the integer value of the Sensor constant used to identify the sensor when invoking AddSensor.
Sub GetSensors As String
Dim NativeMe As JavaObject
NativeMe.InitializeContext
Dim returnlist As List
returnlist = NativeMe.RunMethod("getSensorList",Null)
Dim sensors As String = ""
For i = 0 To returnlist.Size - 1
sensors = sensors & returnlist.Get(i) & CRLF
Next
Return sensors.SubString2(0, sensors.Length - 1)
End Sub
#If Java
import java.util.List;
import android.hardware.Sensor;
import android.hardware.SensorManager;
SensorManager sMgr;
public List getSensorList() {
sMgr = (SensorManager) getSystemService(SENSOR_SERVICE);
List<Sensor> list = sMgr.getSensorList(Sensor.TYPE_ALL);
return list;
}
#End If