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

    alex.tavella

    09/16/2019, 5:26 PM
    Hello all, is there any way to test a
    RecyclerView.Adapter
    on a local VM? I have mocked some stuff but I'm getting a NPE when
    notifyDataSetChanged
    gets called
    s
    c
    • 3
    • 10
  • t

    Travis Griggs

    09/16/2019, 8:09 PM
    I have a long question about programmatic vs design/xml UI using kotlin in Android; coming from an iOS/Swift background. I’ll post the body of the question as a threaded reply to this to avoid a ginormous post here.
    r
    s
    +3
    • 6
    • 35
  • r

    rkeazor

    09/17/2019, 11:41 AM
    has anyone ran into issues with jacoco and Kotlin? Such as execution data not matching for certain class files
    w
    • 2
    • 5
  • a

    akhu

    09/17/2019, 2:24 PM
    Hey guys ! A quick question, maybe too much technical. Did you ever experienced a bigger app size (on device, via playstore installation) when using Kotlin instead of Java ? Did the add of kotlin std lib to the apk is managed on device by the playstore or gservice ?
    s
    c
    +2
    • 5
    • 6
  • s

    Sam

    09/17/2019, 3:13 PM
    Hello everybody,
    AsyncLayoutInflater
    which kind of situation to using it? thanks
    👍 1
    :stackoverflow: 4
    g
    • 2
    • 1
  • m

    M0udi

    09/18/2019, 9:19 AM
    Hey everyone,fast question!, I'm looking into the CameraX library, I wonder if its possible to make it Continuous scanning on barcodes with the use of firebase ml kit?
    g
    r
    • 3
    • 4
  • z

    zkeme

    09/18/2019, 1:14 PM
    That's what I'm guessing it is yeah
    g
    • 2
    • 3
  • r

    Robert Menke

    09/18/2019, 3:18 PM
    Hey, how do you all distribute builds that may be pointing to QA servers to test a feature. For example, pretend you’re fixing a server-side bug that impacts an android app and need a QA team to verify the fix. How do you distribute the APK? Manually building it via android studio or distributing it through an alpha/beta track in the play store both seem wrong.
    k
    r
    +5
    • 8
    • 15
  • a

    Amirul Zin

    09/19/2019, 1:51 AM
    AS 3.6 Canary 12 users heads up: It seems like ConstraintLayout
    2.0.0-beta2
    is still broken in AS
    3.6 Canary 12
    , with AGP
    3.6.0-alpha12
    . It was previously broken on
    3.6 Canary 11
    with AGP
    3.6.0-alpha11
    as well. Some resource linkage is broken when building, e.g.
    AAPT: error: resource attr/flow_horizontalSeparator not found
    AAPT: error: resource attr/motionProgress not found.
    It was previously working fine in AGP
    3.6.0-alpha10
    . Issue tracked on : https://issuetracker.google.com/issues/140678030 Possibly related to: https://issuetracker.google.com/issues/140882056
    w
    • 2
    • 4
  • s

    Sergio C.

    09/19/2019, 9:38 AM
    hello people, Anyone using kotlin DSL to manage gradle builds? Is it worth it? What impact does it have in build speed?
    r
    r
    +3
    • 6
    • 8
  • t

    Taha

    09/19/2019, 3:11 PM
    Hello guys I have a question regarding the flatmap for kotlin and rxjava2. I have an observable of a data class that has a nested list
    fun getCenterServiceCategories() : Single<CenterServiceCategories>
    // ..
    data class CenterServiceCategories(
        val meta: MetaResponse,
        val data: List<ServiceCategory>
    )
    what I want to do The ServiceCategory also has a list of ids that I want to loop through and eventually return a flatmap that has the list of categories with their services embedded. The problem is that I cannot call
    getCenterServiceCategories().flatmap{ 
    //...
    }
    since the list is actually the data property. i have tried subscribing and getting the data onSubscribe and using Kotlins map and flatmap, but I want to do that with RX any suggestions?
    l
    • 2
    • 4
  • k

    Kulwinder Singh

    09/20/2019, 10:32 AM
    How to pre-cache images using Glide ?, i want to pre cache images from
    res/drawable
    folder. sorry i know it not related to kotlin but i'm unable to find good answer
    :stackoverflow: 8
    m
    • 2
    • 2
  • d

    dave

    09/20/2019, 3:01 PM
    Hi there guys, I'm using navigation, single activity and fragments + dialogs + main fragment is a google map. Issue, doing things like:
    alert(getString(R.string.MY_MESSAGE)) {
                yesButton {
                    it.dismiss() // TODO investigate navigation from dialogs and lag
                    navigateTo(actionMapFragmentToOtherFragment()) }
                noButton {}
            }.show()
    The app freezes when navigating back to the map. Ideas?
    • 1
    • 1
  • m

    mattinger

    09/20/2019, 3:17 PM
    So, opinions, is kotlin synthetics for android dead now due to view binding being a built in feature to the gradle plugin in 3.6?
    z
    • 2
    • 1
  • m

    Morgan

    09/20/2019, 6:53 PM
    Hello. Not sure if this question is for here or #getting-started but… If I wanted to start learning Android app development would I be better off learning Kotlin first or Java? (it would be my first proper programming language outside of learning the basics in a few back in college)
    k
    a
    l
    • 4
    • 17
  • m

    Mohamed Ibrahim

    09/21/2019, 8:31 AM
    Does anyone way to implement a two pages viewpager so it shows like a book, giving that I could add a page turn flip, I tried to override
    getPageWidth()
    but this will not be helpful when adding animation
    h
    • 2
    • 3
  • k

    Kulwinder Singh

    09/22/2019, 5:09 AM
    I have nested fragments and then Using
    ktx
    function
    by viewModels
    how can i get parent Fragment's
    ViewModel
    ? I have tried this
    private val homeViewModel by parentFragment!!.viewModels<HomeViewModel>()
    but it did not worked
    t
    • 2
    • 1
  • s

    Sergio C.

    09/22/2019, 9:08 PM
    hello people How can I convert this to kotlin DSL?
    debugimplementation = "com.squareup.leakcanary:leakcanary-android:$Versions.leakCanary"
    p
    l
    g
    • 4
    • 16
  • s

    Sam

    09/23/2019, 7:16 AM
    Hello everyone, I use this
    <https://jitpack.io>
    to distribute my library , but I only want to distribute specify module
    Navigation
    without app and dependencies in app layer . so How to do it on Jitpack . Thanks
    <https://github.com/chihung93/Space-Navigation-V2>
    g
    • 2
    • 2
  • d

    Duchynko

    09/23/2019, 9:39 AM
    onCreate.kt
    w
    • 2
    • 7
  • l

    Luis Munoz

    09/23/2019, 4:10 PM
    Can someone share a recommendations for the best android book for experienced developers but no android experience
    l
    j
    +2
    • 5
    • 8
  • d

    dimsuz

    09/23/2019, 5:57 PM
    Does any one have ideas on why gradle could produce an unsigned apk? I do properly setup signing configs, I checked and rechecked. I even diffed my
    build.gradle
    with another project which has exaclty same signing configs and produces a signed apk, but this one isn't.
    $ jarsigner -verify /path/to/apk
    
    jar is unsigned
    :stackoverflow: 2
    j
    • 2
    • 9
  • r

    Rakesh Kumar

    09/24/2019, 7:57 AM
    Alarm fired once, but getting same time slot alarm twice
    :stackoverflow: 7
    g
    • 2
    • 13
  • a

    arekolek

    09/24/2019, 3:10 PM
    I think it is becoming common knowledge that using
    @JvmOverloads
    for custom views on Android can bite you if you don’t do it properly. What I haven’t seen in this discussion yet, is that most probably (because in Kotlin
    final
    is the default), you only need the 2 constructors in your custom view, and so you should be just fine using
    @JvmOverloads
    for it. https://medium.com/@arekolek/all-your-classes-are-final-so-why-do-you-even-need-the-3-argument-constructor-d35553dd6347 What do you think?
    👍 2
    w
    • 2
    • 2
  • m

    Marko Mitic

    09/24/2019, 5:42 PM
    @jw any chance of R8 not failing when it runs into Dexguard rules? https://issuetracker.google.com/issues/141515605
    j
    • 2
    • 3
  • p

    Paul Dhaliwal

    09/24/2019, 6:54 PM
    I’m trying to create a BindingAdapter in my customer view but the changes won’t take effect. As an example the custom view can take in a color and draw a rounded rectangle with it. Everything works correctly reading the custom attributes from attrs file, where the color is fetched in the CustomView’s init{} block, then the color of the paint object is set to this color and in onDraw() the shape is drawn correctly. However if I try to use a BindingAdapter with Data Binding Library, the color isn’t applied. The code for the BindingAdapter is inside the custom view like this:
    companion object {
            @BindingAdapter(“app:bgColor”)
            @JvmStatic
            fun setColor(view: ElevatedFrameLayoutWithBinding, color: String) {
                view.backgroundPaint.color = Color.parseColor(color)
            }
        }
    Edit: After further investigation when using the above code onDraw() for the custom view isn’t called, however if I add the attribute normally without Data Binding and the BindingAdapter onDraw() is called as normal.
    • 1
    • 1
  • m

    matt tighe

    09/25/2019, 10:23 PM
    seems easier than trying to make the view controllers `LifecycleOwner`s and observing livedata
    a
    • 2
    • 3
  • d

    doodla

    09/25/2019, 11:55 PM
    not kotlin related, but android related.
    g
    • 2
    • 1
  • d

    doodla

    09/25/2019, 11:56 PM
    Name: Pixel_2_API_28
        Path: /Users/sridhar.vadlamani/.android/avd/Pixel_2_API_28.avd
       Error: Google pixel_2 no longer exists as a device
    I’m getting a bunch of those.
    :stackoverflow: 2
    a
    • 2
    • 1
  • g

    Geert

    09/26/2019, 8:55 AM
    I have been out of JSON Parsing lately, what kind of libraries do the most of you use currently? I find lots of them on Github
    m
    e
    +3
    • 6
    • 9
Powered by Linen
Title
g

Geert

09/26/2019, 8:55 AM
I have been out of JSON Parsing lately, what kind of libraries do the most of you use currently? I find lots of them on Github
m

Mark McCormick

09/26/2019, 8:57 AM
Moshi and Gson
e

Efe

09/26/2019, 8:59 AM
moshi
g

Geert

09/26/2019, 9:03 AM
I used GSON before that was a bit deprecated on Kotlin inline classes
s

sindrenm

09/26/2019, 9:06 AM
Moshi. Or, if you feel like it, you could have a go at kotlinx.serialization: https://github.com/Kotlin/kotlinx.serialization
j

jw

09/26/2019, 12:03 PM
Moshi or kotlinx.serialization. Gson is dead in the water.
a

ahulyk

09/26/2019, 12:07 PM
https://github.com/ahulyk/android-json-benchmark
kotlinx.serialization rocks 🔥
j

jw

09/26/2019, 12:23 PM
Whatever those benchmarks show, it's not going to be representative for Moshi because it uses a String instead of bytes as its input which is not how you would use it in practice (and not the path it's optimized for)
👍 1
a

ahulyk

09/26/2019, 12:51 PM
will try to fix it
View count: 1