Lint Report: 17 warnings
Issue Types

Overview

Correctness
1warning OldTargetApi: Target SDK attribute is not targeting latest version
5warning GradleDependency: Obsolete Gradle Dependency
Performance
4warning ObsoleteSdkInt: Obsolete SDK_INT Version Check
1warning UnusedResources: Unused resources
Internationalization
1warning SetTextI18n: TextView Internationalization
5warning HardcodedText: Hardcoded text
Included Additional Checks (29)
Disabled Checks (39)

Target SDK attribute is not targeting latest version

../../build.gradle.kts:13: Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this version. Consult the android.os.Build.VERSION_CODES javadoc for details.
 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: A newer version of androidx.core:core-ktx than 1.13.1 is available: 1.19.0
 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: A newer version of androidx.appcompat:appcompat than 1.7.0 is available: 1.8.0
 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: A newer version of com.google.android.material:material than 1.12.0 is available: 1.14.0
 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: A newer version of androidx.constraintlayout:constraintlayout than 2.1.4 is available: 2.2.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:53: A newer version of androidx.lifecycle:lifecycle-runtime-ktx than 2.8.7 is available: 2.11.0
 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: Unnecessary; SDK_INT is always >= 24
 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: Unnecessary; SDK_INT is never < 24
 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: Unnecessary; SDK_INT is always >= 24
 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: Unnecessary; SDK_INT is always >= 24
  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: The resource R.string.connect_browser appears to be unused
 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: Do not concatenate text displayed with setText. Use resource string with placeholders.
 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: Hardcoded string "Sparsam", should use @string resource
 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: Hardcoded string "Ausgewogen", should use @string resource
 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: Hardcoded string "Scharf", should use @string resource
 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: Hardcoded string "30 fps", should use @string resource
 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: Hardcoded string "60 fps", should use @string resource
 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 @SuppressLint annotation in the Java code
2. With a tools:ignore attribute in the XML file
3. With a //noinspection comment in the source code
4. With ignore flags specified in the build.gradle file, as explained below
5. With a lint.xml configuration file in the project
6. With a lint.xml configuration file passed to lint via the --config flag
7. 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/path

For more information, see https://developer.android.com/studio/write/lint.html#config