Show: Delphi C++
Display Preferences

Android Service

From RAD Studio
Jump to: navigation, search

Go Up to File Menu


File > New > Other > Delphi Projects > Android Service

Creates the framework to develop Android Services.

The New Android Service wizard presents the following options:

Item Description

Local Service

Select this option to create a local service. This is the most typical situation where the Android application interacts directly with the Android service, both running on the same process.

This option includes a Data Module with the TAndroidService class from the System.Android.Service unit, with the necessary events.

Selecting this option includes the following line on the Android Manifest file of the Android application linked to the Android service.

<service android:exported="false" android:name="com.embarcadero.services.<service_name>" />

For more information about local services, see Local Service Sample.

Intent Local Service

Select this option to create a local service using intents. Use intents to handle asynchronous requests on demand.

This option includes a Data Module with the TAndroidIntentService class from the System.Android.Service unit, with the necessary events.

Selecting this option includes the following line on the Android Manifest file of the Android application linked to the Android service.

<service android:exported="false" android:name="com.embarcadero.services.<service_name>" />

For more information about intent services, see IntentService.

Remote Service

Select this option to create a remote service. A remote service can be used by other applications apart from the one that hosts the service.

This option includes a data module with the TAndroidService class from the System.Android.Service unit, with the necessary events.

Selecting this option includes the following line on the Android Manifest file of the Android application linked to the Android service.

<service android:exported="true" android:name="com.embarcadero.services.<service_name>" />

For more information about remote services, see Remote Service Sample.

Intent Remote Service

Select this option to create a remote service using intents. Use intents to handle asynchronous requests on demand.

This option includes a data module with the TAndroidIntentService class from the System.Android.Service unit, with the necessary events.

Selecting this option includes the following line on the Android Manifest file of the Android application linked to the Android service.

<service android:exported="true" android:name="com.embarcadero.services.<service_name>" />

After you select an option from the wizard, and click OK, the Form Designer displays the Delphi project file (*.dpr) file. The project includes a data module to place the visual components and define the methods that you want the Android service shares with the Android application.

For more information on how to link an application with a service, see Creating Android Services.

Uses

The <unit_name>.pas file includes the following units:

  System.SysUtils,
  System.Classes,
  System.Android.Service,
  AndroidApi.JNI.GraphicsContentViewText,
  Androidapi.JNI.Os;

The <project_name>.dpr file includes:

  System.Android.ServiceApplication;
  <Unit_name>;

See Also

Personal tools
In other languages
Previous Versions
Assistance