beanshell : sensor.bsh
import java.lang.Thread; source("/sdcard/com.googlecode.bshforandroid/extras/bsh/android.bsh"); a = Android(); a.call("startSensingTimed",1, 250); Thread.sleep(1000,250); s1 = a.call("readSensors").get("result"); s2 = a.call("sensorsReadAccelerometer").get("result"); s3 = a.call("sensorsReadMagnetometer").get("result"); s4 = a.call("sensorsGetLight").get("result"); s5 = a.call("sensorsGetAccuracy").get("result"); s6 = a.call("sensorsReadOrientation").get("result"); a.call("stopSensing"); print("s1="+s1); print("s2="+s2); print("s3="+s3); print("s4="+s4); print("s5="+s5); print("s6="+s6);