Android.App.ServiceAttribute Class
Generates a /manifest/application/service element within AndroidManifest.xml.

See Also: ServiceAttribute Members

Syntax

[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=false, Inherited=false)]
public sealed class ServiceAttribute : Attribute

See Also

IntentFilterAttribute
MetaDataAttribute

Remarks

The //service element is used to declare a service, which are used to implement long-running background operations or a rich communicationsAPI that can be called by other applications. The Android.App.ServiceAttribute custom attribute is used by monodroid.exe when generating AndroidManifest.xml to to declaratively generate //service elements.

The type this attribute is placed on must be a (possibly indirect) subclass of Android.App.Service.

The following type declaration

C# Example

[Service (Name="mono.samples.HelloService", 
        Label="Service Label")]
class MyService : Service {
}

results in the following XML fragment:

XML Example

<service 
            android:label="Service Label" 
            android:name="mono.samples.HelloService" />

In addition, types using the Android.App.ServiceAttribute custom attribute can also use the Android.App.IntentFilterAttribute and Android.App.MetaDataAttribute custom attributes to declaratively generate the nested //service/intent-filter and //service/meta-data elements, respectively.

Requirements

Namespace: Android.App
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0