RAD Studio 10.4.1 is now available! Learn more. Looking for discounts? Visit our Special Offers page!
C++

Top Five Android And IOS Device Sensors You Can Easily Access From FireMonkey

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.

 



Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Learn More About Upgrading

About author

FMXExpress.com has over 600 articles with all kinds of tips and tricks for Delphi FireMonkey on Android, IOS, OSX, Windows, and Linux.
Related posts
C++CodeIDERAD Studio

C++ Builder 10.4.x Platform APIs

News

Using C++17 Algorithms Library Parallel Sorting with C++Builder 10.4 Sydney for Win32 and Win64

C++News

C++Builder and Platforms Support

C++

What's New in the GetIt Package Manager - June 2020

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

IN THE ARTICLES