I successfully worked through the problem to auto-launch an app during last week at work, using Delphi Tokyo 10.2. I'm currently looking into starting the background service, instead of the app after boot-up as the splash-screen and application currently "pop-up" each time the device starts up. (I stumbled on your question while looking into how to start the service only, and I'll try a variation of the suggested "startService" Java approach this coming weekend. Having gone through the pain, I can alleviate yours.)
Basically for the newer compilers, you no longer need the steps in Danny Wind's article that modify the "Classes.dex" file. What I describe below works for Tokyo, and will probably work for Seattle if it works the same way, which I believe it does.
You cannot use the Delphi code to register the BroadcastReceiver. That has to be done in Java, with the compiled class being in a JAR. Danny Wind's Java package will continue to do exactly the trick, on condition that you include step 4 of your question in the manifest file and step 5 of your question in the project's Android permissions.
BTW, you should not be editing the "AndroidManifest.xml" file, but rather the "AndroidManifest.template.xml" file.
If you understand how to add the JAR for the background service, you follow the same approach to add the JAR containing your BroadcastReceiver for "BOOT_COMPLETED", by going to the "Libraries" folder under the "Android" target platform and right-mouse-clicking and choosing "Add". Instead of adding your background-service JAR (which should already be there), in this case you add your JAR containing the BroadcastReceiver.
In order to compile the Java into a class, and then include that in a JAR, I use the following batch-file, which is based on Danny Wind's article and the command that Delphi runs to compile the Java it generates for the background service (which you can see in the Output tab of the Messages window):
@ECHO OFF
rem Path to Android classes JAR-file
SET ANDROID_JAR="C:\Users\Public\Documents\Embarcadero\Studio\19.0\PlatformSDKs\android-sdk-windows\platforms\android-26\android.jar"
rem Setup parameters
SET SOURCE_FILE=%1
SET JAR_FILE=%2
IF x%2 == x SET JAR_FILE=%SOURCE_FILE%
SET CONFIGURATION=%3
IF x%3 == x SET CONFIGURATION=Debug
rem Ensure directory to hold Java Class files exists for Java Archive
MKDIR JavaClasses\%JAR_FILE% 2> NUL
rem Indicate actions
ECHO .
ECHO Compiling %SOURCE_FILE%.java to %SOURCE_FILE%.class and storing in %CONFIGURATION%\%JAR_FILE%.jar...
ECHO .
rem Compile Java Class file
"%JAVASDK%\javac" -Xlint:deprecation -classpath %ANDROID_JAR% -bootclasspath %ANDROID_JAR% -d JavaClasses\%JAR_FILE% -target 1.6 -g -source 1.6 %SOURCE_FILE%.java
rem Create Java Archive file containing class file
"%JAVASDK%\jar" cf %CONFIGURATION%\%JAR_FILE%.jar -C .\JavaClasses\%JAR_FILE% com
rem Clean-up
SET ANDROID_JAR=""
SET SOURCE_FILE=""
SET JAR_FILE=""
SET CONFIGURATION=""
The batch file takes 3 parameters:
- Name of Java file, minus any extension.
- Name of JAR file, minus any extension.
- Name of configuration (i.e. "Debug" or "Release")
If there is only one parameter, the JAR filename will have the same name as Java file and configuration will be set to "Debug".
If there are only two parameters, configuration will be set to "Debug".
Note, the batch-file doesn't do any error checking regarding parameters right now.
The batch file uses slightly different parameters when calling "javac" than that in Danny Wind's article. These I took from what the Delphi IDE uses (as seen in the Output tab).
You will need to change the line that sets environment variable "ANDROID_JAR" to have the correct path to your compiler's "android.jar" file.
You will also need to set an environment variable named "JAVASDK" to the path of your Java SDK's "bin" folder. On my machine that is "C:\Program Files\Java\jdk1.8.0_60\bin". This I have set via "System Properties / Advanced / Environment Variables".
After compilation and archiving, the JAR containing the BroadcastReceiver will be in the "Debug" or "Release" folder depending on which configuration you've opted for.
Having added the JAR containing the BroadcastReceiver to your project, the newer versions of Delphi will then automatically link the JAR file into "Classes.dex" and ultimately the APK for your app.
Deploy the APK to your device, run the app at least once, and then restart your device. You should see your app startup once the boot has completed.