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

    am414

    05/11/2019, 8:18 PM
    hello, guys, I have a question related to Android, I have a small screen and that thing annoying me it shows 2 statements per line I just need one I searched many times with no luck to solve 😕
    d
    a
    • 3
    • 3
  • a

    Andy Victors

    05/11/2019, 8:24 PM
    Has
    <http://Dispatchers.IO|Dispatchers.IO>
    been deprecated/removed? Documentation says it exist but it's not available in code (coroutines version
    1.1.1
    )
    d
    s
    i
    • 4
    • 6
  • t

    thijs

    05/12/2019, 8:10 AM
    I checkout the AOSP and tried out Jet Pack Compose, here are my first findings: https://medium.com/q42-engineering/android-jetpack-compose-895b7fd04bf4
    o
    • 2
    • 1
  • t

    thijs

    05/12/2019, 8:11 AM
    When diving further into the framework, what kind of thing should I look at? What are you curious about the internals?
    p
    • 2
    • 2
  • h

    Heart D

    05/12/2019, 5:54 PM
    hey guys, i would like to to know how to get the logitudes and latitudes and send as text message to a number
    How_to_get_the_fetched_latitudes_and_longitudes_and_send_them_as_message.txt
    l
    r
    • 3
    • 2
  • p

    phelat

    05/12/2019, 7:44 PM
    Hey guys I’ve developed a library for those who are using JetPack’s Navigation component. Basically it’s
    startActivityForResult
    but for Fragments. No more shared ViewModel boilerplate just for sharing data between two Fragments! https://github.com/PHELAT/NavigationResult
    👍 4
    g
    f
    • 3
    • 2
  • v

    vitrox1

    05/13/2019, 7:11 AM
    hi guys, is only me or with latest kotlin update on my app we are facing strange behavior with support-library like shapes not being rendered properly because some support components just don’t read the value of some properties ,with my team we verified that only changing the kotlin version generate the problem.
    c
    • 2
    • 4
  • h

    Heart D

    05/13/2019, 8:13 AM
    help
    :google: 11
    :stackoverflow: 12
    🤷‍♂️ 5
    🤦‍♂️🏾 5
    d
    • 2
    • 1
  • j

    Jan

    05/13/2019, 11:58 AM
    hi, can someone explain to me why the first class which uses anymous object: implementation doesn't work but the 2nd example does work? first example shows the log message, the 2nd one doesn't, it seems like the listener isn't inside the app after compile (disclaimer i'm using r8/d8)
    object_.kt
    🤷‍♂️ 3
    d
    h
    • 3
    • 3
  • a

    Andy Victors

    05/13/2019, 12:36 PM
    Does anyone have a working example of using
    ktor
    in MPP environment, specifically on iOS where currently only Main-Thread Dispatcher is offered (https://github.com/Kotlin/kotlinx.coroutines/issues/462)?
    j
    • 2
    • 1
  • d

    dave

    05/13/2019, 1:42 PM
    Hi guys. I have a prod app which currently have several UI tests implemented with Espresso. Our tests are running against a kind of complex mocked dev backend. So far so good, BUT, now we are having issues with concurrent tests and the state of our dev DB in the mocked backend. we are developing Android + iOS apps and both are fighting for changing the state of our backend. Recently we decided to go for an in-app mocked server, in Android with MockWebServer by providing the raw responses as JSON. This approach seems to be correct at the beginning but while updating our UI tests it proves to start becoming very complex since the state of the backend changes according to the action of the user and in our test we can't guarantee that the proper json is ready after certain async task finishes. Do you have any advice? Do you have any idea on how are companies like Facebook, Google Ui testing their apps? Thanks, kind regards
    :stackoverflow: 4
    :google: 3
    s
    c
    • 3
    • 3
  • w

    william

    05/13/2019, 6:09 PM
    do you guys think its better to send a bundle to each fragment (that requires identifiers about things they are showing) or to use some injected object that holds this state for each fragment, which the fragment can refer to
    l
    p
    +2
    • 5
    • 17
  • g

    Gabriela Banica

    05/14/2019, 9:10 AM
    Hi! Does anyone know if App Linking is working only if the url is a production link? I tried with a testing webserver which is visible only from my local network but it is not working.
    :stackoverflow: 2
    g
    • 2
    • 2
  • t

    Timo Obereder

    05/14/2019, 11:10 AM
    i read this a few months back, but the team i’m working with wants to just use kotlin extensions, which would be fine to me, but then again i also don’t like databinding (it’s a personal thing) that much either and they want to remove kotterknife -> https://www.reddit.com/r/androiddev/comments/ala9p2/why_kotlinx_synthetic_is_no_longer_a_recommended/ ….what do other teams use here? does anyone know if there is something new coming up in regards of that?
    g
    f
    • 3
    • 2
  • p

    Peter Fortuin

    05/14/2019, 11:11 AM
    We use databinding as much as possible.
    s
    • 2
    • 1
  • t

    Timo Obereder

    05/14/2019, 11:16 AM
    i mean, there is a use case for viewmodels that we have…question is if it’s really worth it to have marginalized code in viewmodels regarding the usage of databinding
    g
    • 2
    • 1
  • d

    DevMike01

    05/14/2019, 11:47 AM
    I built a library that make reading and writting to SharedPreferences easy with kotlin. Please check it out https://github.com/devmike01/JadeSharedPreference . Please star if you like it.
    👍 1
    t
    • 2
    • 3
  • m

    Matej Drobnič

    05/14/2019, 12:08 PM
    what advantage does this have over property delegate based shared preference access
    m
    • 2
    • 1
  • a

    Andy Victors

    05/14/2019, 12:14 PM
    I'm getting
    Unresolved reference
    for `ktor`symbols inside the MPP code. This should be solved by adding
    enableFeaturePreview("GRADLE_METADATA")
    but then I get error messages on other dependencies:
    Caused by: java.lang.RuntimeException: Unsupported format version '0.3' specified in module metadata. This version of Gradle supports format version 0.4 only.
    	at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.ModuleMetadataParser$1.transform(ModuleMetadataParser.java:80)
    . It is possible to have a workaround to have both?
    r
    • 2
    • 17
  • w

    william

    05/14/2019, 9:52 PM
    in my application i have one activity and many fragments. in my activity layout i have added a toolbar but in one of my fragments i would like to have the navigation drawer cover it but im not sure how to do that since the toolbar is in a parent view. any ideas?
    :google: 8
    :stackoverflow: 11
    l
    • 2
    • 1
  • m

    matt tighe

    05/15/2019, 6:37 PM
    i’m prepping for Q changes. is something like this an antipattern?
    inline val Context.storageRoot: File
        get() = this.getExternalFilesDir(null) ?: run {
            val storageRoot = File(this.filesDir, "storage")
            storageRoot.mkdirs()
            storageRoot
        }
    a
    • 2
    • 2
  • j

    jw

    05/16/2019, 3:09 AM
    Does seem related to Kotlin other than the fact that you wrote it in Kotlin
    ☝️ 1
    m
    • 2
    • 1
  • p

    Paulius Ruminas

    05/16/2019, 8:35 AM
    Hi, I have a Java SAM interface with internal modifier for the single method
    void invoke();
    . I use that SAM interface as a lambda expression in Kotlin from a different package. If I run this code from Android studio I don't get any runtime exception but if I bundle it into an APK then I receive
    java.lang.IllegalAccessError
    . Why is that?
    g
    • 2
    • 2
  • t

    tseisel

    05/16/2019, 9:31 AM
    I am trying to write an extension for integrating
    Glide
    with coroutines :
    suspend fun RequestBuilder<Bitmap>.intoBitmap(width: Int, height: Int): Bitmap?
    I expect that function to : 1. load a
    Bitmap
    (or
    Drawable
    ) with the specified dimensions, 2. suspend until loaded (be it successful or failed), 3. gracefully handle cancellation. Do you have any guidance, or maybe a library that already does that ?
    g
    • 2
    • 3
  • k

    Kulwinder Singh

    05/16/2019, 10:09 AM
    Hi, i am trying to use
    coroutines
    using
    'androidx.lifecycle:lifecycle-extensions:2.2.0-alpha01'
    which is latest version but i'm unable to get
    viewLifecycleOwner.lifecycleScope.launch {}//here lifecycleScope is not available
    , what i'm missing ?
    l
    • 2
    • 9
  • g

    Gil Goldzweig

    05/17/2019, 6:42 AM
    Anyone succeeded in creating a custom component in jetpack compose? I'm facing an internal code analysis compilation error
    a
    f
    • 3
    • 4
  • s

    scottiedog45

    05/17/2019, 8:12 AM
    I’m not sure where to ask this question exactly but I just want to confirm - an Instant app is just a “section” (?) of your aab, it’s not another… copied part of your source code? So when a user gets the instant app, then downloads the full app, they’re “adding” the rest of the app to the instant app?
    :google: 3
    g
    • 2
    • 1
  • a

    Aadish Goel

    05/17/2019, 9:53 AM
    Do Anybody know why Play Store not showing my apps latest version, In play console i have rolled out 1.7 for 100% users but but play store showing only 1.6. I have confirmed this in 5-10 devices and even after uninstalling the current app.
    :google: 4
    d
    f
    +2
    • 5
    • 4
  • m

    Markus

    05/17/2019, 12:57 PM
    Is anyone here using Kovenant for background tasks? I don’t understand how to catch exceptions thrown in the lambda try { task { doSomething() } successUI { throw Exception() } } catch (e:Exception) {} // This will not catch anything
    l
    • 2
    • 6
  • u

    Uraniam9

    05/17/2019, 4:35 PM
    :google: 1
    😂 4
    😔 1
    :stackoverflow: 1
    🤦‍♂️ 14
    r
    • 2
    • 1
Powered by Linen
Title
u

Uraniam9

05/17/2019, 4:35 PM
:google: 1
😂 4
😔 1
:stackoverflow: 1
🤦‍♂️ 14
r

rishabhsinghbisht

05/18/2019, 10:31 AM
That’s a variable name. A variable name cannot have space in between. If you were trying to do this for readability try Camel Case. Don’t understand why else you would even want this.
View count: 2