Skip to content

Commit 8ca1542

Browse files
committed
Improve Android setup steps
1 parent f9ac5c5 commit 8ca1542

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

help/INSTALL-ANDROID.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,21 @@ android {
1010
[...]
1111
defaultConfig {
1212
[...]
13+
minSdkVersion 23 // Required minimum SDK version
1314
multiDexEnabled true
1415
}
1516
}
1617
```
1718

1819
## Step 2
20+
In your `android/settings.gradle`, ensure you have the following Kotlin plugin configuration:
21+
```Gradle
22+
plugins {
23+
id "org.jetbrains.kotlin.android" version "1.9.0" apply false // Must be at least 1.9.0
24+
}
25+
```
26+
27+
## Step 3
1928
Then, add the following permissions to your `AndroidManifest.xml` within the `<manifest></manifest>` tags:
2029

2130
```xml
@@ -41,7 +50,7 @@ See more details on Android permissions [here](https://developer.android.com/ref
4150
android:turnScreenOn="true">
4251
```
4352

44-
## Step 3
53+
## Step 4
4554
Inside the <application> tag of your `AndroidManifest.xml`, add the following declarations (if you need notification-on-kill feature):
4655
```xml
4756
<application>
@@ -53,7 +62,7 @@ Inside the <application> tag of your `AndroidManifest.xml`, add the following de
5362

5463
Necessary if you want to enable an optional notification with `Alarm.setWarningNotificationOnKill` to alert users if the app is terminated, hinting at a rare chance the alarm may not work.
5564

56-
## Step 4
65+
## Step 5
5766
To guarantee that your alarm's foreground service can trigger when the app is in the background, it's recommanded to verify and request the necessary permission for scheduling exact alarms on Android 12+ devices. This step is particularly important due to varying device policies.
5867

5968
Leverage the [permission_handler](https://pub.dev/packages/permission_handler) package to check and request this permission seamlessly within your Flutter application. Here's an example to integrate into your code:
@@ -70,7 +79,7 @@ Future<void> checkAndroidScheduleExactAlarmPermission() async {
7079
}
7180
```
7281

73-
## Step 5
82+
## Step 6
7483
If you want to use the `androidFullScreenIntent` feature, some OEM (Samsung, Honor, Huawei, Xiaomi, Oppo, Asus, etc...) will require to grant the [auto_start_flutter](https://pub.dev/packages/auto_start_flutter) permission.
7584

7685
## Additional Resources

0 commit comments

Comments
 (0)