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
  • c

    chi

    01/11/2019, 11:59 PM
    I'm trying to run test on a simple app with kotlin but normal gradle commands are failing with error
    Execution failed for task ':app:kaptDebugKotlin'.
    > Could not find tools.jar in system classpath, which is required for kapt to work
    i
    • 2
    • 7
  • d

    dididi

    01/12/2019, 12:35 AM
    hi guys!when you want to create a Singleton ,which one would you choose? ‘object’ or ‘companion object’? what is different?
    a
    • 2
    • 7
  • a

    arhyth

    01/12/2019, 5:06 AM
    hi! i'm following through an anko tutorial to teach myself android basics but video has older dependencies and sdk versions. i'm stuck at this error. i tried googling for the error but have not found any leads to how i might solve it. help? anyone? here's the error:
    Failed to resolve: org.jetbrains.anko:anko-sdk28:0.10.8
    Open File
    Show in Project Structure dialog
    
    
    Failed to resolve: org.jetbrains.anko:anko-sdk28-coroutines:0.10.8
    Open File
    Show in Project Structure dialog
    and the gradle build code:
    dependencies {
        ...
        // Anko
        implementation "org.jetbrains.anko:anko:$anko_version"
        // Anko Layouts
        api "org.jetbrains.anko:anko-sdk28:$anko_version"
        implementation "org.jetbrains.anko:anko-appcompat-v7:$anko_version"
        // Coroutine Listeners for Anko Layouts
        api "org.jetbrains.anko:anko-sdk28-coroutines:$anko_version"
        implementation "org.jetbrains.anko:anko-appcompat-v7-coroutines:$anko_version"
        // for Snackbars
        implementation "org.jetbrains.anko:anko-design:$anko_version"
        implementation 'com.android.support:design:28.0.0'
    }
    a
    r
    • 3
    • 5
  • s

    Slackbot

    01/12/2019, 7:49 PM
    This message was deleted.
    d
    y
    • 3
    • 3
  • i

    itnoles

    01/12/2019, 7:53 PM
    https://github.com/google/dagger/issues/1245
    c
    g
    +2
    • 5
    • 16
  • n

    neuber

    01/13/2019, 2:21 AM
    Can anyone help me
    :stackoverflow: 6
    r
    e
    +2
    • 5
    • 38
  • j

    jurajsolarml

    01/14/2019, 1:35 PM
    Hello, Can you help me ? I am a beginner. Where can be a bug ? Search in the map not work.Thanks / Kotlin / https://hastebin.com/ezasewilas.cpp
    :stackoverflow: 8
    a
    • 2
    • 2
  • i

    Icaro Temponi

    01/14/2019, 10:54 PM
    https://androidstudio.googleblog.com/2019/01/android-studio-33-available-in-stable.html
    h
    • 2
    • 1
  • g

    ghedeon

    01/14/2019, 11:00 PM
    I wish they fixed AS 3.2.1 freezes first, so I can finally move from 3.1.4 😒
    👍 2
    g
    z
    • 3
    • 3
  • s

    STAYER

    01/15/2019, 6:15 AM
    Hi all, is there any way to reboot phone or turn off/on mobile data, or turn off/on airplane mode, without root and "system installed app"?
    :stackoverflow: 7
    t
    • 2
    • 1
  • g

    gsala

    01/15/2019, 12:39 PM
    Is anyone else having issues building projects with Fabric after upgrading to AS 3.3?
    :stackoverflow: 4
    m
    • 2
    • 7
  • c

    CamilleBC

    01/15/2019, 2:26 PM
    Hello ! I'm trying to see if there is a better way to do what I want to do. I wanted to upsert in my Room database. Is there any better way to do it than :
    @Transaction
        fun upsertAll(t: List<T>) {
            val id = insertAll(t)
            if (id.any { it == (-1).toLong() }) updateAll(t)
        }
    ?
    :stackoverflow: 1
    c
    • 2
    • 1
  • e

    Edgars

    01/15/2019, 3:26 PM
    Quick question, couldn't find an answer on Google: does Room support inline classes for fields? Like, if I wanted to store
    inline class FooId(val id: String)
    data class Foo(val id: FooId)
    would that work out of the box? But storing a
    List<FooId>
    wouldn't work without a TypeConverter, right?
    • 1
    • 1
  • p

    pp.amorim

    01/15/2019, 4:53 PM
    Hi guys, I am getting this error, any idea? All libraries are on the latest version.
    -.scala
    s
    • 2
    • 1
  • m

    Mehdi

    01/16/2019, 9:47 AM
    line 12
    Getting_the_response.kt
    u
    d
    • 3
    • 11
  • c

    Caner Korkmaz

    01/16/2019, 12:10 PM
    @Mehdi Maybe adding a loading state to that result would be a good idea
    g
    • 2
    • 2
  • c

    Caner Korkmaz

    01/16/2019, 12:11 PM
    Moreover, you probably need a map/flatMap function for chanining multiple responses
    m
    • 2
    • 1
  • c

    Caner Korkmaz

    01/16/2019, 12:11 PM
    Moreover, like Anton said, you don't need that result variable and it would be a better idea to send it using an observable to the activity
    m
    • 2
    • 1
  • c

    Caner Korkmaz

    01/16/2019, 12:12 PM
    Probably in the view model/presenter you have in between the service and the activity
    m
    • 2
    • 2
  • g

    ghedeon

    01/16/2019, 12:24 PM
    btw, was it introduced for a specific case? Maybe coroutines related. Or just for generic purposes?
    g
    m
    • 3
    • 17
  • m

    Mike.Docherty

    01/16/2019, 5:45 PM
    Does anyone know if I need to do a database migration with ROOM when changing a data class variable from val -> var?
    h
    • 2
    • 2
  • t

    Tzahi Moyal

    01/17/2019, 10:33 AM
    Hi, did someone familiar with kotlin-multiplatform?
    g
    • 2
    • 3
  • g

    ghedeon

    01/17/2019, 5:48 PM
    isn't it shipped with it's own patched JDK?
    i
    • 2
    • 1
  • d

    dave08

    01/17/2019, 5:50 PM
    @louiscad I suspect you've dealt with LiveData and Coroutines, did you find a way to do something similar to
    Transformations.map { }
    using suspend functions in the mapping?
    l
    • 2
    • 5
  • g

    gsala

    01/18/2019, 12:33 PM
    The use of this block is to provide a ViewModel in an Activity and it's used like so:
    private val model: MyViewModel by viewModelProvider { MyViewModel(dependencies) }
    g
    a
    • 3
    • 6
  • m

    matt tighe

    01/18/2019, 5:41 PM
    is there anyway to invoke suspending functions from livedata observers? i’d like to be able to do something like this:
    val liveData: LiveData<List<Thing>> = myDao.getAllThings()
    val mediator = MediatorLiveData<Things>
    
    fun startObservation() {
        mediator.addSource(liveData) { it?.let { newThings->
            sendThingsOverNetwork(newThings)
        }
    }
    
    suspend fun sendThingsOverNetwork = withContext(<http://Dispatchers.IO|Dispatchers.IO>) {
         // Do network ops off main thread
    }
    a
    g
    • 3
    • 13
  • s

    Slackbot

    01/19/2019, 2:55 PM
    This message was deleted.
    o
    • 2
    • 1
  • i

    imvtr

    01/20/2019, 5:27 PM
    Hey, good afternoon! i'm programming at kotlin at sever-side but i want to init at android. Any course/video to start?
    h
    • 2
    • 1
  • n

    nwh

    01/21/2019, 12:05 AM
    What is everyone's database layer of choice for Android? (such as Room)
    a
    l
    +3
    • 6
    • 9
  • a

    Azhar

    01/21/2019, 8:48 AM
    what is the use of !! in kotlin
    g
    m
    • 3
    • 3
Powered by Linen
Title
a

Azhar

01/21/2019, 8:48 AM
what is the use of !! in kotlin
g

gildor

01/21/2019, 8:59 AM
#getting-started
m

Murtaza Hussain

01/21/2019, 9:11 AM
I call it
evil operator
but it used to when you a variable is nullable and you are sure it is not null
👍 1
a

Azhar

01/21/2019, 10:32 AM
👍
View count: 1