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

    joachim.reiss.

    04/10/2017, 12:26 PM
    code is above
    n
    • 2
    • 2
  • a

    audhil

    04/10/2017, 5:22 PM
    // kotlin kapt "com.android.databinding:compiler:2.2.0"
    a
    • 2
    • 5
  • v

    virl

    04/12/2017, 12:45 PM
    Hello everyone. Is it safe to use Kotlin 1.1.1 in Android project, or I should use 1.1.0?
    d
    • 2
    • 1
  • u

    uhe

    04/12/2017, 1:25 PM
    yes
    👍 1
    a
    r
    • 3
    • 6
  • v

    vyacheslav.gerasimov

    04/12/2017, 1:33 PM
    @aballano This issue should be fixed in 1.1.2 eap https://youtrack.jetbrains.com/issue/KT-12769
    a
    r
    • 3
    • 13
  • m

    mg6maciej

    04/13/2017, 2:27 PM
    @vyacheslav.gerasimov Are you planning to support all the cases?
    v
    • 2
    • 13
  • p

    Paul Woitaschek

    04/14/2017, 6:08 PM
    @mg6maciej @miha-x64 very interesting. So if i understand correctly each app has the same system classes but they get copied when one modifies them.
    j
    • 2
    • 1
  • j

    joachim.reiss.

    04/15/2017, 8:10 AM
    speaking of layouts i am curious whether someone else uses the kotlinx extension for accessing the xml layout views or is everone using butterknife/databinding or findViewById ?
    n
    m
    • 3
    • 3
  • m

    mg6maciej

    04/15/2017, 11:13 AM
    @miha-x64 Could you share the most complex layout you have created with Anko? Did you hit any wall and had to go back to xml for any reason?
    m
    • 2
    • 2
  • r

    rednifre

    04/15/2017, 8:14 PM
    Can I use Android Studio to create a regular old java library or is it better to install classic IntelliJ separately for this?
    l
    • 2
    • 2
  • k

    koufa

    04/18/2017, 6:20 PM
    How can I get Kotlin 1.1.2 EAP? I tried to update the Kotlin plugin but I keep getting an error.
    m
    • 2
    • 6
  • t

    trevjones

    04/18/2017, 8:06 PM
    correct it just works
    k
    j
    • 3
    • 16
  • a

    azabost

    04/19/2017, 10:10 AM
    @dg3feiko see here: https://github.com/Kotlin/kotlinx.coroutines/blob/master/ui/coroutines-guide-ui.md
    d
    • 2
    • 5
  • l

    louiscad

    04/20/2017, 7:21 AM
    Personally set up an Android 4.0 emulator with the smallest screen possible and 512MB of RAM only to make sure my app works on it, and to not slow down my computer
    j
    • 2
    • 1
  • m

    menegatti

    04/20/2017, 2:44 PM
    so basically
    if (url?.contains("#") == false)
    m
    • 2
    • 1
  • k

    kevinmost

    04/20/2017, 6:01 PM
    sure, Google hasn't embraced it, but they also haven't embraced the mile-high stack of libraries from Square and the like that we all use to make Android dev tolerable, anyway
    l
    • 2
    • 1
  • a

    audhil

    04/21/2017, 11:06 AM
    data class
    without a constructor param in Kotlin, possible?
    p
    • 2
    • 2
  • k

    kkozmic

    04/23/2017, 12:33 PM
    is anyone using Buck (https://buckbuild.com/) instead of Gradle for their build in real production non-trivial apps?
    m
    b
    +5
    • 8
    • 36
  • r

    reggar

    04/24/2017, 12:18 PM
    There is also https://gitlab.com/arturbosch/detekt
    d
    • 2
    • 3
  • t

    thymecypher

    04/24/2017, 7:04 PM
    Ah, wow… It’s a JetBrains annotation problem… 😐
    k
    • 2
    • 4
  • t

    trevjones

    04/25/2017, 7:11 PM
    it seems the support library resource annotation lints don’t work when used on a vararg param. user error or possible bug/feature request?
    private fun View.popupMenu(@MenuRes vararg menuItems: Int): PopupMenu {
            return PopupMenu(this.context, this, Gravity.END, 0, R.style.AppTheme_Widget_PopupMenu_Overflow).apply {
                menuItems.forEach { inflate(it) }
                show()
            }
        }
    m
    e
    v
    • 4
    • 7
  • k

    kkozmic

    04/26/2017, 5:52 AM
    just_like_that
    so it's clear it's magic
    👍 8
    😀 1
    d
    • 2
    • 1
  • v

    vyacheslav.gerasimov

    04/26/2017, 1:04 PM
    There is also some docs about kapt https://kotlinlang.org/docs/reference/using-gradle.html#annotation-processing
    👍 1
    l
    d
    • 3
    • 5
  • t

    trevjones

    04/26/2017, 3:39 PM
    when updating to 1.1.2 I can not compile my androidTest as any reference to the main source set is unresolved. seems related and a total reverse of what was this issue: https://youtrack.jetbrains.com/issue/KT-16897
    • 1
    • 1
  • c

    cedric

    04/27/2017, 1:47 PM
    @alexey.tsvetkov Just a thought: if
    R.java
    was converted to
    R.kt
    , would this make incremental compilation faster?
    👍 1
    a
    • 2
    • 1
  • a

    alexey.tsvetkov

    04/27/2017, 2:13 PM
    When
    kotlin-android
    is used, the tasks are not available during script evaluation. You can refer to
    compileKotlin
    in
    project.afterEvaluate { compileKotlin }
    . On the other hand if you want to set
    suppressWarnings
    for the whole project, you can just use
    kotlinOptions
    extension in
    android
    block.
    android {
         kotlinOptions.suppressWarnings = true
    }
    👍 1
    d
    • 2
    • 3
  • b

    bachhuberdesign

    04/28/2017, 5:10 PM
    @ben.bachhuber Never thought I would see another Bachhuber in here 👍
    m
    b
    • 3
    • 2
  • k

    kkozmic

    05/02/2017, 1:06 AM
    is anyone else having that problem?
    j
    c
    +5
    • 8
    • 14
  • c

    cedric

    05/02/2017, 6:54 AM
    I haven't run benchmarks but I'd expect that calculating MD5 and comparing them is faster than comparing all the bytes one by one
    j
    • 2
    • 3
  • e

    elect

    05/02/2017, 1:02 PM
    this doesn't seems be a valid strategy for Android, where there is no
    URI
    . Reading around, it seems I should use
    InputStream
    to fetch the files (from
    asset
    ), is that right?
    w
    • 2
    • 13
Powered by Linen
Title
e

elect

05/02/2017, 1:02 PM
this doesn't seems be a valid strategy for Android, where there is no
URI
. Reading around, it seems I should use
InputStream
to fetch the files (from
asset
), is that right?
w

wasyl

05/02/2017, 1:06 PM
elect: If you’re reading from your app then yes. Also if your implementation works against
InputStream
then one way or another you’ll be able to get files in Android as `InputStream`s
e

elect

05/02/2017, 1:08 PM
Actually I have this user having troubles, https://github.com/java-graphics/assimp/issues/5
I don't know if he is reading from his app, I assume so.
w

wasyl

05/02/2017, 1:09 PM
Take a look here http://stackoverflow.com/questions/24869323/android-import-java-nio-file-files-cannot-be-resolved
e

elect

05/02/2017, 1:09 PM
my actualy implementation is using
URI
I am wondering now if I should switch to
InputStream
completely
I'd like to have an unique code path for desktop and android if possible..
w

wasyl

05/02/2017, 1:11 PM
You can, you just have to be careful that classes that use Java APIs that aren’t available on Android aren’t even initialized
Basically you can’t even touch them (as in call static method on a class which has
java.nio.file.*
imports)
e

elect

05/02/2017, 1:26 PM
what would you suggest to do?
two different path code or an unique one?
w

wasyl

05/02/2017, 1:37 PM
Probably one router to check the environment, and two implementations of an interface
That’s what I used to do when I had to do different things if there was google play services library available and if there wasn’t
View count: 2