RAD Studio provides you access to a variety of device sensors on Android and IOS in FireMonkey. There are six different demos which show how to easily access a number of these different sensors. The demos are Gyroscope, Accelerometer, AccessCameraApp/CameraComponent, Location, and OrientationSensor. These demos use the TOrientationSensor, TLocationSensor, TMotionSensor, TCameraComponent, and TTakePhotoFromCameraAction components.
The Gyroscope sample demonstrates how to use the Gyroscope in order to rotate a 3D cube when your device is tilted. This sample suports both iOS or Android devices. The sample uses the TOrientationSensor component and the TCustomOrientationSensor class to act like a gyroscope that rotates a 3D cube while you tilt your device.
The Accelerometer sample demonstrates how to use the accelerometer in iOS or Android applications. The sample uses TMotionSensor component and TCustomMotionSensor class to offer information about the acceleration, angle, state, and speed of the device motion.
The Location sample demonstrates how to use the location sensor of the device on iOS applications. The sample uses TLocationSensor to offer information about the GPS location of the device. Moreover, the sample displays the location of the device on Google Maps using TWebBrowser.
The AccessCameraApp sample shows how to use TTakePhotoFromCameraAction to open the camera application on your iOS or Android device, take a picture and retrieve the taken image to display it on your FireMonkey form. The TTakePhotoFromCameraAction component uses the native device dialog of capturing a photo. The TCameraComponent (a nonvisual component for a camera device) sample project shows how to manipulate the camera of a device, and how to set preset and custom quality capture settings for your camera. With this sample you can: Turn on and off the camera of your device. Select either the front facing camera or the back facing camera. Set different resolution configurations for your camera. Select whether to turn the flash on, off, or leave it in automatic mode.
The OrientationSensor sample demonstrates how to use the orientation sensor in iOS or Android applications. The sample uses the TOrientationSensor component and the TCustomOrientationSensor class to offer information about the rotation angle (tilt) and the compass heading relative to the magnetic north (heading).
Head over to check out the SensorInfo demo which displays the status of all the different sensors on your device.