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

    Arun Sudharsan

    08/02/2025, 7:04 PM
    Hi everyone 👋 - not sure if this is the right channel, please feel free to redirect me if there’s a better one. I recently raised a patch that reduced our APK size by ~350KB, and I’d like some feedback on the safety of the change and better ways to validate it. Change details • Problem: Kotlin generates internal null-safety checks and assertions (
    kotlin.jvm.internal.Intrinsics
    calls). These account for ~2% of our APK size. • Solution: Added ProGuard
    -assumenosideeffects
    rules to remove these internal assertion methods (
    checkNotNull
    ,
    checkParameterIsNotNull
    , etc.). • Effect: Functionality remains the same; only runtime safety checks are stripped out. • Trade-offs (which we’re okay with): ◦ Crash stack traces may lose some detail ◦ Some Kotlin-generated safety information from
    Intrinsics.java
    will be missing Project context • Codebase: ~97% Kotlin, ~3% Java (20+ files). Concerns • Kotlin → Kotlin calls: Should be safe since nullability contracts are enforced at compile time. • Java → Kotlin calls: Potential risk, since a Kotlin method expecting non-null could be called with a nullable from Java. Current approach • We’re reviewing and testing all Java → Kotlin call sites. • Running automation suite + manual QA for validation. My questions 1. How safe is this approach in practice? Are there pitfalls we might be missing? 2. Is there a more automated / systematic way (beyond manual inspection + tests) to gain confidence that removing these null-safety checks won’t cause issues in production? Would love to hear if anyone has tackled this before, or has suggestions for tooling / strategies to improve our conviction here. 🙏
    p
    e
    • 3
    • 5
  • c

    Can

    08/04/2025, 9:55 AM
    Hello everyone, I'm using the Auth0 JWT library to communicate with an API. Everything works fine on the emulator (I'm currently logging in), but when I try to log in with a physical device, I get this error: "Cannot handle token with iat prior to 2025-08-04T124445+0300". As far as I understand, this problem is caused by the following part of my code: "val issuedAt = System.currentTimeMillis() val expiresAt = issuedAt + 300 * 1000" How can I solve this?
    not kotlin but kotlin colored 4
    google 2
    stackoverflow 3
    c
    j
    e
    • 4
    • 5
  • t

    Tobias Preuss

    08/07/2025, 9:59 PM
    Android 15 / edge-to-edge / window insets / legacy 😵 supportActionBar I am dealing with an
    Activity
    (with
    supportActionBar
    , no XML toolbar) and its nested
    Fragment
    (with the toolbar icons setup via
    MenuProvider
    ,
    onCreateMenu
    ,
    onMenuItemSelected
    ). The actual content view is in Compose >
    Scaffold
    but without a
    TopBar
    ! I am trying to enable edge-to-edge and to extend the
    supportActionBar
    to the statusBar. Is there an API? I tried
    enableEdgeToEdge
    ,
    fitsSystemWindows
    on the Toolbar style and via
    window.decorView
    . No success though.
    not kotlin but kotlin colored 4
    google 2
    c
    • 2
    • 1
  • g

    Giang Vu Truong

    08/08/2025, 2:51 AM
    Hello team, hello mina san, I study android jetpack compose. I use Kotlin '1.9.0 -> 2.0.21' version and Kapt (for the Room and the Hilt) . However , I am conflited the between the Kotlin and the Kapt. I see happen this error 'Execution failed for task 'appkaptDebugKotlin'.' Who help me , please? ( I try with AI such as Git Copilot , Chat GPT, ... but don't effective.)
    build.gradle.ktslibs.versions.toml
    c
    • 2
    • 1
  • y

    yash rathor

    08/09/2025, 8:15 PM
    👋 Hello, team!
    ✋ 3
    not kotlin but kotlin colored 1
    🤦‍♂️ 1
  • y

    yousef shaaban

    08/10/2025, 9:19 AM
    Hello everyone i face an issue android 15 how to make screen as full screen but i need Component don't overlap bars of content of the screen
    not kotlin but kotlin colored 3
    c
    a
    • 3
    • 4
  • s

    Slackbot

    08/10/2025, 1:17 PM
    This message was deleted.
    p
    • 2
    • 2
  • m

    Mau NG

    08/11/2025, 7:19 AM
    👋 Hola, equipo.
    not kotlin but kotlin colored 2
    🤦‍♂️ 1
  • e

    Eugene Maksymenko

    08/12/2025, 10:08 AM
    Powerful optimization of the first KMP 3D Globe engine WorldWind Kotlin v1.8.2 released https://github.com/WorldWindEarth/WorldWindKotlin/releases/tag/v1.8.2
    🚫 2
    🔥 3
    c
    • 2
    • 2
  • t

    Tanmay Shree

    08/12/2025, 4:06 PM
    Hi everyone, I'm trying to implement FCM notifications on Android, but I want to open a particular screen based on the type of notification, I am sending a
    context
    parameter in the data block in fcm request but unable to get it in the MainActivity when I click on the notification.
    not kotlin but kotlin colored 5
    c
    • 2
    • 1
  • a

    Abhimanyu

    08/13/2025, 9:02 AM
    Hi all 👋 , In this talk by Arkadii Ivanov about Kotlin Library compatibility -

    https://youtu.be/dI07ZvnwZgE?si=4DAW9GLItbe-rIuM▾

    . It is mentioned that a method changing to synthetic is ABI compatible. Could anyone please help share some resources about this?
    e
    • 2
    • 1
  • s

    Slackbot

    08/13/2025, 10:06 PM
    This message was deleted.
    u
    • 2
    • 1
  • c

    Can

    08/14/2025, 12:15 PM
    Hi guys, i need to create data table in my kotlin project. I can't find any guidance in material design docs. I couldn't find any useful libraries. Do you have any recommendations?
    not kotlin but kotlin colored 3
    c
    m
    • 3
    • 3
  • b

    Barry Fawthrop

    08/16/2025, 6:20 PM
    I have an APK that the analyze says passes 16KB all has yes, none have an issue. Yet when installing on an emulator it gives the ELF 16 KB warning, Any advice?
    not kotlin but kotlin colored 2
    c
    f
    • 3
    • 2
  • o

    Oliver.O

    08/20/2025, 9:08 PM
    Questions for everyone interested in improving Kotlin+Android testing (from the author of TestBalloon, a new Kotlin test framework): If you weren't tied to JUnit 4, how would you like to write Kotlin+Android tests (local, instrumented, Compose, ...)? What are you missing? What's good the way it is? All ideas welcome! 🧵Please.
    ❤️ 1
    👍 1
    t
    g
    d
    • 4
    • 23
  • a

    azeddine

    08/22/2025, 1:53 PM
    👋 Bonjour tout le monde !
    🙌 4
    c
    • 2
    • 1
  • p

    prasanna

    08/25/2025, 8:29 AM
    I am currently building the project in kotlin +XML is this good or I want to move to the jetcompose guide me guys
    p
    g
    t
    • 4
    • 6
  • s

    Slackbot

    08/27/2025, 7:07 PM
    This message was deleted.
    j
    s
    • 3
    • 3
  • p

    prasanna

    08/28/2025, 7:55 AM
    Hii devs! Currently I am working on one project,there i want to autopopulate the persons from my contact book when I mention @names in the text field (This not upto groups , we are working in the things like Ai chat page ). please share your thoughts how to do this.
    not kotlin but kotlin colored 7
    c
    d
    • 3
    • 3
  • l

    LEVELU

    08/28/2025, 9:32 AM
    Hi here, Is someone face to this problem ? My APK does not support 16KB devices but when I analyse my APK there is no lib with the alignment
    not kotlin but kotlin colored 5
    c
    • 2
    • 2
  • a

    Adam Brown

    08/31/2025, 6:35 AM
    one problem i've run into quite a bit is that it takes quite a while for IntelliJ to support the newer versions of AGP and Gradle. Is there anyway around that?
    👍 1
    🚫 2
    c
    a
    • 3
    • 3
  • j

    Jenis Sanghani

    09/01/2025, 6:11 AM
    👋 Hello, team!
    👋 1
    not kotlin but kotlin colored 1
  • f

    falcon

    09/01/2025, 9:12 AM
    Hello
  • 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
    • 2
    • 4
  • 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 1