https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
android
  • k

    KotlinLeaner

    11/23/2022, 6:31 AM
    Hi guys, I want to create a
    Bitmap
    of
    .tiff
    extension. I saw in stack overflow 1 and stack overflow 2 the code is in java. But I was unable to find this class in kotlin. Is there any better way doing in kotlin to load in
    .tiff
    ? Thanks
    i
    • 2
    • 5
  • a

    Akinyemi Emmanuel

    11/23/2022, 7:35 AM
    Hello guys, I'm new here, and I'm new to android programming, i am hoping to learn from you and hopefully guide people in the future.. I hope I am welcome?
    a
    h
    • 3
    • 4
  • l

    Lukas Lechner

    11/23/2022, 3:08 PM
    Hi! I created a new video about “What is a Flow in Kotlin?”

    https://youtu.be/TvdF566t2Y8▾

    c
    • 2
    • 1
  • s

    Shankar Gollakota

    11/24/2022, 3:52 AM
    Hi everyone there a lazyrow is screen A and from screen A i am moving to screen B while coming back to Screen B to Screen A lazyrow in screen A is re rendering ..... How can I avoid the re rendering #compose
    h
    • 2
    • 1
  • d

    DINESH S

    11/24/2022, 1:16 PM
    Hi is there any way to get real time.. I’m going to build app which have license validation.. for the very first time the internet connection is must.. after noo need of internet. We storing expiry date in encrypted way locally. With that we compare local date and time and getting to validation expired or not. Issue: if user changing their time in setting everywhere time getting changed.. so they bypassing the validation. Is any work arround or idea to achieve validation properly without internet😒miling_face_with_tear: even they change the time in their device..!! Any idea should he appreciated.
    b
    c
    • 3
    • 2
  • m

    Maciej Pigulski

    11/24/2022, 2:17 PM
    I am trying to generate baseline profiles for the app. As it seems this would be good to have those generated on every release build as code changes constantly and the reason for a new build is of course code change so baseline would need an update. Problem I see with that is that code that the baseline is ran on should be the closest to production one, meaning f.e. not mocking data on network layer i.e. calling backend services for data using Retrofit etc.. This means a test running on a CI and a network failure, test instability, change in data responses so test fails to match some results will result in a build failure. This seems to be a high risk thing from maintenance purpose. Is there any smart way to tackle this? Or maybe I am overthinking this and the baseline profile generation attached to CI release build process is over engineering? Maybe a baseline profile generated locally now and then and updated like every 2 weeks is enough? What do you think?
    e
    • 2
    • 1
  • h

    Hossein Amini

    11/25/2022, 6:35 AM
    Hi folks Is there any platform or slack channel to find remote jobs as an Android or KMM developer?
    g
    • 2
    • 1
  • m

    Maulik

    11/25/2022, 7:27 AM
    Hyy guys i posted this question please help me for this https://stackoverflow.com/questions/74569405/how-can-we-get-cancel-button-listener-from-system-generate-notification-by-downl
    z
    • 2
    • 2
  • m

    Maulik

    11/25/2022, 7:27 AM
    It's about download manager
  • t

    Timo Drick

    11/25/2022, 11:17 PM
    I am usinge the
    Intent.ACTION_OPEN_DOCUMENT_TREE
    to let the user choose a directory and get access to this directory. It works but unfortunately the access is only temporary when the user closes the app and opens the app again i need to open the directory picker again. Especially for development this is very unpleasent. Of course i could ask the user for MANAGE_EXTERNAL_STORAGE permission but Google do not want this anymore for normal apps. My app is just a video player. But i need access to the directory to load subtitle files.
    i
    • 2
    • 5
  • l

    Lukas Anda

    11/25/2022, 11:20 PM
    Hey guys, just out of curiosity. Is there a way for android studio to copy @ Composable annotation when generating overriden methods?
    a
    • 2
    • 2
  • d

    Daniel De Jesus Rodrigues

    11/27/2022, 8:35 PM
    Hey everyone! I have a endpoint that returns replies of a post, and the structure is something like that:
    data class PostReply(
      val author: String,
      val body: String,
      val replies: List<PostReply> // can be infinitely deep
    )
    I’ve created one regular data class, and another with serialized annotations. But I cannot think a good way on how to map
    replies
    recursively. I tried that but didn’t work:
    fun PostRepliesResponse.toModel() = PostReplies(
        //...
        replies = replies.map { reply -> reply.toModel() }
    )
    Can you guys help me?
    j
    • 2
    • 22
  • p

    Patricia Tarazaga

    11/28/2022, 8:15 AM
    Hi everyone! I was wondering if somebody could help me. I'm new on StateFlow and I found an issue developing my app: I have a layout with a RecyclerView, so whenever I use _state.value.copy( .. ) my Recycler refresh losing its position on scroll... I would like to keep that scroll position. How can I update my UiState without losing the scroll? 🙂
    a
    k
    j
    • 4
    • 9
  • n

    Nikolas Guillen Leon

    11/28/2022, 10:07 AM
    Hi everyone! I have an interface that is implemented by a few classes and I have a "List<Interface>" that I have to save in my Room DB. Every class has its own DAO, but I have a BaseDao too which defines Insert/Update/Delete methods for all the other DAOs. At the moment I'm simply filtering the list with the "filterIsInstance" method to get the class of the objects(I'm doing it for every single class that implements the interface) and then I'm calling the specific class DAO to insert/update/delete the entity. Is there a better way to do this? In particular, I'm pretty sure that I can avoid filtering the list for every type of class but I don't know how
    l
    z
    • 3
    • 4
  • f

    Fred Bowker

    11/29/2022, 9:21 AM
    So I’m looking at using KMM to initially share our model classes between IOS and Android dev, what is the best way of doing this, should the KMM module be created in Intellij AppCode or Android Studio. My initial thinking is that I have a separate GitHub repo for KMM modules build in intellij then this gets imported via gradle into appCode (IOS) and Android Studio (Android). Is this the recommended approach
    j
    j
    • 3
    • 18
  • m

    Mez Pahlan

    11/29/2022, 11:10 AM
    Hi friends 👋 I have an Android SDK with no UI logic that at the moment I use the
    com.android.library
    gradle plugin to help build. I have a very small sliver of Android dependencies and would now like to convert this to an SDK that can run on our Java backend but still be written in Kotlin, of course. Has anyone had experience with something doing something like this? Where should I start? I think that all of my library dependencies will happily function outside of Android in an in a pure JVM apart from these: 1.
    com.android.tools:desugar_jdk_libs
    2.
    androidx.annotation:annotation
    3.
    androidx.datastore:datastore-preferences
    Should I create two SDKs one of which is
    -core
    and the other a slim
    -android
    add on? Or can I get away with a single SDK?
    d
    c
    • 3
    • 7
  • f

    Francisco Vital Serrão Pereira De Carvalho

    11/29/2022, 2:51 PM
    Hi guys 👋, using Compose and Paging with Room, is there a way to mutate the items without refreshing the entire list? At the moment, I have an implementation of the RemoteMediator meaning that I can fetch data from the API and store it in DB, but when I perform the delete operation the entire list is "invalidated" therefore all the new data will be fetched again. Do any of you guys know a way to bypass this challenge?
    c
    m
    • 3
    • 4
  • g

    gian

    12/01/2022, 12:31 PM
    Hello folks, in a project I have a
    Parcelize
    -annotated data class that contains a property whose type is a value class. E.g.:
    @Parcelize data class Example(val id: Id) : Parcelable
    
    @JvmInline value class Id(val long: Long)
    With Kotlin 1.6.10 this compiles and work. However, after updating to Kotlin 1.7.20, I started getting the following error a compile time:
    Type is not directly supported by 'Parcelize'. Annotate the parameter type with '@RawValue' if you want it to be serialized using 'writeValue()'
    I'm not sure I understand why this stopped compiling, but is using
    @RawValue
    the actual solution or is there a better one? It feels like a workaround that could break at runtime if the wrapped type changes to one that isn't
    Parcelable
    .
    e
    • 2
    • 2
  • k

    KotlinLeaner

    12/01/2022, 1:40 PM
    Hi 👋 I was working in existing application in which it has more than 5 api calls in the viewmodel through retrofit. When fetching api call it has showing loader to main screen and block user untill we get data from response. Some are dependent to each other but some are not i.e. Login session dependent on customer data etc. All response are huge in data so may be it taking time to load. I read the review from play store, its frustrations for user and giving bad reviews. This project is growing day by day. I know you guys asked why this api calls in single screen and reason behind this is the application is healthcare. We make a survey from customer and they want there results in homepage. I already read the doc and everything is up to according to doc. I don't want spoonfed, but I need guidance for you guys. Many thanks
    d
    d
    • 3
    • 4
  • s

    Slackbot

    12/01/2022, 3:14 PM
    This message was deleted.
  • m

    Milo

    12/01/2022, 10:37 PM
    how to show the keyboard immediately when a screen is opened with Jetpack Compose and kotlin?
    c
    l
    • 3
    • 3
  • s

    Slackbot

    12/02/2022, 12:27 AM
    This message was deleted.
    w
    a
    +2
    • 5
    • 5
  • n

    Nebil

    12/02/2022, 11:41 AM
    How to set bottom nav bar items centred for landscape or tablet mode. They're too far apart. (Jetpack compose)
    i
    a
    • 3
    • 8
  • s

    Shridhar Goel

    12/02/2022, 12:18 PM
    What is the best way to measure the performance of a composable and get the data from the user base using Firebase traces (and not just tracing on our own device(s)) ? The main question here is about where to start the trace and where to stop it. Posted on #compose earlier but did not get any response.
    d
    d
    • 3
    • 6
  • d

    DINESH S

    12/03/2022, 4:39 AM
    Migrate the deprecated onbackpressed function when you targeting Android 13, check if you want!! #android #deprecated https://medium.com/@fierydinesh/migrate-the-deprecated-onbackpressed-function-android-13-d0d556244272
  • f

    Fred Bowker

    12/04/2022, 10:45 AM
    Hi, I’m starting developing a new app, all retrofit calls will be async, if I have a rest call that returns a single value would people still recommend using Flow
  • f

    Fred Bowker

    12/04/2022, 10:45 AM
    I know flow will give you a stream for multiple values, but I think from an architecture perspective it makes sense to use Flow also for a single value, instead of LiveData
    n
    • 2
    • 1
  • f

    Fred Bowker

    12/04/2022, 10:47 AM
    doing some google searches it looks like this is the approach to go with, LiveData looks to be the old way of doing things and will be deprecated at some point in the future
    y
    n
    • 3
    • 2
  • f

    Fred Bowker

    12/04/2022, 10:52 AM
    https://www.reddit.com/r/mAndroidDev/comments/mcfl9n/livedata_is_officially_deprecated_in_kotlinonly/
    j
    • 2
    • 1
  • f

    Fred Bowker

    12/04/2022, 10:53 AM
    so I’m not really that bothered if it is to be officially deprecated, more just whether people would recommend only using Flows and StateFlow
    j
    n
    • 3
    • 2
Powered by Linen
Title
f

Fred Bowker

12/04/2022, 10:53 AM
so I’m not really that bothered if it is to be officially deprecated, more just whether people would recommend only using Flows and StateFlow
j

Josh Eldridge

12/04/2022, 3:49 PM
I would currently recommend using flows over LiveData. With the available collectAsStateWithLifecycle options available to flows from Android, it doesn't make a bunch of sense to keep LiveData around, especially if there is ever a plan to move to Kotlin multiplatform
n

Nino

12/05/2022, 9:28 AM
@Josh Eldridge There's still some issues with collecting a Flow from the View, you can check it there: https://medium.com/androiddevelopers/migrating-from-livedata-to-kotlins-flow-379292f419fb, there's some strong overlooks from the author (with hot flows) witch make the repeatOnLifecycle still not desirable. You can read this https://medium.com/androiddevelopers/a-safer-way-to-collect-flows-from-android-uis-23080b1f8bda and / or check my demo using both LiveData and Flow between View and ViewModel so you can check the issues yourself https://github.com/NinoDLC/Kotlin_Flow_To_The_View
View count: 12