The service dpr file is run when the host application uses s LocalServiceConnection to Start the Service or Bind to the Service for the first time. Ie nothing happens until the host application enters the run (Application.Run) stage and its auto create forms have been loaded via the delayed RealCreateForm.
The Service Data Module is created via TServiceApplication.CreateForm in the Service Library source (.so) file only after the main application connects to the service using TLocalServiceConnection.BindService or the class function StartService .
(TServiceApplication.Run; is a null procedure.)
In the main Application Form you establish the service connection and load the callbacks for OnConnect and OnDisconnect but at this time you have no connection with the Service Data Module.
OnConnect will fire when a successful connection is made via a bindservice call on the service connection. A pointer to the service DM returned on this call can be cast to an [unsafe] Service variable of the DM class and gives access to the data module object instance. Seems to requires a hard type cast (LocalDM:=TDNClassType(LocalService) but as the parameter passed is TAndroidBaseService an object I would have expected "AS" to work.
If direct interaction with the DM instance is not required forget about creating an instance of TLocalServiceConnection and simply use the class procedure
TLocalServiceConnection.StartService(const AServiceName) to start the service.