android服务导出属性?

android服务导出属性?,android,Android,我对安卓平台还很陌生。我想导出我的服务以供公开使用。 我在开发者文档上找到了一些东西 android:exported 其他应用程序的组件是否可以调用服务或与之交互—如果可以,则为“true”,如果不能,则为“false”。当该值为“false”时,只有相同应用程序或具有相同用户ID的应用程序的组件才能启动服务或绑定到服务 但我不明白 有人能给我举一个简单的例子说明如何使用它吗?你会发现示例应用程序SampleSyncAdapter、CubeLiveWallper和VoiceRecognitio

我对安卓平台还很陌生。我想导出我的服务以供公开使用。 我在开发者文档上找到了一些东西

android:exported
其他应用程序的组件是否可以调用服务或与之交互—如果可以,则为“true”,如果不能,则为“false”。当该值为“false”时,只有相同应用程序或具有相同用户ID的应用程序的组件才能启动服务或绑定到服务

但我不明白
有人能给我举一个简单的例子说明如何使用它吗?

你会发现示例应用程序SampleSyncAdapter、CubeLiveWallper和VoiceRecognitionService(第8级新增)都是供公众使用的导出服务。您可以查看sdk的示例/目录。Eclipse可以使用现有示例(从文件/new/Android项目对话框)创建一个新项目。

导出的目的是让其他应用程序可以访问服务

例如,\ android sdk windows\samples\android-8\SampleSyncAdapter\AndroidManifest.xml

    <service
        android:name=".authenticator.AuthenticationService"
        android:exported="true">
        <intent-filter>
            <action
                android:name="android.accounts.AccountAuthenticator" />
        </intent-filter>
        <meta-data
            android:name="android.accounts.AccountAuthenticator"
            android:resource="@xml/authenticator" />
    </service>
    <service
        android:name=".syncadapter.SyncService"
        android:exported="true">
        <intent-filter>
            <action
                android:name="android.content.SyncAdapter" />
        </intent-filter>
        <meta-data
            android:name="android.content.SyncAdapter"
            android:resource="@xml/syncadapter" />
        <meta-data
            android:name="android.provider.CONTACTS_STRUCTURE"
            android:resource="@xml/contacts" />
    </service>
  \android-sdk-windows\samples\android-8\SampleSyncAdapter\src\com\example\android\samplesync\client\NetworkUtilities.java (3 hits)
    Line 63:         "https://samplesyncadapter.appspot.com";
    Line 238:             // Succesfully connected to the samplesyncadapter server and
    Line 287:             // Succesfully connected to the samplesyncadapter server and