mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-15 13:26:28 +00:00
Add android strict mode documentation (#2719)
This commit is contained in:
parent
8de9ba5404
commit
26070fb788
@ -24,6 +24,7 @@ Are you ready to make a difference in the world of smart home technology? The **
|
||||
|
||||
We welcome contributions of all kinds! Here are some ways you can get involved:
|
||||
|
||||
- **Join the [beta](https://play.google.com/apps/testing/io.homeassistant.companion.android)**: Help us catch issues before they reach production.
|
||||
- **Code contributions**: Fix bugs, add features, or improve performance.
|
||||
- **Code reviews**: Help others by reviewing their work and providing constructive feedback.
|
||||
- **Documentation**: Keep our guides clear, concise, and up-to-date.
|
||||
|
20
docs/android/tips/strict_mode.md
Normal file
20
docs/android/tips/strict_mode.md
Normal file
@ -0,0 +1,20 @@
|
||||
---
|
||||
title: "StrictMode"
|
||||
sidebar_label: "StrictMode"
|
||||
---
|
||||
|
||||
## StrictMode in debug builds
|
||||
|
||||
StrictMode is enabled by default when you run the app in debug mode on Android. StrictMode helps you identify accidental disk or network access on the main thread, as well as other potential issues during development. For more information, see the [StrictMode documentation](https://developer.android.com/reference/android/os/StrictMode).
|
||||
|
||||
StrictMode also helps us migrate to new versions of the Android API by highlighting deprecated or problematic behaviors early in development.
|
||||
|
||||
The [VM policy](https://developer.android.com/reference/android/os/StrictMode.VmPolicy.Builder) is configured with the `death` penalty, and the [threading policy](https://developer.android.com/reference/android/os/StrictMode.ThreadPolicy.Builder) is set to `log`. Review the logs carefully while developing to spot and address any issues.
|
||||
|
||||
If you encounter a problem caused by StrictMode during development, you can temporarily disable it by setting the `noStrictMode` Gradle flag:
|
||||
|
||||
```bash
|
||||
./gradlew app:assembleFullDebug -PnoStrictMode
|
||||
```
|
||||
|
||||
If you need to disable StrictMode, open an issue on GitHub or reach out on Discord. This helps ensure the problem is tracked and does not impact other developers.
|
@ -351,6 +351,7 @@ module.exports = {
|
||||
"android/tips/sarif_reports",
|
||||
"android/tips/release",
|
||||
"android/tips/dev_playground",
|
||||
"android/tips/strict_mode",
|
||||
],
|
||||
},
|
||||
"android/best_practices",
|
||||
|
Loading…
x
Reference in New Issue
Block a user