https://kotlinlang.org logo
Join Slack
Powered by
# android
  • b

    Barry Fawthrop

    09/02/2025, 12:33 PM
    I have updated all dependencies and targetSdk to 36. yet still see not meeting 16Kb. It lists a few .so that are not 16KB compliant But I can't tell which dependency uses them or how they are a part of the project. Can anyone help, Thanks
    not kotlin but kotlin colored 3
    c
    • 2
    • 3
  • s

    Sourav Kumar

    09/02/2025, 2:31 PM
    One problem i have ran into , old codebase uses package
    in.dummy.android
    . Java files compile with
    package in.dummy.android
    , but Kotlin requires backticks with in keyword: `package
    in
    .dummy.android`. After adding Spotless (ktlint), I get error
    ktlint(standard:package-name) Package name contains a disallowed character
    . What’s the best way to handle this ? Any recommendation for large code base ? I tried to find some rules to write in .editorconfig but did not find any .
    p
    • 2
    • 2
  • j

    JunkEmail ForMe

    09/04/2025, 9:30 AM
    I am developing a Jogging Tracker application for both Playstore and FDroid (i know the new policy by google, but i started it way earlier and it's now a learning project). I have created 2 productFlavours for this android application. For FDroid i am using LOST (A drop-in replacement for Google Play services location APIs for Android) and For playstore i am using Google PlayServices's FusedLocationProvider since they both have almost the same API signature , i am using TypeAlias to define a common name for the classes (PR for the same) . I wanted to ask if this is the correct usage and/or if there are any other ways to do the same . app/playstore
    Copy code
    typealias LocationProviderClient = FusedLocationProviderClient
    app/fdroid
    Copy code
    typealias LocationProviderClient = LostApiClient
    and then use LocationProviderClient directly in
    main
    code
    c
    • 2
    • 6
  • c

    Ciaran Sloan

    09/04/2025, 2:08 PM
    I've experienced a crash when bumping Kotlin from 2.1.20 to 2.2 and wondering if something has changed in the compiler. For context, the crash is totally expected but I'm curious why this doesn't crash prior to 2.2. I have something similar to the following snippet of code:
    Copy code
    private lateinit var scrollView: ScrollView
    fun onCreateView(): View? {
        val view = super.onCreateView()
        if (view != null) {
            scrollView = view.findViewById(R.id.scoll_view)
        }
    }
    The crash happens at the assignment of findViewById, as the layout doesn't actually exist. We didn't notice this crash as it's in an abstraction and this property isn't actually accessed or read. However since bumping to Kotlin 2.2 this crashes with an NPE - which is actually expected. Does anyone know what might have changed in 2.2 that might have caused this? Or why we wouldn't have seen this prior to 2.2?
    p
    g
    • 3
    • 7
  • t

    Thierry Kh

    09/04/2025, 11:17 PM
    Hello. As of today, is there a simple way of setting an update priority on the Play Console? I've implemented in-app updates but the priority seems to be high by default, i get an "immediate" update dialog.
    not kotlin but kotlin colored 4
    c
    a
    • 3
    • 5
  • p

    prasanna

    09/08/2025, 10:33 AM
    Hey folks 👋 I’m working on a conversational flow for expense splitting in my Android app (something like the screenshots attached). Now I’m trying to refine the flow to handle multiple real-life scenarios dynamically. --- ### Scenario 1: User uploads only the bill (no prompt) 👉 Flow should go like this: 1. Bill uploaded card * “Bill uploaded successfully. Whom do you want to split this with?” * Collect participants (e.g. me, Akhil, Prasanna). 2. Split method card * “How would you like to split this expense? (Equally / By item / Custom share)” * If “Split by item” → show existing item assignment card. 3. Payer card * If no payer is mentioned → “Please select who covered this expense.” 4. Final summary card (new) * Show expense summary (total, split details, payer). * On confirm → Call API once with all collected data. --- ### Key rule: Skip unnecessary cards * If participants are already mentioned in the prompt → skip step 1. * If split method is mentioned → skip step 2. * If payer is mentioned → skip step 3. * If everything is provided → directly show summary card. --- ### My question to the community 🔎 Right now I’m thinking of two possible approaches for handling edge cases (when user mentions some details in the prompt but not all): 1. Keyword-based detection on frontend * Extract participants / split method / payer locally. * Show only the missing cards. * Make one final API call at the end. 2. Delegate parsing to backend * Send the raw prompt to backend. * Backend decides what info is missing and returns the next step. * This would mean calling API at every step of the flow. 💡 Which approach do you think is more efficient and scalable for a chat-like flow in Android? Is keyword-based detection on frontend enough, or is it safer to rely on backend parsing even if that means more network calls? Also, what patterns have you found clean for structuring these multi-step conversational flows in Compose? I’m leaning towards a state machine in ViewModel (sealed classes like
    BillUploaded
    ,
    SelectParticipants
    ,
    SelectSplitMethod
    ,
    AssignItems
    ,
    SelectPayer
    ,
    ShowSummary
    ) but curious if there’s a more elegant solution you’ve used. Any suggestions / best practices would be really helpful 🙏
    not kotlin but kotlin colored 4
    🧵 7
    c
    g
    • 3
    • 5
  • k

    khushal dadwal

    09/10/2025, 10:03 AM
    Hi everyone i am getting issue for android mic voice routing I am using getAvailable communicationDevices and then setcommunicationDevice getting routed with my glasses but not getting with my earbuds (Not able to get earbuds in getAvailableCommunicationDevices ) How can i resolve this issue an
    not kotlin but kotlin colored 3
    c
    • 2
    • 2
  • m

    Muthu

    09/16/2025, 11:29 AM
    Hi everyone, I am trying to draw this box without using a Replacement span. Is it possible to draw?
    not kotlin but kotlin colored 2
    e
    • 2
    • 3
  • b

    Brais Gabin

    09/16/2025, 2:03 PM
    Hello! I'm hunting bottlenecks on my app start time. I'm using perfetto and on it I see in some traces a huge gap (1 second) where the main thread is sleeping. On other traces that sleep doesn't happen and the app "starts" 1 second faster. How can I diagnostic this? Can it be the Garbage collector? How can I see the Garbage collector time on perfetto?
    not kotlin but kotlin colored 3
    c
    • 2
    • 1
  • h

    Henzel

    09/16/2025, 4:24 PM
    Hello all. Guys, how do you handle custom splash screen when you need to have a short video(mp4) playing on splash? Thanks in advance)
    not kotlin but kotlin colored 3
    a
    c
    • 3
    • 3
  • h

    hari

    09/17/2025, 6:17 AM
    👋 hey everyone im hari nice to meet and joining to explore android
    👋 8
    c
    • 2
    • 1
  • j

    Jack Eblan

    09/23/2025, 9:06 PM
    👋 Hello, team!
    👋 6
    🧌 2
  • r

    Ravi

    09/27/2025, 3:40 AM
    Hello Team!
    👋 3
  • b

    Behzod

    09/29/2025, 5:29 AM
    Hi, folks! I just published a new article: Inside Android: From Zygote to Binder. In this post, I explain how Android processes are created and communicate with each other — starting from the Zygote process to the Binder IPC mechanism. Hope it would be helpful! https://medium.com/proandroiddev/inside-android-from-zygote-to-binder-4ccafe1267a3
    not kotlin but kotlin colored 3
    👍 2
    K 3
    🚫 1
    c
    d
    • 3
    • 2
  • d

    Dequency Yates

    09/29/2025, 4:15 PM
    Hey guys!
    👋 3
    👋🏾 1
    🚫 1
  • p

    Plugguto

    10/01/2025, 7:23 PM
    👋 Hello, team!
    not kotlin but kotlin colored 1
    👋 1
    🚫 1
  • g

    Greg Williams

    10/02/2025, 1:38 AM
    If you're worried about the upcoming Android developer verification by Google, there is a lot of FUD and misinformation out there -- don't believe it. Here's the real scoop.

    https://youtu.be/A7DEhW-mjdc▾

    not kotlin but kotlin colored 4
    👀 1
    💩 3
    d
    g
    b
    • 4
    • 34
  • d

    Danail Boyukliev

    10/02/2025, 6:43 AM
    Hi guys! If a link that redirects to a link triggering deeplink is being sent in email and user clicks on the link, we notice that with the latest version of Gmail if
    Open web links in Gmail
    is enabled, the deeplink would not be triggered. If tested on an emulator with Gmail running older version of Gmail, it works even if
    Open web links in Gmail
    is enabled. Does anybody knows if there's been change in Gmail for this feature?
    not kotlin but kotlin colored 3
    c
    • 2
    • 2
  • b

    bazbo.222

    10/04/2025, 4:15 PM
    Hi, hello everyone! So, I'm following this book from 2023 on making apps in jetpack compose, and, taking the code from the book's official github repo, the following code works:
    Copy code
    fun Modifier.drawYellowCross() = then(
        object : DrawModifier {
            override fun ContentDrawScope.draw() {
                drawLine(
                    color = Color.Yellow,
                    start = Offset(0F, 0F),
                    end = Offset(size.width - 1, size.height - 1),
                    strokeWidth = 10F
                )
                drawLine(
                    color = Color.Yellow,
                    start = Offset(0F, size.height - 1),
                    end = Offset(size.width - 1, 0F),
                    strokeWidth = 10F
                )
                drawContent()
            }
        }
    )
    However, if I try creating a new Compose project with the most recent version of Android Studio 2025, pasting that piece of code into the default "Empty Views App" project template, the code gives the following compilation error:
    Modifier factory functions must use the receiver Modifier instance
    Now, personally, what I understand from this error is that my
    drawYellowCross()
    function should be an extension function of the Modifier class... which it is. Anyway, to sum up, here are my questions: 1. How should I understand this error? 2. What changed in the versions from 2023 up 'till now? 3. How do I migrate / update my code properly? Thanks in anticipation to anyone who wishes to chime in and help.
    c
    • 2
    • 2
  • n

    Nick

    10/05/2025, 1:45 PM
    Yo guys you should try this plugin for exception handling. v1.0.3 under review for 1-2 days atm. https://github.com/ogzkesk/ExceptionGuard-Kotlin-Plugin
  • t

    Tower Guidev2

    10/06/2025, 10:00 AM
    Hi, is jodatime still relevant for modern android applications written in Kotlin?
    j
    o
    • 3
    • 3
  • n

    Nurlibay

    10/07/2025, 8:31 AM
    Hi! When I change the app language, the screen somehow blacks out or flashes. How can I fix this? I’ve tried numerous solutions, but none of them worked. Only the language screen is built with Compose; the others use XML
    Copy code
    private fun applyAppLocale(languageCode: String) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
            // Android 13+: Use LocaleManager for per-app persistence
            val localeManager = context.getSystemService(LocaleManager::class.java)
            localeManager.applicationLocales = LocaleList.forLanguageTags(languageCode)
        } else {
            // Pre-Android 13: Use AppCompatDelegate
            val locales = LocaleListCompat.forLanguageTags(languageCode)
            AppCompatDelegate.setApplicationLocales(locales)
        }
    
        // Immediate update for resources (affects View-based UI)
        val config = Configuration(context.resources.configuration)
        config.setLocale(Locale(languageCode))
        @Suppress("DEPRECATION")
        context.resources.updateConfiguration(config, context.resources.displayMetrics)
    }
    not kotlin but kotlin colored 5
    c
    j
    • 3
    • 2
  • d

    Dan Rusu

    10/10/2025, 4:24 PM
    Hi Android community 👋 I'm the developer of Immutable Arrays for Kotlin and I'm hoping to bump the minimum version to JDK 17 in order to upgrade dependencies. Can Android developers safely use Kotlin libraries that use inline classes & inline functions with Java 17 bytecode and still target older devices? I want to make sure I'm not excluding a large portion of the user-base but I'm not familiar with Android development. Thanks in advance 🙏 p.s. The next release will reduce temporary memory consumption of some operations by 16X on average. Almost done benchmarking locally before pushing.
    not kotlin but kotlin colored 1
    👍🏻 1
    c
    z
    • 3
    • 10
  • i

    igor.wojda

    10/13/2025, 10:52 AM
    👉 Hello fellow Devs I finally had a chance to upgrade my most popular Android open-source project This is still the most complete Android sample you can find around (Kotlin, Coroutines, Jetpack Compose, Jetpack Navigation, Material Design 3, Clean Architecture, Tests, Feature Modules, MVVM, Static Analysis, CI Config, Gradle Convention Plugins, and more). If you spot something off or areas for improvement, please let me know! https://github.com/igorwojda/android-showcase
    👀 2
    🎉 1
    g
    c
    +2
    • 5
    • 25
  • z

    zimjon

    10/18/2025, 12:43 PM
    👋 Hello, team!
    👋 4
  • j

    Jhsagiv

    10/19/2025, 8:31 PM
    Hi everyone! Hope you all had a great weekend! Excited to share that I have released MCP on Android TV 🎉 The app uses the official Kotlin MCP SDK and is bundled with a local ADB binary that gives us control over our TV devices. Please check it out and let me know your thoughts and of course PR’s are more then welcome 🙏 https://github.com/MiddlePoint-Solutions/mcp-on-android-tv
    K 9
    👍 1
    🤟 2
    K 1
    c
    • 2
    • 1
  • a

    Archit69 Appdeveloper

    10/21/2025, 2:02 PM
    Hi. Is there a slack channel to ask questions related to Android & Google Play Billing Library?
    🚫 3
    not kotlin but kotlin colored 2
    j
    • 2
    • 4
  • k

    KarlMcCree

    10/22/2025, 10:32 AM
    👋 Hello, team!
    👋 3
  • p

    Pablo

    10/22/2025, 2:29 PM
    I have an issue with new Android 16 behaviour change of ignoring activity orientation specified in manifest. Even having
    appCategory="game"
    in manifest and the activity forced to "landscape", the OS rotates the screen, displaying the game in portrait but simulating a fake landscape mode, with two black spaces on top and bottom of the game screen. But the main issue is that is destroying and recreating my activity. That breaks completly the game. How is supposed we should sholve this? Some games are old games developed a lot of years ago, even in java, and are not prepared to survive activity recreation. Supposedly
    appCategory="game"
    should help us keeping our games alive in Android 16, but that onDestroy and onCreate doesn't help.
    not kotlin but kotlin colored 3
    c
    • 2
    • 1
  • g

    Georg Prohaska

    10/24/2025, 10:41 AM
    Hi, I have a problem with Android Studio (version arwhal 4 Feature Drop | 2025.1.4) and kotlin versions: The IDE does not recognize the correct kotlin language version I am using (2.2.20). The features I use (e.g. Clock Interface) work fine when building, but the IDE shows an error saying "This declaration is only available in Kotlin 2.1 ...". Now when I try to change the language version in the settings, it does not work, it still shows the same error and when restarting IDE it jumps back to 2.0, even though in my gradle i definitely have 2.2.20 configured. This is my gradle:
    Copy code
    agp = "8.13.0"
    kotlin = "2.2.20"
    
    [plugins]
    androidApplication = { id = "com.android.application", version.ref = "agp" }
    kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
    Copy code
    plugins {
        alias(libs.plugins.kotlinMultiplatform)
        alias(libs.plugins.androidApplication)
    ...
    }
    
    kotlin {
        sourceSets.all {
            languageSettings {
                optIn("kotlin.uuid.ExperimentalUuidApi")
            }
        }
    
        androidTarget {
            compilerOptions {
                jvmTarget.set(JvmTarget.JVM_21)
            }
        }
    ...
    }
    And in the settings it looks like this:
    r
    c
    • 3
    • 4