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

    Jay

    02/12/2019, 11:09 AM
    Why is the “project level dictionary” called jay.xml? Surely this should be a VCS-shared file, common across everyone working on the project?
    g
    2 replies · 2 participants
  • v

    Vishal

    02/13/2019, 3:40 AM
    Hello all, I'm new to kotlin and have 6+ years of experience in Android(Java). Need some begin with tips, thanks in advance.
    :kotlin: 5
    :kotlin-flag: 3
    :google: 10
    s
    j
    +1
    8 replies · 4 participants
  • d

    dave

    02/13/2019, 9:54 AM
    Hallo, does any of you use currently any redux implementation in Android? is there any stable usable library? What are the experiences so far with redux in Android for you? I have used redux before with Angular and it was great. Now I'm trying to decide between using redux or Android Architecture Components with MVVM. Regards
    g
    g
    +3
    7 replies · 6 participants
  • a

    arekolek

    02/13/2019, 1:47 PM
    Why does the access of result annotated with
    android.annotations.Nullable
    generate a mere warning instead of an error?
    j
    g
    +1
    10 replies · 4 participants
  • a

    arekolek

    02/14/2019, 11:43 AM
    Is there anything you can do to disable this false positive lint check when using
    use
    from KTX, but still have it if you actually don’t recycle the
    TypedArray
    ? (Not this instance of course, but any future instances)
    g
    l
    8 replies · 3 participants
  • d

    diego-gomez-olvera

    02/14/2019, 2:49 PM
    I was considering to scope an extension to an annotated type similar to
    inline val @receiver:ColorInt Int.alpha get() = (this shr 24) and 0xff
    from KTX, but unfortunately the extension is visible to any
    Int
    . Is it the expected behavior or a known issue?
    j
    2 replies · 2 participants
  • r

    ribesg

    02/14/2019, 3:04 PM
    Maybe you should open an issue for this (or maybe there’s one)
    👍 1
    d
    4 replies · 2 participants
  • c

    Chris Zhang

    02/14/2019, 8:49 PM
    Hi folks, hail mary play here — getting the following error adding a dependency on a MPP android artifact. It looks like https://github.com/Kotlin/kotlinx.coroutines/issues/510 except this is just a bare bones pet project — not using coroutines.
    -.txt
    5 replies · 1 participant
  • a

    Ayoub

    02/15/2019, 9:27 AM
    Hello guys I have a problem compiling a module on release flavour :
    Cannot find a version of 'org.jetbrains.kotlin:kotlin-stdlib-jdk7' that satisfies the version constraints: 
       Dependency path 'mymodule:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.11' --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.11'
       Dependency path 'mymodule:unspecified' --> 'io.realm:realm-android-kotlin-extensions:5.9.0' --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.50'
       Constraint path 'mymodule:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk7' strictly '1.2.50' because of the following reason: debugRuntimeClasspath uses version 1.2.50
    l
    1 reply · 2 participants
  • s

    Shane Blackburn

    02/18/2019, 2:09 PM
    What is the common thought process on Java vs Kotlin? If you are new to programming and want to get into Android, is it ok to learn just Kotlin or do I have to learn Java first and then learn Kotlin after I learn Java? (if I'm looking to land a job not just create my own app)
    j
    a
    +3
    14 replies · 6 participants
  • l

    LeoColman

    02/18/2019, 11:34 PM
    Is this actually a thing?
    🇳🇴 2
    g
    d
    +3
    11 replies · 6 participants
  • m

    Marcin Wisniowski

    02/20/2019, 9:13 PM
    How do you unit test coroutines that use
    withContext(<http://Dispatchers.IO|Dispatchers.IO>)
    , is there a way to replace
    <http://Dispatchers.IO|Dispatchers.IO>
    to use the main thread in unit tests? Or do I have to pass a dispatcher with DI to replace in tests?
    m
    g
    +1
    5 replies · 4 participants
  • j

    jurajsolarml

    02/21/2019, 8:44 AM
    Hello,Please can you help me ? I am beginner. Where can be a bug ? /Kotlin 1.3.21,AS 3.5 Canary 4 / I tried to change Gradle version current 5.2.1 and Invalidate Caches/Restart did not help. Thanks https://hastebin.com/zeyovujumu.shell https://hastebin.com/umowehuqew.xml https://hastebin.com/gixuvicabe.cpp
    g
    t
    3 replies · 3 participants
  • u

    540grunkspin

    02/21/2019, 8:55 AM
    Does anyone know if there is a place to submit feature requests for ktx. I have been thinking about
    Parcel.readSparseArray
    . It returns
    SparseArray
    without any generic parameter and I am not aware of a way to read it with the generic parameter. It should be fairly easy to reify that one to do a cast for you. I know that this is not something that is super hard to do yourself but it feels like a hack every time i need to suppress the unchecked cast warning.
    g
    19 replies · 2 participants
  • z

    zokipirlo

    02/21/2019, 9:37 AM
    Don't know if here is the correct thread to ask, but anyway.... for a new project (which will be 100% kotlin) we (team) are discussing regarding dependency injection framework and which one to use, if any... the more I'm looking into that, the more I don't see any reason to use it, because kotlin supports default parameter (constructor or method). Even looking into the description of Koin or Kodein I don't see any text regarding why, benefit of using DI framework. Can someone with more experience (I never tried any) tell me some benefits of using one please?
    👍 2
    g
    m
    +5
    35 replies · 8 participants
  • h

    Happy

    02/21/2019, 8:26 PM
    http://androchef.com/how-to-start-learning-android-from-scratch/
    👎 3
    🚓 3
    g
    d
    +1
    3 replies · 4 participants
  • a

    Animesh

    02/22/2019, 12:09 PM
    Can any one suggest image tagging library in Android ?
    :google: 8
    d
    r
    +2
    6 replies · 5 participants
  • r

    ribesg

    02/25/2019, 3:44 PM
    IntelliJ doesn’t find a R.java file, Android Studio does but does not tell me where it is, all I can find on SO is things about a root
    gen
    folder, I don’t have that... Any idea why I don’t have a R file? I’ve been stuck on this for hours now. The build works, the app works, IDEA just keeps telling me R is not found and removing the imports every time I optimize imports
    👍 1
    c
    l
    +2
    13 replies · 5 participants
  • k

    kosvyden

    02/26/2019, 7:37 AM
    Guys, could you please share your experience of writing Espresso test for LoginActivity with
    idling resource
    ? Probably someone can suggest good tutorial how to implement this case? I have my own implementation, but it works time to time.. I’ve missed smthg..
    :stackoverflow: 1
    e
    1 reply · 2 participants
  • i

    Ive Vasiljevic

    02/26/2019, 10:07 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.
    g
    r
    +1
    12 replies · 4 participants
  • o

    Oleh Ponomarenko

    02/26/2019, 11:57 AM
    Hello! What's the best way to get next item in Set? For example, I have Set{2,8,3,4}. And If I take item "8", how can I get an item with number "3" from the list ? I can't just find item 3, I need find solution to take next item in Set. The main goal to add previous and next button on Details screen to be able going through the set.
    g
    d
    +1
    47 replies · 4 participants
  • d

    Dmitry Khasanov

    02/26/2019, 12:37 PM
    Hi, how in Android Studio I can generate implementation of superclass members with(!) automatically delegating to specific field of the class? I want implement simple delegation pattern, but don't want write it manually. Maybe some plugin for Android Studio? Ask here because initially I decided use Kotlin and its implementation by delegation but then I had to refuse it 🙂
    g
    3 replies · 2 participants
  • k

    Kevin Janvier Chinabalire

    02/26/2019, 6:55 PM
    hey there , how do you access any type inside your adapter eg:
    val list:Any
    then how do i access the value of
    Any
    e
    16 replies · 2 participants
  • n

    nwh

    02/26/2019, 9:56 PM
    How do you guys handle coroutine scopes in Fragments? I find with most of my tasks that cancelling on pause is the most logical choice, as they are usually started when the view is created. But if I cancel the scope, I can't re-launch tasks on it upon resuming.
    m
    l
    8 replies · 3 participants
  • a

    Animesh

    02/27/2019, 1:50 PM
    In my app i want to implement feature to get App rating from users. But as per my need App rating should be asked in case of major app version upgrade. It should not be triggered for minor version upgrade. For example : Case 1: If previous version is 1.0 and new launched App version is 2.0 then it app should prompt for App rating. Case 2: If previous version is 1.0 and new launched version is 1.5 then it should not prompt for app rating. Just wondering is there any ready to use solution available for this implementation ?
    :google: 3
    a
    3 replies · 2 participants
  • p

    Pavel.AZ

    02/28/2019, 9:39 AM
    Hello, in my app I’m using Retrofit2+Moshi with KotlinJsonAdapterFactory, I have some case when I do want to send NULL value of some field, any ideas? (related to Moshi configuration)
    g
    1 reply · 2 participants
  • u

    Uraniam9

    02/28/2019, 2:13 PM
    I learnt basic Java and migrated directly to kotlin(new comer) but the problem comes most documentation, libraries and snippets are almost written in Java so it's pain and I know kotlin to Java converter exists , i sometimes think of going back to Java can some help me out regarding the issue
    g
    b
    2 replies · 3 participants
  • u

    Uraniam9

    02/28/2019, 2:52 PM
    If I combine all Java classes in one single Java file, will that work?
    :google: 3
    g
    1 reply · 2 participants
  • l

    leosan

    02/28/2019, 4:33 PM
    Why the former works with the type inference when the latter doesn’t?
    s
    d
    +1
    11 replies · 4 participants
  • s

    scottiedog45

    03/01/2019, 1:15 AM
    Hi everyone! Coming from an iOS background and writing an android version of one of the apps. What are the community recommendations for : Networking library, and keyboard managers (this is an issue in iOS as the keyboard can sometimes cover an input when the keyboard comes into view). Any more gotchas that you can think of? Much appreciated 🙂. Should mention I’m interested in Kotlin libs (if important).
    m
    i
    +3
    16 replies · 6 participants
Powered by Linen
Title
s

scottiedog45

03/01/2019, 1:15 AM
Hi everyone! Coming from an iOS background and writing an android version of one of the apps. What are the community recommendations for : Networking library, and keyboard managers (this is an issue in iOS as the keyboard can sometimes cover an input when the keyboard comes into view). Any more gotchas that you can think of? Much appreciated 🙂. Should mention I’m interested in Kotlin libs (if important).
m

Michael Bernier

03/01/2019, 1:17 AM
Retrofit for Rest, this comes with OkHttp, Gson or Moshi for json parsing
for keyboard handling, nothing special the sdk tool work just fine
s

scottiedog45

03/01/2019, 1:17 AM
When you say “or”, it comes with all three under the hood?
m

Michael Bernier

03/01/2019, 1:19 AM
only comes with okhttp, then you can choose the parser you prefer
if you search for retrofit example, you will find everything you need to make network request for Rest api, if that is what you need
if you need too handle images then I recommend Glide
s

scottiedog45

03/01/2019, 1:56 AM
thanks man 😃
i

itnoles

03/01/2019, 5:20 AM
I thought Retrofit is JVM only. Ktor have OkHttp for JVM/Android and iOS (URLSession) one
b

Bino

03/01/2019, 7:21 AM
@itnoles is right, Retrofit is JVM only
“Type-safe HTTP client for Android and Java by Square, Inc.”
The counterpart from ktor is also available for iOS. It could help when you already have ios background. (https://ktor.io/clients/http-client/engines.html) Perhaps you should also take a look into Kotlin Multiplatforms, where you can share code between ios and JVM applications if you plan to write for both platforms: https://kotlinlang.org/docs/reference/multiplatform.html
l

louiscad

03/01/2019, 8:40 AM
Gson -> kotlinx.serialization or Moshi
Retrofit -> or also #ktor client
k

Kris Wong

03/01/2019, 1:57 PM
ktor & kotlinx.serialization have the added benefit of working with kotlin/native, if that becomes of interest in the future
s

scottiedog45

03/02/2019, 5:41 PM
I’m surprised no one has mentioned Fuel, as it was one of the first things that google returned.
i

itnoles

03/02/2019, 5:45 PM
Fuel is JVM/Android projects.
s

scottiedog45

03/02/2019, 5:51 PM
Thanks ^^ was looking for specifically android actually 😅 my bad
i

itnoles

03/02/2019, 6:52 PM
Fuel is very interesting kotlin library with a lot of features including Android.
View count: 3