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
DelphiDemoFiremonkeyIOSLinuxOSXWindows

Bring OpenAI Agents, Vision, Audio, And Realtime AI To Firemonkey

DelphiIDEWindows

Add AI Pair Programming, Refactoring, And Multi-LLM Workflows To RAD Studio

DelphiDemoFiremonkeyLibraryWindows

Bring OpenAI, Local LLMs, And AI Assistants To FMX Apps

DelphiFiremonkeyLibrary

DelphiGemini Brings Native Google Gemini AI Integration To Delphi

Sign up for our Newsletter and
stay informed
[mailpoet_form id="1"]

Leave a Reply