

In this case, the Application cannot start the service and it does not respond. IdUDPClient1.Send('I send from the timer') Procedure TNotificationServiceDM.Timer1Timer(Sender: TObject) The new code is: unit NotificationServiceUnit So I drop a timer to the "false" form, timer is active, and each 5 seconds sends a message to the server. Create a Delphi VCL Forms Application Drag and drop on the main form (Form1) a button (), a file open dialog (TOpenDialog), and an action list (TActionList). The problem arises when I want to use a timer to send repetitively a message to the server. This example shows how to use a TSendMail action to send an e-mail with a file attached. So I only added IdUDPClient1.Send('I am a service') NotificationCenter1.ScheduleNotification(MyNotification) MyNotification.FireDate := IncSecond(Now, 8) MyNotification.AlertBody := 'RAD Studio 10 Seattle' MyNotification.Title := 'Android Service Notification' MyNotification.Name := 'ServiceNotification'

MyNotification := NotificationCenter1.CreateNotification Procedure TNotificationServiceDM.LaunchNotification NotificationServiceDM: TNotificationServiceDM įunction TNotificationServiceDM.AndroidServiceStartCommand(const Sender: TObject const Intent: JIntent Flags, NotificationCenter1: TNotificationCenter įunction AndroidServiceStartCommand(const Sender: TObject const Intent: JIntent Flags, StartId: Integer): Integer TNotificationServiceDM = class(TAndroidService) This is the code and it works: unit NotificationServiceUnit Ī, System.Notification, IdBaseComponent, IdComponent,

I only need to drop the UDPclient on the form and I add one line of code. When the service starts I send a message to a server and it works fine. I am using as basis this example from embarcadero: (*) These versions did not have a CompilerVersion constant, it was introduced with Delphi 6.I am developing my first service and I am having troubles. In earlier Delphi versions various compiler defined VERxxx symbols are used to determine compiler versions.ĬompilerVersion values and the equivalent compiler defined symbols for the Delphi versions in which the CompilerVersion constant is defined are: The CompilerVersion constant was introduced in Delphi 6 along with conditional expressions.
