Get access to over 100 FireMonkey cross platform samples for Android, IOS, OSX, Windows, and Linux!

AndroidAppmethodCode SnippetDelphiDemoFiremonkey

Flash Light Source Code Demo In Delphi XE5 Firemonkey On Android

Delphi XE6 Firemonkey Android FlashlightDeveloper Lin Shou Shan (superlevin) from Taiwan has a simple demo project on using the Android flashlight feature in Delphi XE5 Firemonkey. The demo is up on Github and is really on a few lines of code. There are a few different ways people have figured out how to turn their phones into a flashlight and this demo makes use of the flash (also known as torch) functionality of the Android device. The TCameraComponent that ships with Delphi XE5 has a property called HasFlash which tells you whether the torch device is available. If it is available you can use code like this to turn on the flash: CameraComponent1.TorchMode := TTorchMode.tmModeOn;. This code should probably also work in Delphi XE6 and AppMethod. I believe you also need to add the Android permission: android.permission.FLASHLIGHT. You can also check out a question and answer pair on StackOverflow to see the actual Java code that does flashlight code.

Head over and download the full source code for the Android flash light demo for Delphi XE5 Firemonkey.

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Related posts
AndroidC++BuilderCode SnippetDelphiDemoFiremonkeyIOSOSXShowcaseWindows

Powerful Cross Platform Email App Sample In Delphi 10.4.1 FireMonkey For Android And IOS


Significant Update Available For Delphi FireMonkey 10.4.1 On Android, IOS, OSX, Windows, And Linux


Professional SVG Icon Image List For Delphi 10.4 FireMonkey On Windows


Top Tips And Tricks To Speed Up Development With Delphi 10.4 FireMonkey On Android and IOS

Sign up for our Newsletter and
stay informed

Leave a Reply