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

    hallvard

    01/21/2019, 8:55 AM
    It's for declaring that you're certain about a (nullable) object not being null. You could ask more about it in #getting-started, for instance.
    a
    g
    • 3
    • 2
  • r

    rook

    01/21/2019, 4:52 PM
    I’m having trouble locating documentation for Kotlin Gradle documentation pertaining specifically to Android. Does anyone have a good resource?
    m
    g
    • 3
    • 4
  • r

    rajkumar

    01/22/2019, 6:05 AM
    When we use Android APIs( e.x. AppCompatActivity) from Kotlin code, does that mean they have developed Kotlin wrapper around existing Android SDK?
    s
    d
    z
    • 4
    • 4
  • a

    Azhar

    01/22/2019, 7:39 AM
    how to write a kotlin model class
    :stackoverflow: 6
    m
    l
    +2
    • 5
    • 11
  • n

    nerdstone

    01/22/2019, 2:24 PM
    This is the error
    -.kt
    r
    b
    • 3
    • 8
  • d

    Darryl

    01/22/2019, 5:42 PM
    Does anyone know if Kotlin 1.3 is backwards compatible with 1.2? Got a library using Kotlin and want to know if upgrading to 1.3 will be a big deal for apps that are using 1.2
    d
    l
    • 3
    • 6
  • a

    Aamer Paul

    01/22/2019, 6:04 PM
    If the same type parameter needs more than one upper bound, we need a separate where-clause. However i'm getting error at line no. 5. Please help!
    Upper_bounds.kt
    a
    a
    • 3
    • 7
  • k

    kevin.cianfarini

    01/22/2019, 7:18 PM
    What's the best way to do resource plural strings with placeholders when the string contains two different words that can be plural?
    a
    • 2
    • 1
  • n

    NewtonD20

    01/22/2019, 11:52 PM
    I'm new to Kotlin ... What tutorial do you recommend? I have Android Studio 3.2.1
    l
    l
    • 3
    • 3
  • a

    anthony castillo

    01/23/2019, 12:31 AM
    hi guys. i’ve been using kotlin server side for little bit now, and thought of learning using it for android as well. can you direct me to some helpful resources to kick start this plan of mine? i also dont have experience with android development, so this might be challenging 😄
    a
    • 2
    • 5
  • a

    Alf_

    01/23/2019, 11:09 AM
    Guys, I am receiving as a parameter in a override function a String that must to be transformed to lowercase. Is possible to do this in param declaration?
    r
    • 2
    • 1
  • a

    Alf_

    01/23/2019, 11:12 AM
    -.txt
    h
    a
    • 3
    • 3
  • v

    Vishal Roy

    01/23/2019, 11:42 AM
    Hi guys I want to implement a tour guide on app launch in my android app, like using transparent screen, any good library for that in kotlin?
    :google: 7
    a
    • 2
    • 1
  • c

    Cake

    01/23/2019, 8:42 PM
    Hey guys, what can I use for Android static analysis? Thanks in advance 😁
    h
    c
    +2
    • 5
    • 7
  • n

    Nikky

    01/24/2019, 3:40 AM
    in Fuel i am trying to update it to kotlin 1.3.20, but our android sample blows up with these messages: https://gist.github.com/NikkyAI/e665290892529a428c1ba3fc2fcc4ea0 i have never worked with android before (apart from a small project back in school years ago) and i have honestly no clue what this may mean
    g
    e
    • 3
    • 3
  • a

    Anuj Sinha

    01/24/2019, 7:01 AM
    I am new in kotlin language. Please suggest me some good tutorials for learn kotlin for Android. I have experience in android with java. Thanks in advance.
    g
    m
    • 3
    • 4
  • a

    Animesh

    01/24/2019, 7:41 AM
    Hey Guys, I am facing issue regarding mockito test case for coroutines. It is not executing api call function. Please have a look below code. It is MVP based structure //MVP Structure GlobalScope.launch { // API CALL ON MAIN THREAD val result = //Model return some values GlobalScope.launch(Dispatchers.Main) { when (result) { is APIResult.Success ->(result.response.data) is APIResult.Failure -> parseException(result.details) } } } } Any suggestion?
    h
    m
    • 3
    • 4
  • f

    Fatih.Yalmanbas

    01/24/2019, 8:28 PM
    Hello people, I have a weird issue. While im building/compiling my android application that has kotlin and java parts it takes about 10-15 mins. When i check gradle logs i see a statement like “could not connect to kotlin daemon. using fallback strategy.” which is true since i can see 2+ kotlin compiler daemon processes. How can i find the root cause for this problem?
    r
    • 2
    • 2
  • d

    Dico

    01/24/2019, 9:50 PM
    Is it possible to open an android project that is a child project of a kotlin multiplatform project with Android Studio? If not, are there any caveats to using IntelliJ to develop on Android?
    l
    d
    s
    • 4
    • 9
  • j

    jurajsolarml

    01/25/2019, 3:01 PM
    Hello,Please can you help me ? I am beginner. Where can be a bug ? /Kotlin/ Thanks
    :google: 1
    :stackoverflow: 8
    h
    g
    +3
    • 6
    • 8
  • c

    Cake

    01/26/2019, 2:48 AM
    Hey guys, can anyone help me with this? I have to get an object from Cache and this is the way that I do... Does anyone have a better way to do this?
    -.kt
    :google: 5
    a
    j
    • 3
    • 2
  • i

    Icaro Temponi

    01/27/2019, 1:49 AM
    Is anyone using MvRx? How good is it? Any recommendation of a lib or framework to tame the "dragon called state"? I feel like I could optimize my workflow by containing mutations and impurities (in a FP sense) and would like to ask you some recommendations about this kind of tools.
    :google: 2
    d
    g
    j
    • 4
    • 25
  • y

    yshrsmz

    01/28/2019, 1:23 AM
    Room creates a json file containing its schema information. If you look at it, you'll find a create statement for each table.
    👍 1
    l
    • 2
    • 4
  • w

    waylander

    01/28/2019, 6:57 AM
    Hi, my colleague run unit test's on kotlin ( he used mockk) and saw speed of executes test's more slowly than java. why ? what is better use for unit test's on kotlin ( some libraries) ?
    g
    • 2
    • 3
  • r

    rishabhsinghbisht

    01/28/2019, 7:31 AM
    Android synthetic imports suddenly stopped working for me. Any idea what’s happening. Imports seems to be working or AppCompatActivity but not for v4.app.Fragment
    k
    • 2
    • 3
  • g

    Gil Goldzweig

    01/28/2019, 7:00 PM
    Does anyone knows if there is a way to properly mock a suspend function?
    d
    • 2
    • 3
  • l

    Luca

    01/29/2019, 5:05 AM
    Anyone have any idea why Gradle is redownloading the Kotlin native dependencies every time I sync Gradle in Android Studio 3.3? Why isn't it using a cached version? It is killing my build times. I am using the multiplatform plugin
    g
    i
    • 3
    • 4
  • s

    sewon

    01/29/2019, 8:38 AM
    I used kotlin lazy property in serializeable class. It works well in debug mode build, but crashed in release build (with proguard). I've solve this issue by adding below rule to proguard settings.
    -keepclassmembers class * {
     *** writeReplace();
    }
    androdi application code: https://gist.github.com/kingori/518e8afcb6fb4d90b81eb8348395f39e post on this issue( in Korean) : https://steemit.com/kotlin/@kingori2/kotlin-lazy-field-serialize-proguard
    g
    • 2
    • 7
  • k

    kd

    01/29/2019, 7:15 PM
    In a non lifecycle class, how should we use coroutines? I have read that your class should extend CoroutineScope if it is a lifecycle class (Activity, fragment, viewmodel). But in just a simple business logic class, how would you use CoroutineScope?
    a
    g
    +2
    • 5
    • 34
  • x

    xenoterracide

    01/29/2019, 10:10 PM
    so I haven’t done any android dev, but am working on a library that needs to be android compatible. 1. do I need to use the android plugin for release? (and/or split -android/jre jars) 2. how can I test that it works on … dalvik? the android jvm.
    a
    • 2
    • 7
Powered by Linen
Title
x

xenoterracide

01/29/2019, 10:10 PM
so I haven’t done any android dev, but am working on a library that needs to be android compatible. 1. do I need to use the android plugin for release? (and/or split -android/jre jars) 2. how can I test that it works on … dalvik? the android jvm.
a

Allan Wang

01/29/2019, 10:11 PM
You can use the java-library plugin if your library isn’t solely for android. However, not that depending on the android version, you will not have access to a lot of Java packages (as well as Java 8)
x

xenoterracide

01/29/2019, 10:14 PM
how can I test that? currently using kotlin for language so I figure I’m mostly good there? but I’m not even sure if I need to make changes for that
a

Allan Wang

01/29/2019, 10:15 PM
I’ve never personally had any compatibility issues with kotlin code on android. You could always run your tests on an emulator (wouldn’t be dalvik tests). There probably exists better ways that don’t involve emulators that I’m not aware of
x

xenoterracide

01/29/2019, 10:22 PM
well for my compatibility issues, I’m mostly worried about the 3rd party libraries that I’m pulling in
a

Allan Wang

01/29/2019, 10:23 PM
For the most part if they use packages that are unavailable you’re probably going to get compile errors when building the app
x

xenoterracide

01/29/2019, 10:24 PM
right, but… not when I’m building the library… as it’s got its own build thing…
a

Allan Wang

01/29/2019, 10:24 PM
Yes so just create an android frame, include your library in gradle, and try building it
View count: 1