An Android service is a non-UI application that performs tasks in the background.
There are essentially two types of service:
-
Start service: This service is started by an Android application. The service may run in the background indefinitely, even if the application is closed.
-
Bind service: This service only works while it is connected to an Android application. More than one application can connect to the same service.
Let's create an Android Service by performing the following steps:
-
Create a new Delphi project by going to File | New| Delphi. Notice that we have the Android Service option, as follows:
-
Select this option. Then, we need to define the service option that we want to create; in our case, we will choose Local Service:
-
After this process, the project will be loaded into the IDE; in Project Manager (Ctrl + Alt + F11...