تماشای ویدئو Using proximity sensor in Sketchware از آی-ویدئو
This video shows how to use proximity sensor in Sketchware.
The code used in onCreate:
gyro.registerListener(_gyro_sensor_listener, gyro.getDefaultSensor(Sensor.TYPE_PROXIMITY), SensorManager.SENSOR_DELAY_GAME);