Overview
| Correctness | |
| 1 | warning OldTargetApi: Target SDK attribute is not targeting latest version |
| 5 | warning GradleDependency: Obsolete Gradle Dependency |
| Performance | |
| 4 | warning ObsoleteSdkInt: Obsolete SDK_INT Version Check |
| 1 | warning UnusedResources: Unused resources |
| Internationalization | |
| 1 | warning SetTextI18n: TextView Internationalization |
| 5 | warning HardcodedText: Hardcoded text |
| Included Additional Checks (29) | |
| Disabled Checks (39) |
Target SDK attribute is not targeting latest version
../../build.gradle.kts:13:
10 defaultConfig { 11 applicationId = "de.duffy.screencast" 12 minSdk = 24 13 targetSdk = 35 14 versionCode = 3 15 versionName = "1.2" 16 }
OldTargetApi
Correctness
Warning
Priority 6/10
Obsolete Gradle Dependency
../../build.gradle.kts:49:
46 47 dependencies { 48 testImplementation("junit:junit:4.13.2") 49 implementation("androidx.core:core-ktx:1.13.1") 50 implementation("androidx.appcompat:appcompat:1.7.0") 51 implementation("com.google.android.material:material:1.12.0") 52 implementation("androidx.constraintlayout:constraintlayout:2.1.4")../../build.gradle.kts:50:
47 dependencies { 48 testImplementation("junit:junit:4.13.2") 49 implementation("androidx.core:core-ktx:1.13.1") 50 implementation("androidx.appcompat:appcompat:1.7.0") 51 implementation("com.google.android.material:material:1.12.0") 52 implementation("androidx.constraintlayout:constraintlayout:2.1.4") 53 implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7")../../build.gradle.kts:51:
48 testImplementation("junit:junit:4.13.2") 49 implementation("androidx.core:core-ktx:1.13.1") 50 implementation("androidx.appcompat:appcompat:1.7.0") 51 implementation("com.google.android.material:material:1.12.0") 52 implementation("androidx.constraintlayout:constraintlayout:2.1.4") 53 implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7") 54 }../../build.gradle.kts:52:
49 implementation("androidx.core:core-ktx:1.13.1") 50 implementation("androidx.appcompat:appcompat:1.7.0") 51 implementation("com.google.android.material:material:1.12.0") 52 implementation("androidx.constraintlayout:constraintlayout:2.1.4") 53 implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7") 54 }../../build.gradle.kts:53:
50 implementation("androidx.appcompat:appcompat:1.7.0") 51 implementation("com.google.android.material:material:1.12.0") 52 implementation("androidx.constraintlayout:constraintlayout:2.1.4") 53 implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7") 54 }
GradleDependency
Correctness
Warning
Priority 4/10
Obsolete SDK_INT Version Check
../../src/main/java/de/duffy/screencast/CastService.kt:255:
252 CastState.running.postValue(false) 253 CastState.viewers.postValue(0) 254 CastState.url.postValue("") 255 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { 256 stopForeground(STOP_FOREGROUND_REMOVE) 257 } else { 258 @Suppress("DEPRECATION") stopForeground(true)../../src/main/java/de/duffy/screencast/NetworkUtil.kt:20:
17 } 18 19 private fun fromConnectivityManager(context: Context): String? { 20 if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) return null 21 return try { 22 val cm = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager 23 val network = cm.activeNetwork ?: return null../../src/main/java/de/duffy/screencast/NetworkUtil.kt:47:
44 /** Ist ueberhaupt ein WLAN aktiv? Ohne WLAN nuetzt der Stream wenig. */ 45 fun isOnWifi(context: Context): Boolean = try { 46 val cm = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager 47 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 48 val caps = cm.getNetworkCapabilities(cm.activeNetwork ?: return false) ?: return false 49 caps.hasTransport(android.net.NetworkCapabilities.TRANSPORT_WIFI) || 50 caps.hasTransport(android.net.NetworkCapabilities.TRANSPORT_ETHERNET)../../src/main/java/de/duffy/screencast/ScreenEncoder.kt:72:
69 } 70 // Standbild trotzdem weitersenden, sonst laeuft der Puffer im Player leer. 71 setLong(MediaFormat.KEY_REPEAT_PREVIOUS_FRAME_AFTER, 250_000L) 72 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 73 setInteger(MediaFormat.KEY_PRIORITY, 0) // Echtzeit 74 } 75 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
ObsoleteSdkInt
Performance
Warning
Priority 6/10
Unused resources
../../src/main/res/values/strings.xml:26:
23 <string name="disconnect">Verbindung trennen</string> 24 <string name="protocol">Protokoll</string> 25 <string name="connect_direct">Zum Fernseher verbinden</string> 26 <string name="connect_browser">Über Browser-Adresse</string> 27 28 <plurals name="viewers"> 29 <item quantity="one">%d Gerät schaut zu</item>
UnusedResources
Performance
Warning
Priority 3/10
TextView Internationalization
../../src/main/java/de/duffy/screencast/DeviceActivity.kt:179:
176 177 private fun addDevice(title: String, subtitle: String, enabled: Boolean, onClick: () -> Unit) { 178 val button = MaterialButton(this, null, com.google.android.material.R.attr.materialButtonOutlinedStyle) 179 button.text = "$title\n$subtitle" 180 button.isAllCaps = false 181 button.isEnabled = enabled 182 button.setPadding(40, 30, 40, 30)
SetTextI18n
Internationalization
Warning
Priority 6/10
Hardcoded text
../../src/main/res/layout/activity_main.xml:175:
172 style="@style/Widget.Material3.Chip.Filter" 173 android:layout_width="wrap_content" 174 android:layout_height="wrap_content" 175 android:text="Sparsam" /> 176 177 <com.google.android.material.chip.Chip 178 android:id="@+id/chip_hd"../../src/main/res/layout/activity_main.xml:183:
180 android:layout_width="wrap_content" 181 android:layout_height="wrap_content" 182 android:checked="true" 183 android:text="Ausgewogen" /> 184 185 <com.google.android.material.chip.Chip 186 android:id="@+id/chip_fhd"../../src/main/res/layout/activity_main.xml:190:
187 style="@style/Widget.Material3.Chip.Filter" 188 android:layout_width="wrap_content" 189 android:layout_height="wrap_content" 190 android:text="Scharf" /> 191 </com.google.android.material.chip.ChipGroup> 192 193 <TextView../../src/main/res/layout/activity_main.xml:214:
211 android:layout_width="wrap_content" 212 android:layout_height="wrap_content" 213 android:checked="true" 214 android:text="30 fps" /> 215 216 <com.google.android.material.chip.Chip 217 android:id="@+id/chip_fps60"../../src/main/res/layout/activity_main.xml:221:
218 style="@style/Widget.Material3.Chip.Filter" 219 android:layout_width="wrap_content" 220 android:layout_height="wrap_content" 221 android:text="60 fps" /> 222 </com.google.android.material.chip.ChipGroup> 223 224 <TextView
HardcodedText
Internationalization
Warning
Priority 5/10
Included Additional Checks
This card lists all the extra checks run by lint, provided from libraries,
build configuration and extra flags. This is included to help you verify
whether a particular check is included in analysis when configuring builds.
(Note that the list does not include the hundreds of built-in checks into lint,
only additional ones.)
Disabled Checks
One or more issues were not run by lint, either
because the check is not enabled by default, or because
it was disabled with a command line flag or via one or
more
lint.xml configuration files in the project directories.
Suppressing Warnings and Errors
Lint errors can be suppressed in a variety of ways:
1. With a
2. With a
3. With a //noinspection comment in the source code
4. With ignore flags specified in the
5. With a
6. With a
7. With the --ignore flag passed to lint.
To suppress a lint warning with an annotation, add a
To suppress a lint warning with a comment, add a
To suppress a lint warning in an XML file, add a
To suppress a lint warning in a
Here we specify a comma separated list of issue id's after the disable command. You can also use
To suppress lint warnings with a configuration XML file, create a file named
The format of the
To suppress lint checks from the command line, pass the --ignore flag with a comma separated list of ids to be suppressed, such as:
For more information, see https://developer.android.com/studio/write/lint.html#config
1. With a
@SuppressLint annotation in the Java code2. With a
tools:ignore attribute in the XML file3. With a //noinspection comment in the source code
4. With ignore flags specified in the
build.gradle file, as explained below5. With a
lint.xml configuration file in the project6. With a
lint.xml configuration file passed to lint via the --config flag7. With the --ignore flag passed to lint.
To suppress a lint warning with an annotation, add a
@SuppressLint("id") annotation on the class, method or variable declaration closest to the warning instance you want to disable. The id can be one or more issue id's, such as "UnusedResources" or {"UnusedResources","UnusedIds"}, or it can be "all" to suppress all lint warnings in the given scope.To suppress a lint warning with a comment, add a
//noinspection id comment on the line before the statement with the error.To suppress a lint warning in an XML file, add a
tools:ignore="id" attribute on the element containing the error, or one of its surrounding elements. You also need to define the namespace for the tools prefix on the root element in your document, next to the xmlns:android declaration:xmlns:tools="http://schemas.android.com/tools"To suppress a lint warning in a
build.gradle file, add a section like this:
android {
lintOptions {
disable 'TypographyFractions','TypographyQuotes'
}
}
Here we specify a comma separated list of issue id's after the disable command. You can also use
warning or error instead of disable to change the severity of issues.To suppress lint warnings with a configuration XML file, create a file named
lint.xml and place it at the root directory of the module in which it applies.The format of the
lint.xml file is something like the following:
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<!-- Ignore everything in the test source set -->
<issue id="all">
<ignore path="\*/test/\*" />
</issue>
<!-- Disable this given check in this project -->
<issue id="IconMissingDensityFolder" severity="ignore" />
<!-- Ignore the ObsoleteLayoutParam issue in the given files -->
<issue id="ObsoleteLayoutParam">
<ignore path="res/layout/activation.xml" />
<ignore path="res/layout-xlarge/activation.xml" />
<ignore regexp="(foo|bar)\.java" />
</issue>
<!-- Ignore the UselessLeaf issue in the given file -->
<issue id="UselessLeaf">
<ignore path="res/layout/main.xml" />
</issue>
<!-- Change the severity of hardcoded strings to "error" -->
<issue id="HardcodedText" severity="error" />
</lint>
To suppress lint checks from the command line, pass the --ignore flag with a comma separated list of ids to be suppressed, such as:
$ lint --ignore UnusedResources,UselessLeaf /my/project/pathFor more information, see https://developer.android.com/studio/write/lint.html#config