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
squarelibraries
  • b

    bdawg.io

    05/16/2018, 4:45 AM
    I’m writing the JSON-RPC lib 🙂 haha
    😂 1
    g
    • 2
    • 2
  • d

    dave08

    05/27/2018, 10:51 AM
    How could I download a file w/ OkHttp to multiple files using Coroutines (for concurrent downloading of pieces -- which is why I want coroutines, and also so that if the download fails in the middle, we can recuperate from the last complete increment, also for security reasons..)? Maybe there's a plugin for this already..?
    g
    • 2
    • 1
  • d

    dave08

    05/28/2018, 6:17 AM
    Right, that was one thing that I probably got wrong the first time, thanks. How about the concurrent download in pieces, you have any recommendations?
    g
    • 2
    • 11
  • m

    mbonnin

    06/11/2018, 10:03 AM
    Mornin 👋 I'm trying moshi codegen and Android Studio doesn't pickup the generated files under
    generated/source/kaptKotlin/
    . It compiles fine but not having autocomplete is a bit painfull... Is there something specific to do there ?
    a
    b
    • 3
    • 3
  • d

    dave08

    07/25/2018, 3:12 PM
    Thanks and sorry for the bother! It looks like I've been at this for too long 🤒... By the way, this area might deserve a bit of documentation, I finally found https://github.com/square/moshi/issues/221 after hours of searching and trying tons of ways... 🙂
    r
    • 2
    • 1
  • c

    Casey Kulm

    08/10/2018, 4:17 PM
    For
    HttpUrl
    in OkHttp, it seems like the docs say that it should ignore trailing slash when comparing equality, yet that’s not what I’m seeing it actually do
    • 1
    • 2
  • m

    Mohamed Ebrahim

    08/12/2018, 3:51 AM
    rx is dangerous ?? 🤔🤔
    j
    • 2
    • 1
  • j

    jw

    08/16/2018, 2:21 PM
    will experiment today
    👍 1
    j
    • 2
    • 2
  • j

    jw

    08/16/2018, 9:17 PM
    https://github.com/square/retrofit/pull/2859
    🎉 2
    j
    • 2
    • 13
  • b

    bdawg.io

    08/20/2018, 4:50 PM
    On another topic, what’s the best way to handle “next page” URLs from the server using retrofit? Is it best to just have another service endpoint that you provide it the “next page” URI and it will send off? For example,
    interface UserService {
        @GET("/users")
        Call<List<User>> getAll()
     
        @GET("{nextPathAndQuery}")
        Call<List<User>> getNextPage(@Path("nextPathAndQuery") pathAndQuery: String)
    }
    t
    • 2
    • 1
  • e

    egorand

    11/10/2018, 7:25 PM
    @russhwolf
    Superclass::class.parameterizedBy(Int::class)
    r
    • 2
    • 2
  • p

    Paul Woitaschek

    11/12/2018, 9:16 PM
    Is there a reason why I can't use
    generateAdapter=true
    on an object?
    b
    • 2
    • 2
  • d

    dave08

    11/13/2018, 1:25 PM
    Can Okio 2.1.0 be used with Moshi 1.8.0 and OkHttp3?
    e
    • 2
    • 1
  • h

    hmole

    11/17/2018, 12:23 PM
    Why is
    PolymorphicJsonAdapterFactory
    not in moshi 1.8 jar classpath?
    • 1
    • 1
  • e

    edwardwongtl

    12/10/2018, 8:28 AM
    Hi guys, I’m facing a problem of generalize JSON response using Moshi. Currently the json can be something like this:
    {
      "error": 0,
      "err_msg": "",
      "users": [ ... ],
    }
    {
      "error": 0,
      "err_msg": "",
      "movies": [ ... ],
    }
    The part that is common is the
    error
    and
    err_msg
    fields, other than that, the json-key and value can vary depending on which server api I call. I think the way to go is a custom Adapter with
    @FromJson fun fromJson(reader: JsonReader): Result<T>
    , but I’m struggling on the
    <T>
    part..
    d
    • 2
    • 2
  • e

    eric

    12/10/2018, 6:09 PM
    what do you mean by dynamic JSON
    h
    • 2
    • 1
  • a

    alec

    12/30/2018, 7:06 PM
    you have to explicitely ask for the rowid now:
    lastInsert:
    SELECT last_insert_rowid();
    👍 1
    h
    • 2
    • 2
  • j

    Jan Skrasek

    01/15/2019, 1:15 PM
    Hi, does anybody know what's the blocker of https://github.com/square/retrofit/pull/2886
    Retrofit: Add first-party Kotlin coroutine suspend support
    👍 1
    b
    • 2
    • 1
  • n

    Nikky

    01/21/2019, 6:00 AM
    can i use kotlinpoet to generate .kts files ? i was looking for a way to add toplevel statements but that seems to not be possible with kotlinpoet
    e
    • 2
    • 22
  • e

    egorand

    01/22/2019, 3:07 AM
    it is WIP, some features are still missing, but you can definitely give it a try
    d
    • 2
    • 5
  • n

    Nikky

    02/13/2019, 7:06 AM
    some user says my program errors like this:
    Error:Kotlin: com/squareup/kotlinpoet/ClassName
    i am currently trying to squeeze them for more info and a stacktrace.. but anyone got a idea of how this could happen ?
    h
    e
    • 3
    • 3
  • i

    Ive Vasiljevic

    02/26/2019, 10:08 AM
    Has anyone ever used Moshi as a converter for retrofit. I am having some problems with Array List. Exception is thrown because I don't have an adapter for array list. I don't quite understand what I am supposed to do here. Retrofit version 2.5.0.
    e
    g
    • 3
    • 6
  • j

    jw

    02/27/2019, 6:32 PM
    would you mind posting that and your
    JsonAdapter.Factory
    to https://github.com/square/moshi/issues/807?
    b
    • 2
    • 1
  • j

    jw

    02/27/2019, 6:37 PM
    also your
    omitted
    overrides should probably use
    get() =
    to skip needing to keep a private field
    b
    • 2
    • 1
  • p

    Pavel.AZ

    02/28/2019, 12:13 PM
    I mean how to serialize some property into null value
    i
    e
    • 3
    • 9
  • l

    louiscad

    03/12/2019, 11:38 AM
    Hi, is there a way to use SQLDelight with the
    plugins
    DSL with Gradle Kotlin DSL? EDIT: I meant without having to specify anything in the root project classpath, but it does not seem possible as the plugin does not seem to be on gradle plugins portal.
    plugins { id("com.squareup.sqldelight") }
    works fine.
    e
    • 2
    • 1
  • j

    jw

    03/12/2019, 1:03 PM
    We do not publish to the portal
    c
    • 2
    • 1
  • e

    egorand

    03/15/2019, 1:05 AM
    https://twitter.com/jrodbx/status/1106343091479498757
    🔥 3
    👍 2
    g
    • 2
    • 5
  • c

    coletz

    03/19/2019, 11:08 AM
    So I am using Retrofit maybe since 2015 and I just realized that it's not using annotation processing but proxies and I'm feeling pretty stupid for not noticing it. So out of curiosity, is there any reason for not using annotation processing?
    m
    • 2
    • 6
  • j

    jw

    03/19/2019, 12:01 PM
    The level of dynamism is high which makes annotation processing prohibitive. We would have to figure out a way to support custom converters and call adapters participating in code generation. Additionally, Java lacks facilities for representing parameterized types as literals whereas they're easy to get with reflection. Finally, HTTP calls are expensive operations so having a little reflection doesn't add much overhead
    :tnx: 3
    c
    • 2
    • 1
Powered by Linen
Title
j

jw

03/19/2019, 12:01 PM
The level of dynamism is high which makes annotation processing prohibitive. We would have to figure out a way to support custom converters and call adapters participating in code generation. Additionally, Java lacks facilities for representing parameterized types as literals whereas they're easy to get with reflection. Finally, HTTP calls are expensive operations so having a little reflection doesn't add much overhead
:tnx: 3
c

coletz

03/19/2019, 1:25 PM
thanks, that totally makes sense
View count: 4