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

    izacus

    05/16/2017, 1:19 PM
    I'm fighting Hamcrest matchers where
    assertThat(list, IsIterableContainingInOrder.contains(anotherList))
    doesn't make the compiler type resolver happy.
    :stackoverflow: 1
    t
    • 2
    • 1
  • f

    f.babic

    05/16/2017, 2:28 PM
    yeah, but if I have a view, which has an ID, but is not used in the activity, for example I need a Relative layout construct
    l
    b
    • 3
    • 5
  • d

    damian

    05/16/2017, 3:15 PM
    @miha-x64 there's a KEEP in progress to add an option for it: https://github.com/Kotlin/KEEP/pull/33
    👍 2
    m
    • 2
    • 1
  • t

    thymecypher

    05/17/2017, 12:11 AM
    Compiles fine, but either the files have tons of errors like this, or I can spam the keyboard and get 0 errors - each file behaves different.
    t
    • 2
    • 1
  • d

    dragas

    05/17/2017, 11:41 AM
    I have a silly question. Various questions on SO and tutorials on the web suggest saving a listener interface in your
    AsyncTask
    to still keep a reference and publish progress to your fragment/activity/service/anything. Question stands, shouldn't it be
    WeakReference
    ? I'd assume that ART does not garbage collect running threads and if your application is suddenly ended, keeping a hard reference to your context will prevent ART from garbage collecting it.
    m
    k
    a
    • 4
    • 7
  • w

    wasyl

    05/17/2017, 2:09 PM
    Is Gradle Kotlin Script compatible with Android Studio 2.4? I’m trying to use it, but even
    buildscript
    method is unavailable
    v
    • 2
    • 6
  • k

    kirillrakhman

    05/17/2017, 9:18 PM
    I think I have it:
    ext.kotlin_version = '1.1.2-4'
    
        repositories {
            maven { url '<https://maven.google.com>' }
            jcenter()
        }
    f
    • 2
    • 4
  • k

    kreatio

    05/17/2017, 10:46 PM
    from reddit: if you have gradle issue on AS 3.0 just bump kotlin plugin version to 1.1.2-4 in build.gradle
    g
    b
    • 3
    • 2
  • r

    rudolf.hladik

    05/17/2017, 10:53 PM
    lot of official code samples for android available in kotlin on https://developer.android.com/samples but if you check some https://github.com/googlesamples/android-AutofillFramework/blob/master/kotlinApp/Application/src/main/java/com/example/android/autofillframework/app/LoginActivity.kt you will see lot of .!! is it ok?
    v
    k
    • 3
    • 2
  • j

    johnl

    05/17/2017, 10:55 PM
    but a guard statement which assigns to safe vals eliminates the issue
    s
    • 2
    • 3
  • z

    zak.taccardi

    05/17/2017, 11:49 PM
    anyone having an issue with
    kapt
    and the android gradle plugin v3.0 ?
    g
    • 2
    • 2
  • t

    trevjones

    05/18/2017, 12:01 AM
    Has anyone had issues with 1.1.2 causing your test/androidTest compile steps failing due to unresolved refs of classes in main/variant source sets?
    • 1
    • 1
  • i

    igoticecream

    05/18/2017, 4:39 AM
    That's because you have imported your setting of a previous version of AS with Kotlin plugin Delete ~/Library/Application Support/AndroidStudioPreview3.0/Kotlin folder and the IDE will use the built in 1.1.2-4 version when creating a new project
    d
    • 2
    • 2
  • b

    bamdmux

    05/18/2017, 7:30 AM
    I bought it when it was in early access, but if I'm not mistaken if you buy the physical book, you can get the ebook version for free
    a
    • 2
    • 1
  • s

    s.luhmirins

    05/18/2017, 7:37 AM
    you mean something like
    x?.let{} ?: run {}
    ?
    😕 1
    l
    • 2
    • 3
  • q

    quiro

    05/18/2017, 7:38 AM
    I feel like if you need an else case for
    let
    then you don't need
    let
    at all, what you want is really the classic if-else
    a
    • 2
    • 5
  • b

    bamdmux

    05/18/2017, 8:27 AM
    @lpirro Second best is Build Speed Improvements in android studio 3.0
    l
    • 2
    • 5
  • d

    Daniel

    05/18/2017, 8:56 AM
    Do you still need to specify the kotlin dependency in gradle with AS3.0?
    i
    • 2
    • 4
  • m

    Marc

    05/18/2017, 9:29 AM
    anyone facing:
    Unable to find method 'com.android.build.gradle.internal.variant.BaseVariantData.getOutputs()Ljava/util/List;'
    in android studio 3 with the new gradle version?
    v
    v
    • 3
    • 3
  • s

    stepango

    05/18/2017, 9:52 AM
    Is it safe to use kotlin-stdlib-jre8 on Android?
    v
    • 2
    • 2
  • s

    sushantpatekar

    05/18/2017, 9:56 AM
    can anybody help me how can i start ?
    v
    c
    +2
    • 5
    • 8
  • b

    bamdmux

    05/18/2017, 10:28 AM
    But on the other hand,
    Crtl+Shift+Alt k
    is gonna be missed
    😢 1
    r
    • 2
    • 6
  • p

    pp.amorim

    05/18/2017, 1:05 PM
    use both, no?
    l
    m
    +2
    • 5
    • 10
  • i

    inkihh

    05/18/2017, 2:07 PM
    Hey, is it possible for an app to play sound "into" an active phone call?
    🤔 1
    m
    • 2
    • 4
  • m

    moos3

    05/18/2017, 2:28 PM
    question, i'm trying to learn kotlin for android (I'm a BRAND Spanking new mobile developer) How would I handle authentication against my rest end point?
    v
    • 2
    • 6
  • f

    ferrytan

    05/18/2017, 6:02 PM
    Hi guys, i'm new with kotlin. do you have any kotlin libraries that should be noted or you usually use in your projects? i've seen Ravindra Kumar's repo, and wondering if there are any other interesing libraries i should aware of while developing Android with kotlin? cheers 🙂 https://github.com/ravidsrk/android-mvp-kotlin-starter
    l
    • 2
    • 3
  • s

    snitajui

    05/18/2017, 7:40 PM
    Hello everyone...um new at kotlin...wanna to learn it to develop android...how can I start it...!! Kindly help me with some tutorials link or helpful resources🙂
    t
    r
    b
    • 4
    • 5
  • m

    markyc

    05/18/2017, 7:53 PM
    Hey everyone, I’m integrating Kotlin into a project using Java 8, AS 3.0. I intend on removing
    @Data
    lombok annotations and using Kotlin data classes instead. However, I’m getting
    java.lang.ClassNotFoundException: kotlin.jvm.internal.Intrinsics
    , which seems to suggest my Kotlin code isn’t being brought into my project. I have in the global `build.gradle`:
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.2-4"
    and in my app module `build.gradle`:
    apply plugin: 'kotlin-android'
    d
    • 2
    • 4
  • d

    Daniel

    05/18/2017, 9:10 PM
    Whoever developed mockito-kotlin is a god. Its so nice to initialize and setup a mock in one line:
    val content: Draft = mock { on { baseline } doReturn 35 }
    👍 4
    m
    n
    • 3
    • 3
  • n

    ninjasudo

    05/18/2017, 9:15 PM
    Coroutines vs Promises: differences, benefits of one over the other, etc? I haven't touched Kotlin much yet, so I'm curious if there are some more experienced voices who could weigh in...
    u
    b
    • 3
    • 8
Powered by Linen
Title
n

ninjasudo

05/18/2017, 9:15 PM
Coroutines vs Promises: differences, benefits of one over the other, etc? I haven't touched Kotlin much yet, so I'm curious if there are some more experienced voices who could weigh in...
u

umar

05/19/2017, 12:01 AM
ninjasudo: Look at #coroutines channel In short, coroutines are like light weight threads. You can launch 100000 coroutines at once and don't get out of memory error. How you will use it depends on framework you chose. So, promises, rx, forkjoin, all can be wrapped by coroutines. Also, Kotlin has first class syntax for coroutines. You can write sequential nonblocking code as it was synchronous code, without nesting tons of callbacks. https://kotlinlang.org/docs/reference/coroutines.html#experimental-status-of-coroutines https://github.com/Kotlin/kotlinx.coroutines/blob/master/coroutines-guide.md
n

ninjasudo

05/19/2017, 12:07 AM
Thanks for the synopsis, I'll certainly look into it more. We're about to do a 3 day hackathon writing an app from scratch in Kotlin. I'm already used to Promises and asynchronous code flows. It's good to hear this is first class in Kotlin.
u

umar

05/19/2017, 12:28 AM
Here is low level API for coroutines https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.coroutines.experimental/index.html
b

blakelee

05/19/2017, 4:40 AM
@umar So it's coroutines < threads < processes?
u

umar

05/19/2017, 5:01 AM
I don't understand what you mean. Can you explain?
b

blakelee

05/19/2017, 7:29 AM
Coroutines are very portable. Threads have a little overhead, and processes a lot of overhead
u

umar

05/19/2017, 12:27 PM
Yes, they have very very small overhead
Understood you
View count: 9