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

    locke

    02/28/2018, 8:35 PM
    Is there a way to force Gson to discard any JSON object with null properties when marshaling into Kotlin's non-null data classes? I am working with a client's backend and can't guarantee they won't break their contract, but also don't want nullable objects floating through the entirety of an application.
    :stackoverflow: 6
    r
    n
    d
    • 4
    • 3
  • p

    pulkitkothari

    03/01/2018, 6:57 AM
    I am trying to use Room Database in my app. My ques is, do I need to open and close the database manually? If yes how and when? If no should I call
    build
    on room object on my activity launch or lazily whenever I need it?
    :stackoverflow: 5
    g
    • 2
    • 2
  • g

    Giulio

    03/01/2018, 11:47 AM
    Hi all! Can I ask a little question here? I'm looking for some help about porting an app from Android to Kotlin
    a
    d
    g
    • 4
    • 12
  • g

    Giulio

    03/01/2018, 11:57 AM
    Hi, is it easy to port an old Android project like this (see refs below) to Kotlin? https://github.com/giuliohome/TweetSearch What is the suggested way to approach this task? Thank you 👏 I mean: is there a method to minimize the "code rewrite"?
    m
    • 2
    • 8
  • g

    Giulio

    03/01/2018, 12:26 PM
    One last question for today, just out of my curiosity, is anyone using the new http://arrow-kt.io/ for an Android app with Kotlin? Does it sound convenient for real-world requirements or (which I suspect) a bit an overkill...??
    r
    • 2
    • 1
  • r

    rCorbellini

    03/01/2018, 1:42 PM
    Delegated properties are so amazing, where in real life is it a good to use? (I accept tips with any thing to read with real examples)
    m
    m
    • 3
    • 4
  • a

    antonis

    03/01/2018, 3:49 PM
    Hello, has anyone used dagger in a mixed java/kotlin codebase? I’ve found solutions like https://medium.com/@manuelvicnt/kotlin-integrate-it-with-your-complex-android-project-dagger-mockito-a4c71a8f2574 But still no luck. Any tips?
    u
    r
    • 3
    • 5
  • a

    alex.tavella

    03/01/2018, 7:34 PM
    Thanks, that is really a pain to find
    m
    • 2
    • 1
  • r

    Regan Russell

    03/01/2018, 9:43 PM
    I can't find anything on slashdot or google about this problem.. I am getting a crash in kotlin realm extensions... Process: com.agersens.eshepardcollarfitter.production, PID: 9241 java.lang.IllegalAccessError: Method 'io.realm.RealmQuery io.realm.RealmQuery.createQuery(io.realm.Realm, java.lang.Class)' is inaccessible to class 'com.vicpin.krealmextensions.RealmExtensionsKt' (declaration of 'com.vicpin.krealmextensions.RealmExtensionsKt' appears in /data/app/com.agersens.eshepardcollarfitter.production-1/split_lib_dependencies_apk.apk) at com.vicpin.krealmextensions.RealmExtensionsKt.forEntity(RealmExtensions.kt:246) at com.vicpin.krealmextensions.RealmExtensionsKt.queryFirst(RealmExtensions.kt:41) at com.maiatehcology.maialibrary.syncframework.database.DatabaseWrapper.fetchAnimals(DatabaseWrapper.kt:78) The code is very very similar to what I used in a previous project without incident...
    c
    • 2
    • 4
  • g

    Giulio

    03/02/2018, 9:49 AM
    Well, I understand. So... Maybe do you have an example of Kotlin Android app reading and writing from Google Drive which is targeting api level 25? Thanks again
    g
    • 2
    • 10
  • r

    rootandy

    03/02/2018, 10:33 AM
    @Giulio if you really want to dive into you can have a look into the manual building and signing process (zipalign, jarsigner etc.) to unpack your app and then change and repack, align and sign your app. But i agree @gildor and @oday that it is better to solve the root of the problem...
    g
    • 2
    • 3
  • s

    Sam

    03/02/2018, 11:51 AM
    Hi all, I hope I'm not posting this in the wrong place, please feel free to direct me accordingly if so: I'm experiencing issues running 'gradlew install' in Android Studio 3.0.1, Kotlin 1.2.21, JDK 8. It keeps failing with
    compileReleaseKotlin
    but none of the solutions I've tried seem to work. I'm wondering if anyone else has experienced the same issue? running --stacktrace, --info, --debug, and --scan all build successfully, it's only 'install' that doesn't.
    g
    • 2
    • 1
  • s

    Sam

    03/02/2018, 11:54 AM
    Frustratingly the logs display no other information.
    g
    • 2
    • 1
  • d

    droidrcc

    03/02/2018, 1:23 PM
    Do you have an idea how to import into android studio a project that use gradle kotlin DSL ?
    r
    k
    • 3
    • 10
  • r

    rkeazor

    03/02/2018, 1:52 PM
    So will Kotlin Native ever make it to flutter🤔
    g
    • 2
    • 1
  • s

    spierce7

    03/03/2018, 3:38 PM
    Does anyone know what presentation software people are using to get these nice animations in their code samples? i.e. @jw What do you use?
    l
    j
    h
    • 4
    • 4
  • s

    spierce7

    03/03/2018, 4:46 PM
    Is anyone using kotlin coroutines as a replacement for rxjava? I'm starting a new project, and am considering coroutines in place of rxjava. I'm wondering what peoples thoughts are around this.
    l
    k
    +3
    • 6
    • 9
  • g

    gildor

    03/05/2018, 8:48 AM
    it will be available in a future versions of Kotlin. There is internal Kotlin API called Contracts, but it’s not ready yet It will help compiler to understand contact of such functions
    s
    • 2
    • 1
  • s

    Slackbot

    03/06/2018, 9:22 AM
    This message was deleted.
    :stackoverflow: 5
    e
    • 2
    • 1
  • p

    Pascal How

    03/06/2018, 10:54 AM
    Hi, I just came across this where we are extending context with a toast function: https://github.com/android/android-ktx/pull/290 The call to toast becomes a lot nicer because we can just do
    toast(...)
    without worrying about
    show()
    etc My issue is whether this is actually a form of abuse on the extension function mechanism because Toast is not really an extension of context. Similarly, I have come across several examples where extension functions have been used to simply shave off a parameter from the original method call. Any opinions?
    m
    l
    +3
    • 6
    • 29
  • y

    yoavst

    03/07/2018, 7:33 PM
    Would be interesting to read about the optimizations in ART 🙂
    g
    • 2
    • 1
  • k

    kenkyee

    03/07/2018, 8:31 PM
    (for new apps)
    j
    • 2
    • 2
  • j

    jw

    03/07/2018, 8:34 PM
    in 3.2a5 you can enable it with
    android.enableR8=true
    in your
    gradle.properties
    . It made my app 14% smaller with no functionality loss and even some regressions on what was removed (meaning there's room for improvement)
    g
    • 2
    • 2
  • s

    skennedy

    03/08/2018, 12:33 AM
    i really wish support lib 28 had added more nullable/nonnull annotations in recyclerview 😕
    💯 2
    j
    t
    d
    • 4
    • 7
  • g

    gildor

    03/08/2018, 9:58 AM
    No sql? Maybe you mean document store db? because no sql it’s much more wider thing
    e
    • 2
    • 1
  • b

    bobtimm

    03/08/2018, 9:30 PM
    Consider a table. For instance, for handling auth sessions, we ended up using a table for storing a single entry. When the client then wanted to support multi user sign in, most of the work for storing that information was already handled.
    b
    d
    p
    • 4
    • 7
  • j

    J-Rojas

    03/09/2018, 2:15 AM
    Has anyone else seen incorrect linting of Kotlin files in Android Studio related to certain collection classes? I'm having trouble with HashMap and ArrayList for example. Compilation yields no errors, only IDE parsing within the editor. I'm using v1.2.30.
    g
    o
    m
    • 4
    • 8
  • s

    sglim

    03/09/2018, 5:01 AM
    I think multiple implementations may be in your classpath.
    j
    • 2
    • 6
  • t

    Tarun

    03/09/2018, 9:28 AM
    Android Studio also has one default one. Android studio provides a code style tool which can be customised and exported to be distributed to teams. Path to get this tool is Android Studio -> Preferences -> Editor -> Code Style -> Kotlin Default code style is present which follows https://android.github.io/kotlin-guides/style.html
    j
    • 2
    • 5
  • l

    ltm150895

    03/09/2018, 7:52 PM
    hello , just have a quick question , what would you consider lightweight in
    okhttp3
    vs
    retrofit
    ?
    :stackoverflow: 3
    f
    e
    • 3
    • 2
Powered by Linen
Title
l

ltm150895

03/09/2018, 7:52 PM
hello , just have a quick question , what would you consider lightweight in
okhttp3
vs
retrofit
?
:stackoverflow: 3
f

florent

03/09/2018, 8:16 PM
Retrofit use Okhttp
👻 2
👍 2
e

egek

03/12/2018, 11:50 AM
Bruh...
View count: 1