Skip to content

Most visited

Recently visited

navigation
AlwaysOn /

AndroidManifest.xml

1
<?xml version="1.0" encoding="utf-8"?>
2
<!-- Copyright (C) 2015 The Android Open Source Project
3
 
4
     Licensed under the Apache License, Version 2.0 (the "License");
5
     you may not use this file except in compliance with the License.
6
     You may obtain a copy of the License at
7
 
8
          http://www.apache.org/licenses/LICENSE-2.0
9
 
10
     Unless required by applicable law or agreed to in writing, software
11
     distributed under the License is distributed on an "AS IS" BASIS,
12
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
     See the License for the specific language governing permissions and
14
     limitations under the License.
15
-->
16
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
17
          package="com.example.android.wearable.wear.alwayson">
18
 
19
    <uses-sdk android:minSdkVersion="20" android:targetSdkVersion="22" />
20
 
21
    <uses-permission android:name="android.permission.WAKE_LOCK" />
22
    <uses-permission android:name="com.android.alarm.permission.SET_ALARM"/>
23
 
24
    <uses-feature android:name="android.hardware.type.watch" />
25
 
26
    <application
27
        android:allowBackup="false"
28
        android:label="@string/app_name"
29
        android:theme="@android:style/Theme.DeviceDefault">
30
 
31
        <meta-data
32
            android:name="com.google.android.wearable.standalone"
33
            android:value="true" />
34
 
35
        <!--If you want your app to run on pre-22, then set required to false -->
36
        <uses-library android:name="com.google.android.wearable" android:required="false" />
37
 
38
        <!--
39
            To update the screen more than once per minute in ambient mode, developers should set
40
            the launch mode for the activity to single instance. Otherwise, the AlarmManager launch
41
            intent will open a new activity every time the Alarm is triggered rather than reusing
42
            the same (already active) Activity.
43
        -->
44
        <activity android:name="com.example.android.wearable.wear.alwayson.MainActivity"
45
            android:label="@string/app_name"
46
            android:launchMode="singleInstance"
47
            android:configChanges="orientation|keyboardHidden"
48
            android:exported="true">
49
            <intent-filter>
50
                <action android:name="android.intent.action.MAIN" />
51
                <category android:name="android.intent.category.LAUNCHER" />
52
            </intent-filter>
53
        </activity>
54
 
55
    </application>
56
</manifest>
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)