https://kotlinlang.org logo
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
stackoverflow
  • u

    user

    07/11/2022, 10:31 AM
    Obtaining list of redirect urls with Spring RestTemplate for HEAD/GET request As far as I'm aware I initialize the RestTemplate in the usual way: val factory = HttpComponentsClientHttpRequestFactory() factory.httpClient = HttpClientBuilder .create() .setRedirectStrategy(LaxRedirectStrategy()) // follow redirects .build() val restTemplate = RestTemplate(factory) val url = "some url..." val response = restTemplate.headForHeaders(url) The automatic redirection works correctly but I want to obtain a list of all redirects that occurred along the...
  • u

    user

    07/11/2022, 10:31 AM
    ViewPager2 : parent fragment is null I have a parent fragment that contains ViewPager2 and TabLayout. So, I want to instantiate my parent fragment ViewModel from ViewPager fragments. But when I compile it gives me null pointer. I tried all solutions available on this issue so far. Thank you for helping in advance! Parent fragment related part : @AndroidEntryPoint class HomeFragment : Fragment(), SearchView.OnQueryTextListener, PopupMenu.OnMenuItemClickListener { private var _binding : FragmentHomeBinding? = null val...
  • u

    user

    07/11/2022, 10:51 AM
    How to get response of Worker A inside another worker class in kotlin I have several worker classes that are scheduled as one-time requests, as below private fun createOneTimeWorkRequest(){ val imageWorker = OneTimeWorkRequestBuilder() .setConstraints(constraints) .addTag("imageWork") .build() val gpSurveyWorker = OneTimeWorkRequestBuilder() .setConstraints(constraints) .addTag("gpSurveyWork") .build() val villageSurveyWorker = OneTimeWorkRequestBuilder() .setConstraints(constraints)...
  • u

    user

    07/11/2022, 11:11 AM
    Where to start with Google Calendar API using Kotlin I'm developing an Android app in Kotlin that will require calendars to be shared between hosts and customers. For this I'm looking to use the Google Calendar API, however when looking through Googles documentation (Google calendar api). I'm not able to find any documentation pertaining to Kotlin for the Calendar API, and on this page (<a href="https://developers.google.com/workspace/guides/android"...
  • u

    user

    07/11/2022, 11:31 AM
    Generate a JWT signed token in android I wanted to create a signed JWT token for my android app. I am stuck with a lot of libraries to generate a JWT signed token. Before, I was not calling any api using jwt token so I want to create a common method for my 50 Api calls where I pass payload as JsonObject which I am already using. I tried few libraries like This is my payload in JsonObject format { "user_name": "admin", "password": "TncyrLY305eajUbLCrGaVZg2XWBNohJs3vdiYB5lA=", "product_access": "machine", "tz": "Asia/Calcutta",...
  • u

    user

    07/11/2022, 11:51 AM
    How do I get the value out of the onResponse function of retrofit to return it in the outer class The below is my code where im trying to return false whenever the body is not empty, but the variable blocker is not overwritten when the body has content in it. The code itself is working but it seems to not get the Code out of the onResponse method. private fun checkTime(date : String, time : String): Boolean { val blocker = true val checkapt = ReservationBySalon( listOf(CheckApt( hairdresser_key = "asru6sxqrifl", date = date,...
  • u

    user

    07/11/2022, 11:51 AM
    Any Android libraries to resize images in place? Are there any Android libraries to resize images and save it in place? I'm using Jetpack Compose and Kotlin in my project. My app has a feature for taking photos and choosing an image from the gallery. And I need to resize the captured or selected image and create their thumbnails. I looked into Picasso, and Glide, etc. But, it seems like they only resize the image in memory for display.
  • u

    user

    07/11/2022, 12:11 PM
    Android start activity by FLAG_ACTIVITY_NEW_TASK,when back the other activity fullscreen is invalid 1. start activity A,set fullscreen in Activity.onCreate callback** 2. start service Service 3. Start activity B(FLAG_ACTIVITY_NEW_TASK) in service,set fullscreen in Activity.onCreate callback But,when back B,the A fullscreen is invaild,again set fullscreen in A.onResume callback,A fullsceen will recover normal set fullscreen method: val lp = window.attributes lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES...
  • u

    user

    07/11/2022, 12:11 PM
    Show DialogFragment in Recyclerview Adapter I'm trying to use a DialogFragmemt in an adapter, but it doesn't work as planned. I have listed the Dialog class and the adapter below. DialogFragment (ListsSettings.kt) class ListsSettings : DialogFragment() { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View { val view: View = inflater.inflate(R.layout.dialog_lists_settings, container, false) return view } } Adapter (AllListAdapter.kt) ->...
  • u

    user

    07/11/2022, 12:11 PM
    How can I add Items horizantal and vertical at the same time? (Kotlin) I would like to add items in scrollview as row and colomn, how can I execute this?
  • u

    user

    07/11/2022, 12:11 PM
    Operation xx specifies deprecated field - yy in Query. Update your operation or update your configuration to allow usage of deprecated fields I am using the following code to generate a schema with Kotlin GraphQL class SomeQuery : Query { @Deprecated(message = "This query is deprecated", ReplaceWith("something else")) fun getSomething(): ResponseClass { // whatever } } During the build I get the following error: Operation SomeQuery specifies deprecated field - getSomething in Query. Update your operation or update...
  • u

    user

    07/11/2022, 12:31 PM
    Can't import Google Asset Delivery (Install-Time) so I'm following the guide, but it gets error once I imported the asset-pack plugin in the library's gradle. plugins { id 'com.android.library' id 'org.jetbrains.kotlin.android' id("com.android.asset-pack") } Error: An exception occurred applying plugin request [id: 'com.android.asset-pack'] Failed to apply plugin 'com.android.asset-pack'. Cannot add extension with...
  • u

    user

    07/11/2022, 12:51 PM
    Can't log any data from API call I'm pretty new to kotlin, and I feel pretty much overwhelmed by it. I'd like to ask - how I can display any data from MutableLiveData? I've tried to Log it, but it doesn't seem to work. I've already added the internet permission to the manifest. Here's the code: ApiServices interface ApiServices { @GET("/fixer/latest/") fun getRatesData( @Query("base") base: String, @Query("apikey") apikey: String ): Call companion object { private const val url = "https://api.apilayer.com/"...
  • u

    user

    07/11/2022, 12:51 PM
    Example for map at swagger I'm trying to create a valid example for a request using swagger ui. I have a data class that is the body of a request. data class LoadTestRequest ( @ApiModelProperty(example = "https://...", required = true, value = "Url to send request") val url: String, @ApiModelProperty(example = "POST", required = true, value = "HttpMethod for a request") val method: HttpMethod, @ApiModelProperty(example = "{\"key\": \"value\"}", required = true, value = "Parameters for a request", dataType =...
  • u

    user

    07/11/2022, 1:11 PM
    My WorkManager isn't running in foreground or background This is the code I am using to setup the work task in my main activity: val apiFetchBuilder = PeriodicWorkRequestBuilder(timeValue, TimeUnit.MINUTES) // timeValue = 1 for testing val apiFetchWorker = apiFetchBuilder.build() val instance = WorkManager.getInstance(this) instance.enqueueUniquePeriodicWork(Constants.background_work, ExistingPeriodicWorkPolicy.KEEP, apiFetchWorker) and then my work manager is setup as follows: class APIWorker(context: Context, workerParams:...
  • u

    user

    07/11/2022, 1:31 PM
    Android MutableLiveData.value = getNewValue() does not work Why it's not possible to directly set the mutableLiveData.value when using a suspend function? See following code: private val _clubs: MutableLiveData by lazy { MutableLiveData().also { fetchClubListFromRepository() } } private fun fetchClubListFromRepository() { viewModelScope.launch { // This doen NOT work _clubs.value = clubsRepository.getAllClubs() // This works var clubsList = clubsRepository.getAllClubs()...
  • u

    user

    07/11/2022, 1:31 PM
    Got InvocationTargetException when using Dagger and kapt? I am trying to understand Dependencies injection with Dagger and so following a tutorial. I created a simple project and copied everything as it was from tutorial .and when I compiled(Built Project) the code it throw me some error . Since there is nothing much included in error ,I have no idea what error is trying to say. Error message Execution failed for task ':app:kaptDebugKotlin'.
    A failure occurred while executing...
  • u

    user

    07/11/2022, 1:31 PM
    Is redis pipelining guarantees repsonse order in cluster mode? I use Spring Data Redis and Redis in cluster-mode. I want to check some parameters for existing. val results = redisTemplate.executePipelined { connection -> keyParams.forEach { params-> val key = generateKey(params) connection.setCommands().sIsMember(key, valueToCheck(params)) } null } return results .map { it as Boolean } So, several questions: Is is correct for cluster mode if keys store in different nodes? Is redis...
  • u

    user

    07/11/2022, 2:11 PM
    Physics of Messenger Chatheads I've searched long and hard about the physics and programming of messenger chathead/chatbubble but I couldn't find any resource that could show how the "physics" of the chathead works. I am talking about the way they compute the bouncyness of the chathead and computing the trajectory of the bubble, also the velocity according to the speed of the flick of the finger. I am going to risk it and post this question here in SO. Can anyone help me figure out the physics and programming behind it?...
  • u

    user

    07/11/2022, 2:11 PM
    Exoplayer Dash parser I am working on Dash player. There are two audio tracks in Dash with same lang "en" First audio track has Accessibility field as it is audio descriptive track So how should I get this Accessibility field info in exoplayer?
  • u

    user

    07/11/2022, 2:31 PM
    How to eliminate black lines in recycler view I have been using recycler view but don't know why there is black lines after each partition though I dont have any code which promote black lines. I think it works well without using any volley library or picasso library when I am using my own array list. This is XML CODE: This is kotlin code for the same: package com.example.new_app.fragment import android.app.Activity import android.app.AlertDialog import...
  • u

    user

    07/11/2022, 2:31 PM
    KotlinLogging Throws NoSuchMethod Exception I'm using this library: "io.github.microutils:kotlin-logging:2.0.4" as a logger. In my code I call: private val logger = KotlinLogging.logger{} and then use this logger as follows: logger.debug("message") this runs fine until I try to debug my code at which point the following to two NoSuchMethodErrors pop up in the library: private static IMarkerFactory bwCompatibleGetMarkerFactoryFromBinder() throws NoClassDefFoundError { try { return...
  • u

    user

    07/11/2022, 2:51 PM
    Android :switch between Layouts dynamically every 10 seconds android beginner here. any help is much appreciated . I am working on an app that can do a simple experiment. the app displays images and asks users to rate it from 1 to 10. I have 1 activity and two layouts experiment begins. I have two layouts merged under FrameLayout. what I want to achieve is : '====>start experiment >show first image for 10 seconds >change layout to ratings layout>after user selects rating>loopback with different image>finish() when imagelist is empty. ' here is what I...
  • u

    user

    07/11/2022, 3:51 PM
    Is there any way to crop a video automatically in android studio? What I want to do is receive a video in a videoView, for example, stored in firebase. And I need that video to fit a vertical videoView, cutting off or not showing any excess. So if its an horizontal video just remove the sides and center it. Something like this :

    1▾

  • u

    user

    07/11/2022, 4:11 PM
    How to make a chip retain its shape after click-event in compose? I am currently trying to make it so that when the user has clicked the chip it still retains it's initial form/shape, in this case round. How can I achieve this? This is how it operates currently: https://gyazo.com/bdbe867adb5c9e75381f7ac923134709 The Chip code: @Composable fun TextChip( isSelected: Boolean, text: String, onChecked: (Boolean) -> Unit, selectedColor: Color = DarkGray,...
  • u

    user

    07/11/2022, 4:31 PM
    Implementing Dao Crashes the App (Kotlin) I've been following an Android App Development tutorial on Udemy and was working on getting the room database working. Link to the GitHub: https://github.com/tutorialseu/RoomDatabaseDemo/tree/169_completing_the_demo For some reason, the following line causes the app to crash once loaded. I have tried to follow the tutorial as closely as I can and even copied some parts of the...
  • u

    user

    07/11/2022, 4:31 PM
    Kotlin Data class Unresolved reference error when access to property I am new with Kotlin and maybe it is a basic question, I have to access the properties from a data class, this is the data class: data class Success( val bugs: Int, val fixed: Int, ) : Success What I am trying to do is just trying to access the value from bugs and fixed, such as: fun process(data: Success) : String { data.bugs return "" } And I am getting the next error: Unresolved reference: bugs Any ideas? As far as I know val generates getters to access the property, but...
  • u

    user

    07/11/2022, 4:51 PM
    Android NFC tag record not read-able I have a little project to write data to Ntag 213, 215, and 216. I success write the data using the MifareUltraLight method. The problem is when I scan using NfcTools, the data format is different than I expected. Here's the format that I expected.

    https://i.stack.imgur.com/OJ608.jpg▾

    Here's the format that I got.

    https://i.stack.imgur.com/JKyhs.jpg▾

    I want that when the Ntag scan, it will open the browser if the...
  • u

    user

    07/11/2022, 4:51 PM
    Kotlin generic type issue with reified I've following class to map request status (Loading, Success, Error) data class Resource( val status: Status, val data: T? ) { sealed class Status { data class Success(val data: T?) : Status() data class Error( val message: String, val statusCode: Int ) : Status() object Loading : Status() } companion object { fun success(data: T?): Resource { return Resource(status = Status.Success(data), data...
  • u

    user

    07/11/2022, 5:11 PM
    Google Play Console: 'Your app signing key's encryption strength does not meet Google Play's recommended minimum standard' I enrolled my apps in 'Google Play Signing'. Now I see in the console the following message:

    https://i.stack.imgur.com/Jmygo.png▾

    I thought that it is due the fact that all my apps were initially signed with the same release key (that I uploaded to Google Play Console during the enrolling procedure to Google Play Signing). So I thought that Google Play sees that the same key is used by several apps and consider the key as compromised. See: <a...
Powered by Linen
Title
u

user

07/11/2022, 5:11 PM
Google Play Console: 'Your app signing key's encryption strength does not meet Google Play's recommended minimum standard' I enrolled my apps in 'Google Play Signing'. Now I see in the console the following message:

https://i.stack.imgur.com/Jmygo.png▾

I thought that it is due the fact that all my apps were initially signed with the same release key (that I uploaded to Google Play Console during the enrolling procedure to Google Play Signing). So I thought that Google Play sees that the same key is used by several apps and consider the key as compromised. See: <a...
View count: 8