https://kotlinlang.org logo
Docs
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
  • l

    Lukasz Kalnik

    08/22/2022, 1:58 PM
    Is there some more modern and Kotlin-oriented library for OAuth than AppAuth-Android?
    a
    • 2
    • 6
  • a

    althaf

    08/23/2022, 7:28 AM
    what is the difference between these two code ?
    class VerifyAppIntegrityUseCase(
        val authRepository: AuthRepository,
        val workbenchUserRepository: WorkbenchUserRepository,
        val menuRepository: MenuRepository,
        val subscriptionRepository: SubscriptionRepository,
        val adkarRepository: AdkarRepository,
        val securedKeyValueStoreRepository: SecuredKeyValueStoreRepository,
     >>>   dispatcher: CoroutineDispatcher
    ) :
        AuthenticatedFlowUseCase<Unit, Unit>(authRepository, dispatcher), UseCaseScope
    class VerifyAppIntegrityUseCase(
        val authRepository: AuthRepository,
        val workbenchUserRepository: WorkbenchUserRepository,
        val menuRepository: MenuRepository,
        val subscriptionRepository: SubscriptionRepository,
        val adkarRepository: AdkarRepository,
        val securedKeyValueStoreRepository: SecuredKeyValueStoreRepository,
    >>> val dispatcher: CoroutineDispatcher
    ) :
        AuthenticatedFlowUseCase<Unit, Unit>(authRepository, dispatcher), UseCaseScope
    why would kotlin give such a dual option here, both options allow us to pass it to the Super class constructor
    p
    • 2
    • 1
  • a

    aungbophyoe

    08/23/2022, 9:00 AM
    What is your usual stack of components and libraries for an android app’s architecture? please answer me .
    • 1
    • 1
  • k

    Kashismails

    08/24/2022, 5:38 AM
    Hey everyone, i have created a kmm sample app, it has everything shared from viewmodels to services. Its a publick template so you can use it to build your own apps.Feel free to check it out and do read the readme, it has all the details you need. https://github.com/Kashif-E/KMMNewsAPP
  • m

    Manuel Lorenzo

    08/24/2022, 8:16 AM
    hi all! how can I avoid Android to request the permissions again when the phone is rotated?
    j
    • 2
    • 31
  • j

    Jerome

    08/24/2022, 10:51 AM
    Hi all, is there a specific channel here for kotlin multiplatform?
    y
    • 2
    • 2
  • j

    Joe Altidore

    08/24/2022, 1:56 PM
    I am try to store a list of object with data store but I am getting this error:
    kotlinx.serialization.SerializationException: Class 'SmallPersistentVector' is not registered for polymorphic serialization in the scope of 'PersistentList'.
        Mark the base class as 'sealed' or register the serializer explicitly.
    this is the data class:
    @Serializable
    data class Ngo(
        val data: PersistentList<NgoData> = persistentListOf()
    )
    
    @Serializable
    class NgoData(
        var companyId: Int,
        var country: String,
        var createdAt: String,
        var gallery: Gallery,
        var id: String,
        var mission: String,
        var name: String,
        var organisationType: String,
        var picture: String,
        var pictureUrl: String,
        var points: String,
        var text: String,
        var updatedAt: String
    )
    
    @Serializable
    data class Gallery(
        var gallery: List<String>
    )
    j
    • 2
    • 1
  • m

    Mutlu Celep

    08/24/2022, 2:55 PM
    Hi, I am trying to move my local credentials to the cloud. They are in .gradle/gradle.properties. I saw github secret api but I don't have github actions. So I cannot use the api. Is there another way to do it?
  • b

    Billy Newman

    08/24/2022, 9:13 PM
    Hello all. Any one have any idea if there are plans in the paging 3 library to support sorting. I have a use case where I would like to sort items based on how far away from my current location they are.
    f
    • 2
    • 3
  • a

    Arjun Achatz

    08/24/2022, 10:10 PM
    Can a sticky/onGoing notification keep an apps process alive ? I don't need a service (no work to do here), but the user needs to keep the app alive when backgrounded/screen off, and should have a notification saying "You are doing X, tap here to return to Y"
  • y

    Yuşa Zorlu

    08/25/2022, 7:33 AM
    I used lazyRow which gets items from mutableList of my database class
  • y

    Yasser AKBBACH

    08/25/2022, 8:26 AM
    Does anyone have experience on migrating from
    koin
    to
    hilt
    , I'm stuck in the area where
    koin
    passes parameters to the inject! e.g:
    val SomeClass by inject {
    parameterOf()
    }
    What's the equivalent in
    hilt
    p
    c
    • 3
    • 3
  • a

    Abhishek K

    08/25/2022, 2:51 PM
    Hello folks, I'm unable to handle return null value. can anyone help me on this?
  • k

    Kundan926

    08/25/2022, 3:08 PM
    Hi, everyone, I am working on an android app in which I need to display mathematics,physics,chemistry symbol equations in my app. How to do that ?
  • h

    Himanshu Rathore

    08/26/2022, 4:39 AM
    👋 Hello, team!
  • d

    Dmitry

    08/27/2022, 2:43 AM
    Hello guys! I'd like to recommend a useful repo https://github.com/evitwilly/locsimple
  • m

    Mohamed Fathy

    08/28/2022, 8:04 AM
    Hi guys, I am very new to Kotlin coroutines and Flow and studying it now, I tried to achieve this behavior in Flow, but I am not able to do it unfortunately
    fun <T> Single<Response<T>>.parseResponse(): Single<T> {
      return flatMap { response ->
        if (response.isSuccessful) {
          if (response.body() != null) Single.just(response.body()) else Single.error(NoDataException())
        } else {
          Single.error(DataRetrievingFailException())
        }
      }
    }
    This is extension written with RxJava that takes
    Single
    of Retrofit
    Response<Model>
    (
    Single<Response<Model>>
    ) and check the state of it and then return
    Single<Model>
    or error, This function supposed to be used in the
    data
    layer. Thanks in advance.
    l
    • 2
    • 5
  • v

    Viral Thakker

    08/29/2022, 10:38 AM
    Hello Guys, Which side effect can be used while using search API from the backend while using android compose ?
  • n

    Nagaraja Sunder

    08/29/2022, 4:03 PM
    Hello Guys, How to make an automatic retry mechanism for retrofit API calls with Kotlin coroutines. Previously I was using RxJava for doing this. Is there any way to do this with coroutines? Thanks in Advance
    m
    m
    • 3
    • 5
  • a

    Asad Mukhtar

    08/30/2022, 5:28 AM
    Hi Guys, How i know the api call contains file uploading or simple api call using retrofit?
  • s

    ste

    08/30/2022, 7:32 AM
    Why are emulator system images WITHOUT google play services always shipped with weeks of delay?
  • a

    Anand Verma

    08/30/2022, 9:49 AM
    Hi, I’m using retrofit in my project for making API calls and Moshi for json conversion. I just want to implement log for those api request in which there is
    JsonDataException
    and wanted to log api request + api response + parsing error. How can it be done in right way. In interceptor there is no way to log parsing error. Using Retrofit 2.9.0 with coroutine suspend method so don’t have api metadata to log. Kindly help here
  • x

    xxfast

    08/31/2022, 5:43 AM
    Just found out that
    kotlinx.parcelize
    works differently with R8 optimisations
    @Parcelize
    data class Data(
      val param: String? = null
    ){
      val member: Bool = param?.isNotBlank() == true
    }
    for
    Data("someParam")
    On debug variant, inspecting this
    member
    property reads
    true
    while on release variants this magically reads out
    false
    . However, when extracted to a extension with a backing delegate, it behaves the same on both variants
    @Parcelize
    data class Data(
      val param: String? = null
    )
    
    val Data.member: Bool get() = param?.isNotBlank() == true
    Is this a known issue?
  • s

    Slackbot

    08/31/2022, 6:51 AM
    This message was deleted.
    e
    a
    j
    • 4
    • 3
  • t

    Travis Griggs

    08/31/2022, 5:06 PM
    What is a current/idiomatic way to do the following:
    listOf("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat")
    I tried to use
    DateFormatSymbols().shortWeekdays()
    but that surprisingly returns an array of 8 values (so that Sunday can be accessed at 1 apparently). I could slice from 1..7, but that seems hacky. Is there a current idiomatic way to get a list of short weekday names?
    c
    • 2
    • 1
  • r

    rkeazor

    08/31/2022, 9:50 PM
    only Kotlin related questions
  • b

    Bradleycorn

    09/02/2022, 1:57 PM
    Wondering if someone could explain the difference between the suspending functions,
    Lifecycle.whenResumed
    vs
    Lifecyle.withResumed
    ? .. it seems like they both work the same way?
    r
    u
    +2
    • 5
    • 8
  • j

    James

    09/02/2022, 4:58 PM
    HI, everyone
  • j

    James

    09/02/2022, 4:59 PM
    This is a Kotlin Beginner, what I have to do first?
    l
    t
    j
    • 4
    • 4
  • j

    James

    09/02/2022, 5:00 PM
    Is there any best documentation to learn the Kotlin for android?
Powered by Linen
Title
j

James

09/02/2022, 5:00 PM
Is there any best documentation to learn the Kotlin for android?
View count: 8