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

AndroidAppmethodCode SnippetDelphiFiremonkey

Autorun A Delphi XE5 Firemonkey Android Application At Startup

Auto-Start At Boot Delphi AndroidWith the DOS operating system (OS), you could start an application on system start-up by adding the application to the autoexec.bat file. With the Windows OS, you could add it to the run key in the Windows registry. How do you get an Android application to automatically run when the device boots up? It can be done by creating a broadcast receiver that listens to the BOOT_COMPLETED broadcast intent. The steps necessary to create such a broadcast receiver with Delphi XE5 include:

  • create a new Delphi XE5 Android project
  • set uses permissions to receive boot completed
  • modify AndroidManifest.template.xml to let the Android system know you have a broadcast receiver
  • write some Java code
  • add it to the classes.dex
  • use this new classes.dex in your project
  • run the app on device

Click here to read the article, find out more about each of these steps, and get access to the source code link

NOTE: Be sure to read the tips section as there are some important bits of information that are a must read to ensure your Android application will run when your Android device starts up.

close

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

Related posts
AndroidC++BuilderDelphiFiremonkeyIOSOSXWindows

FireMonkey 10.4.2 Features Updated iOS 14, Android 11, And macOS 11 Support Plus Hundreds Of Fixes

DelphiIDEShowcaseWindows

Ryzen 9 5950x: One Billion Lines Of Delphi Code Compiled In ~5 Minutes On 16 Cores

DelphiFiremonkeyIDEIOSOSXWindows

DelphiCon 2020 FireMonkey Sessions Available Starting November 19

AndroidC++BuilderDelphiDemoFiremonkeyWindows

Powerful Commercial Gorilla3D Framework Upgraded For Delphi FireMonkey On Windows And Android

Sign up for our Newsletter and
stay informed

19 Comments

Leave a Reply to Albert Cancel reply