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

    Jeremy

    05/17/2019, 4:43 PM
    You can take screenshots from your desktop also
    ➕ 12
    o
    g
    +2
    • 5
    • 5
  • i

    itnoles

    05/17/2019, 5:16 PM
    I think you can't do space between words
    u
    k
    g
    • 4
    • 4
  • t

    Tuan

    05/20/2019, 3:41 AM
    anyone here knowing the library can play link rtmp?
    p
    d
    • 3
    • 9
  • l

    Loránd

    05/20/2019, 9:18 AM
    I have begun using coroutines together with retrofit and added the call adapter to my retrofit builder. However whenever i put the device into flight mode and try to make a request it crashes the app with an exception that seems to be internal.
    Fatal Exception: java.net.UnknownHostException
    and
    Fatal Exception: java.net.SocketTimeoutException
    anyone that has had a similar issue before?
    v
    • 2
    • 4
  • i

    itnoles

    05/20/2019, 6:38 PM
    Android 3.5 Beta 2 added warning to open up with kts.
    l
    r
    • 3
    • 4
  • g

    Gautam Lad

    05/23/2019, 2:08 PM
    the reason i didnt try it is because the docs said:
    // alternatively - Lifecycles only (no ViewModel or LiveData). Some UI
        //     AndroidX libraries use this lightweight import for Lifecycle
        implementation "androidx.lifecycle:lifecycle-runtime:$lifecycle_version"
    m
    m
    • 3
    • 2
  • c

    czuckie

    05/24/2019, 9:29 AM
    gradle should be only executing tasks it needs to execute; the problem is when you want to have code coverage and you end up building with coverage enabled and then with coverage not enabled. I typically do compilation of instrumented classes upfront (quick verification the app compiles) and then run the tests. Then after tests have executed successfully, disable coverage and build all the product variants/flavours
    d
    • 2
    • 4
  • w

    Willy Njundong

    05/25/2019, 3:13 PM
    Can anyone point me to relevant docs?
    l
    g
    r
    • 4
    • 4
  • f

    Fredrik Larsen

    05/27/2019, 10:41 AM
    Hi, I'm having an issue building a release build
    More than one file was found with OS independent path 'META-INF/core-ktx_release.kotlin_module'
    Yes, I have a module named
    core-ktx
    and I'm guessing some other library has the same? I know you can exclude or pickFirst under packagingOptions, but I'm afraid that that will break something. As far as I know the
    kotlin_module
    is actually used by kotlin for various tasks. What is the proper solution here? I can rename the module, but this issue is bound to happen again. I find it peculiar that FQN is not used for this, but it's a bit over my head.
    r
    a
    • 3
    • 4
  • w

    Willy Njundong

    05/28/2019, 2:41 AM
    public class MainActivity extends Activity implements SurfaceTextureListener
    r
    g
    • 3
    • 3
  • l

    Loránd

    05/28/2019, 9:10 AM
    This might be an offtopic question but does anyone know what we are supposed to use now for implementing biometrics in our apps? The fingerprint manager is deprecated along with its permission and the androidx.biometric lib is still alpha.
    👌 1
    c
    • 2
    • 6
  • s

    Slackbot

    05/28/2019, 7:06 PM
    This message was deleted.
    t
    k
    l
    • 4
    • 4
  • k

    K0NN4

    05/28/2019, 11:14 PM
    https://gyazo.com/068de3e8367ca5bccdd73cfbdef42833 Why
    CLIENT_ID
    and
    REDIRECT_URI
    are
    Unsresolved references
    i
    c
    • 3
    • 7
  • w

    Willy Njundong

    05/29/2019, 6:59 AM
    I can't quite understand what this syntax is:
    private val surfaceTextureListener = object : TextureView.SurfaceTextureListener {
    
            override fun onSurfaceTextureAvailable(texture: SurfaceTexture, width: Int, height: Int) {
            //...
        }
    g
    • 2
    • 7
  • w

    Willy Njundong

    05/29/2019, 7:27 AM
    Is there any sort of difference I should be looking out for here:
    if (permission != PackageManager.PERMISSION_GRANTED)
    vs
    if (permission == PackageManager.PERMISSION_DENIED)
    g
    m
    • 3
    • 2
  • a

    Alf_

    05/29/2019, 8:39 AM
    Does anyone know how to do this in Kotlin?
    c
    a
    • 3
    • 3
  • k

    K0NN4

    05/29/2019, 10:16 AM
    I am trying to follow this tutorial: https://tolkiana.com/how-to-use-spotifys-sdk-in-kotlin/ But My code says that function
    connect
    is
    Unresolved reference
    : https://gyazo.com/3d631c4c65501d0ac6025ecb63cdb74c Here is "SpotifyService" class: https://gyazo.com/ae55413d281f65b56abfcd2e3823a79f
    g
    • 2
    • 1
  • f

    fradiati

    05/29/2019, 11:01 AM
    is there any good exaple to do this?
    i
    • 2
    • 5
  • a

    abicelis

    05/29/2019, 8:22 PM
    Hey community, I've been trying to update my Gradle
    build
    and
    settings
    files to KotlinDSL (Mainly following this guide: https://antonioleiva.com/kotlin-dsl-gradle/) which recommends using a buildSrc Gradle module. Everything seems to be working and gradle builds fine, however, I'm getting this warning:
    WARNING: Unsupported Kotlin plugin version.
    The `embedded-kotlin` and `kotlin-dsl` plugins rely on features of Kotlin `1.3.11` that might work differently than in the requested version `1.3.31`.
    i
    g
    • 3
    • 9
  • r

    rajatarora2812

    05/30/2019, 3:47 AM
    Hi. Can someone please answer this Why kapt plugin is required for annotation processor in koltin?
    n
    g
    • 3
    • 3
  • i

    Ive Vasiljevic

    05/30/2019, 11:09 AM
    Can anyone explain what is by activityViewModels(), by fragmentViewModels(), by existingViewModels() and so on used for. I get the idea that by activityVideModels() is used for shared viewModels between mutliple fragments that need to use data from the same viewModel, but how does it work..Do I actually need to extend activity with that viewModel or what? Do I need to specifiy viewModel factory or not?
    l
    • 2
    • 2
  • i

    Ive Vasiljevic

    05/30/2019, 1:06 PM
    In Android Kotlin is it better to use Enums or StringDef, IntDef annotations
    a
    • 2
    • 1
  • o

    oday

    05/30/2019, 7:22 PM
    simpleUML, PlantUML, none seem to be budging
    c
    g
    • 3
    • 6
  • t

    Tuan Kiet

    05/31/2019, 7:46 AM
    and what are those
    kotlin_module
    for?
    g
    • 2
    • 2
  • p

    prateek aggarwal

    05/31/2019, 2:22 PM
    Hello everyone , we are using sqlBrite and I was trying to add colum for particular table but I am facing some weird issue related to kotlin code gen. We are using "org.jetbrains.kotlin:kotlin-stdlib:1.3.31"
    That_Issue___.txt
    g
    • 2
    • 1
  • g

    gabrielfv

    05/31/2019, 6:10 PM
    For some reason
    run<MyActivity> { ... }
    can be read as calling the fragment version
    • 1
    • 3
  • a

    Allan Wang

    06/04/2019, 12:37 AM
    Does anyone have a multi module project with a kotlin gradle plugin? I have an existing plugin (https://github.com/AllanWang/KAU/tree/dev/buildSrc) and I’d like to convert it to use kotlin, but I seem to be missing some dependencies. Looking at other examples online (https://www.klg71.de/post/kotlin_gradle_plugin/), it seems like adding the kotlin plugin should fix it, but I’m getting more errors which makes me believe my root build gradle is wrong
    g
    • 2
    • 59
  • s

    Sean Massie

    06/04/2019, 3:56 AM
    Hey everyone, I've been working with Kotlin in back end services for a while now and absolutely love it. I've been interesting in the android side of things and was wondering. What are the best resources (Books, courses) which focus more on learning android and less teaching Kotlin basics.
    a
    b
    • 3
    • 6
  • g

    ghosalmartin

    06/04/2019, 12:59 PM
    not strictly Kotlin only but is there any issue with not recycling TypedArrays if it can be helped, will they be gc down the line either way?
    g
    • 2
    • 2
  • v

    Vague

    06/04/2019, 1:57 PM
    Should I use DataBinding in a RecyclerView? Or is it an overkill?
    e
    r
    +2
    • 5
    • 14
Powered by Linen
Title
v

Vague

06/04/2019, 1:57 PM
Should I use DataBinding in a RecyclerView? Or is it an overkill?
e

escodro

06/04/2019, 1:58 PM
In the component or in the items? In the RecyclerView itself, it may be not necessary. But in the items is a good call to avoid ViewHolders.
You can use a more generic solution for all Adapters with Data Binding. https://github.com/igorescodro/alkaa/blob/master/app/src/main/java/com/escodro/alkaa/common/databinding/BindingHolder.kt
v

Vague

06/04/2019, 2:05 PM
Using it in place of findViewById...
e

escodro

06/04/2019, 2:07 PM
You can simply use Kotlin Synthetic access for it. Or wait for the new View Binding. 😊
➕ 1
v

Vague

06/04/2019, 2:11 PM
Meh, yeah... Kotlin Synthetic in comparison to DataBinding, any performance difference or tradeoffs?
e

escodro

06/04/2019, 2:13 PM
That was shown in Google IO. The "???" Is the new View Binding.
v

Vague

06/04/2019, 2:17 PM
I'm guessing it's not stable yet?
e

escodro

06/04/2019, 2:24 PM
No, it is not. I would go with Synthetic if you only need the
findViewById
. Data Binding seems like a overkill.
v

Vague

06/04/2019, 2:28 PM
Okay... Thanks
😊 1
r

rook

06/04/2019, 4:15 PM
My information might be out-of-date, but one consideration you might make is that synthetics in `ViewHolder`s have to be re-evaluated every time it is reused. This can affect performance
👍 1
g

ghedeon

06/04/2019, 4:31 PM
isn't it what
LayoutContainer
for? Iirc it will be cached.
r

rook

06/04/2019, 7:16 PM
You’re correct. I wasn’t aware of
LayoutContainer
until you mentioned it. Relevant docs: https://kotlinlang.org/docs/tutorials/android-plugin.html#layoutcontainer-support
s

Sergio C.

06/04/2019, 10:43 PM
What's the objective of layout container?
View count: 5