In Java Runtime 1.4
This API was first supported in S60 devices featuring Java Runtime 1.4 for S60. JRT 1.4 was first included in selected S60 3rd Edition, Feature Pack 2 and S60 5th Edition devices. From S60 5th Edition Feature Pack 1 onwards, all devices include support for Mobile Sensor API.
See Device specifications at Forum Nokia to verify Mobile Sensor API and Java Runtime support in your target device.