xref: /aosp_15_r20/development/samples/browseable/BasicSyncAdapter/AndroidManifest.xml (revision 90c8c64db3049935a07c6143d7fd006e26f8ecca)
1*90c8c64dSAndroid Build Coastguard Worker<?xml version="1.0" encoding="UTF-8"?>
2*90c8c64dSAndroid Build Coastguard Worker<!--
3*90c8c64dSAndroid Build Coastguard Worker Copyright 2013 The Android Open Source Project
4*90c8c64dSAndroid Build Coastguard Worker
5*90c8c64dSAndroid Build Coastguard Worker Licensed under the Apache License, Version 2.0 (the "License");
6*90c8c64dSAndroid Build Coastguard Worker you may not use this file except in compliance with the License.
7*90c8c64dSAndroid Build Coastguard Worker You may obtain a copy of the License at
8*90c8c64dSAndroid Build Coastguard Worker
9*90c8c64dSAndroid Build Coastguard Worker     http://www.apache.org/licenses/LICENSE-2.0
10*90c8c64dSAndroid Build Coastguard Worker
11*90c8c64dSAndroid Build Coastguard Worker Unless required by applicable law or agreed to in writing, software
12*90c8c64dSAndroid Build Coastguard Worker distributed under the License is distributed on an "AS IS" BASIS,
13*90c8c64dSAndroid Build Coastguard Worker WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14*90c8c64dSAndroid Build Coastguard Worker See the License for the specific language governing permissions and
15*90c8c64dSAndroid Build Coastguard Worker limitations under the License.
16*90c8c64dSAndroid Build Coastguard Worker-->
17*90c8c64dSAndroid Build Coastguard Worker
18*90c8c64dSAndroid Build Coastguard Worker
19*90c8c64dSAndroid Build Coastguard Worker
20*90c8c64dSAndroid Build Coastguard Worker<manifest xmlns:android="http://schemas.android.com/apk/res/android"
21*90c8c64dSAndroid Build Coastguard Worker    package="com.example.android.basicsyncadapter"
22*90c8c64dSAndroid Build Coastguard Worker    android:versionCode="1"
23*90c8c64dSAndroid Build Coastguard Worker    android:versionName="1.0">
24*90c8c64dSAndroid Build Coastguard Worker
25*90c8c64dSAndroid Build Coastguard Worker    <!-- SyncAdapters are available in API 5 and above. We use API 7 as a baseline for samples. -->
26*90c8c64dSAndroid Build Coastguard Worker    <!-- Min/target SDK versions (<uses-sdk>) managed by build.gradle -->
27*90c8c64dSAndroid Build Coastguard Worker
28*90c8c64dSAndroid Build Coastguard Worker    <!-- Required for fetching feed data. -->
29*90c8c64dSAndroid Build Coastguard Worker    <uses-permission android:name="android.permission.INTERNET"/>
30*90c8c64dSAndroid Build Coastguard Worker    <!-- Required to register a SyncStatusObserver to display a "syncing..." progress indicator. -->
31*90c8c64dSAndroid Build Coastguard Worker    <uses-permission android:name="android.permission.READ_SYNC_STATS"/>
32*90c8c64dSAndroid Build Coastguard Worker    <!-- Required to enable our SyncAdapter after it's created. -->
33*90c8c64dSAndroid Build Coastguard Worker    <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS"/>
34*90c8c64dSAndroid Build Coastguard Worker    <!-- Required because we're manually creating a new account. -->
35*90c8c64dSAndroid Build Coastguard Worker    <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"/>
36*90c8c64dSAndroid Build Coastguard Worker
37*90c8c64dSAndroid Build Coastguard Worker
38*90c8c64dSAndroid Build Coastguard Worker    <application
39*90c8c64dSAndroid Build Coastguard Worker        android:allowBackup="true"
40*90c8c64dSAndroid Build Coastguard Worker        android:icon="@drawable/ic_launcher"
41*90c8c64dSAndroid Build Coastguard Worker        android:label="@string/app_name"
42*90c8c64dSAndroid Build Coastguard Worker        android:theme="@style/AppTheme" >
43*90c8c64dSAndroid Build Coastguard Worker
44*90c8c64dSAndroid Build Coastguard Worker        <!-- Main activity, responsible for showing a list of feed entries. -->
45*90c8c64dSAndroid Build Coastguard Worker        <activity
46*90c8c64dSAndroid Build Coastguard Worker            android:name=".EntryListActivity"
47*90c8c64dSAndroid Build Coastguard Worker            android:label="@string/app_name" >
48*90c8c64dSAndroid Build Coastguard Worker            <!-- This intent filter places this activity in the system's app launcher. -->
49*90c8c64dSAndroid Build Coastguard Worker            <intent-filter>
50*90c8c64dSAndroid Build Coastguard Worker                <action android:name="android.intent.action.MAIN" />
51*90c8c64dSAndroid Build Coastguard Worker                <category android:name="android.intent.category.LAUNCHER" />
52*90c8c64dSAndroid Build Coastguard Worker            </intent-filter>
53*90c8c64dSAndroid Build Coastguard Worker        </activity>
54*90c8c64dSAndroid Build Coastguard Worker
55*90c8c64dSAndroid Build Coastguard Worker        <!-- ContentProvider to store feed data.
56*90c8c64dSAndroid Build Coastguard Worker
57*90c8c64dSAndroid Build Coastguard Worker        The "authorities" here are defined as part of a ContentProvider interface. It's used here
58*90c8c64dSAndroid Build Coastguard Worker        as an attachment point for the SyncAdapter. See res/xml/syncadapter.xml and
59*90c8c64dSAndroid Build Coastguard Worker        SyncService.java.
60*90c8c64dSAndroid Build Coastguard Worker
61*90c8c64dSAndroid Build Coastguard Worker        Since this ContentProvider is not exported, it will not be accessible outside of this app's
62*90c8c64dSAndroid Build Coastguard Worker        package. -->
63*90c8c64dSAndroid Build Coastguard Worker        <provider
64*90c8c64dSAndroid Build Coastguard Worker            android:name=".provider.FeedProvider"
65*90c8c64dSAndroid Build Coastguard Worker            android:authorities="com.example.android.basicsyncadapter"
66*90c8c64dSAndroid Build Coastguard Worker            android:exported="false" />
67*90c8c64dSAndroid Build Coastguard Worker
68*90c8c64dSAndroid Build Coastguard Worker        <!-- This service implements our SyncAdapter. It needs to be exported, so that the system
69*90c8c64dSAndroid Build Coastguard Worker        sync framework can access it. -->
70*90c8c64dSAndroid Build Coastguard Worker        <service android:name=".SyncService"
71*90c8c64dSAndroid Build Coastguard Worker            android:exported="true">
72*90c8c64dSAndroid Build Coastguard Worker            <!-- This intent filter is required. It allows the system to launch our sync service
73*90c8c64dSAndroid Build Coastguard Worker            as needed. -->
74*90c8c64dSAndroid Build Coastguard Worker            <intent-filter>
75*90c8c64dSAndroid Build Coastguard Worker                <action android:name="android.content.SyncAdapter" />
76*90c8c64dSAndroid Build Coastguard Worker            </intent-filter>
77*90c8c64dSAndroid Build Coastguard Worker            <!-- This points to a required XML file which describes our SyncAdapter. -->
78*90c8c64dSAndroid Build Coastguard Worker            <meta-data android:name="android.content.SyncAdapter"
79*90c8c64dSAndroid Build Coastguard Worker                android:resource="@xml/syncadapter" />
80*90c8c64dSAndroid Build Coastguard Worker        </service>
81*90c8c64dSAndroid Build Coastguard Worker
82*90c8c64dSAndroid Build Coastguard Worker        <!-- This implements the account we'll use as an attachment point for our SyncAdapter. Since
83*90c8c64dSAndroid Build Coastguard Worker        our SyncAdapter doesn't need to authenticate the current user (it just fetches a public RSS
84*90c8c64dSAndroid Build Coastguard Worker        feed), this account's implementation is largely empty.
85*90c8c64dSAndroid Build Coastguard Worker
86*90c8c64dSAndroid Build Coastguard Worker        It's also possible to attach a SyncAdapter to an existing account provided by another
87*90c8c64dSAndroid Build Coastguard Worker        package. In that case, this element could be omitted here. -->
88*90c8c64dSAndroid Build Coastguard Worker        <service android:name="com.example.android.common.accounts.GenericAccountService">
89*90c8c64dSAndroid Build Coastguard Worker            <!-- Required filter used by the system to launch our account service. -->
90*90c8c64dSAndroid Build Coastguard Worker            <intent-filter>
91*90c8c64dSAndroid Build Coastguard Worker                <action android:name="android.accounts.AccountAuthenticator" />
92*90c8c64dSAndroid Build Coastguard Worker            </intent-filter>
93*90c8c64dSAndroid Build Coastguard Worker            <!-- This points to an XMLf ile which describes our account service. -->
94*90c8c64dSAndroid Build Coastguard Worker            <meta-data android:name="android.accounts.AccountAuthenticator"
95*90c8c64dSAndroid Build Coastguard Worker                android:resource="@xml/authenticator" />
96*90c8c64dSAndroid Build Coastguard Worker        </service>
97*90c8c64dSAndroid Build Coastguard Worker
98*90c8c64dSAndroid Build Coastguard Worker    </application>
99*90c8c64dSAndroid Build Coastguard Worker
100*90c8c64dSAndroid Build Coastguard Worker</manifest>
101