Skip to content

Commit 6ec39b3

Browse files
committed
🚧 Manifest template for android run and maintain foreground services with lock
1 parent c8ae12a commit 6ec39b3

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed

samples/android/AndroidManifest.xml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- BEGIN_INCLUDE(manifest) -->
3+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
4+
xmlns:tools="http://schemas.android.com/tools"
5+
package="com.embarcadero.NtfyAndroid"
6+
android:versionCode="1"
7+
android:versionName="1.0.0"
8+
android:installLocation="auto">
9+
<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="34" />
10+
<uses-permission android:name="android.permission.INTERNET"/>
11+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/> <!-- For instant delivery foregrounds service -->
12+
<uses-permission android:name="android.permission.WAKE_LOCK"/> <!-- To keep foreground service awake; soon not needed anymore -->
13+
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> <!-- To restart service on reboot -->
14+
<uses-permission android:name="android.permission.VIBRATE"/> <!-- Incoming notifications should be able to vibrate the phone -->
15+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28"/> <!-- Only required on SDK <= 28 -->
16+
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/> <!-- To reschedule the websocket retry -->
17+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/> <!-- As of Android 13, we need to ask for permission to post notifications -->
18+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC"/>
19+
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
20+
<queries>
21+
22+
</queries>
23+
<application
24+
android:persistent="False"
25+
android:restoreAnyVersion="False"
26+
android:label="NtfyAndroid"
27+
android:debuggable="true"
28+
android:largeHeap="False"
29+
android:icon="@drawable/ic_launcher"
30+
android:theme="@style/AppTheme"
31+
android:hardwareAccelerated="true"
32+
android:resizeableActivity="true"
33+
android:requestLegacyExternalStorage="true">
34+
35+
36+
37+
<!-- Trigger Google Play services to install the backported photo picker module. -->
38+
<service
39+
android:name="com.google.android.gms.metadata.ModuleDependencies"
40+
android:enabled="false"
41+
android:exported="false"
42+
tools:ignore="MissingClass">
43+
<intent-filter>
44+
<action android:name="com.google.android.gms.metadata.MODULE_DEPENDENCIES" />
45+
</intent-filter>
46+
47+
<meta-data android:name="photopicker_activity:0:required" android:value="" />
48+
</service>
49+
50+
<service
51+
android:name="com.embarcadero.services.NtfyServiceLocal"
52+
android:exported="false"
53+
android:process=":NtfyServiceLocal"
54+
android:foregroundServiceType="dataSync">
55+
</service>
56+
57+
<!-- Our activity is a subclass of the built-in NativeActivity framework class.
58+
This will take care of integrating with our NDK code. -->
59+
<activity
60+
android:name="com.embarcadero.firemonkey.FMXNativeActivity"
61+
android:exported="true"
62+
android:label="NtfyAndroid"
63+
android:configChanges="orientation|keyboard|keyboardHidden|screenSize|screenLayout|uiMode"
64+
android:launchMode="singleTask">
65+
<!-- Tell NativeActivity the name of our .so -->
66+
<meta-data android:name="android.app.lib_name" android:value="NtfyAndroid" />
67+
68+
<intent-filter>
69+
<action android:name="android.intent.action.MAIN" />
70+
71+
<category android:name="android.intent.category.LAUNCHER" />
72+
</intent-filter>
73+
</activity>
74+
75+
<receiver android:name="com.embarcadero.rtl.notifications.NotificationAlarm" />
76+
77+
</application>
78+
</manifest>
79+
<!-- END_INCLUDE(manifest) -->

0 commit comments

Comments
 (0)