Category "kotlin"

How to pass an interface as parameter in koin

I'm so beginner in koin. I have a method that named "MesheRepoImpl" that get an interface as parameter. I know that I can't pass an interface to a method in Koi

How to restrict the user to enter leading, trailing and consecutive space in a string in kotlin

I have a scenario, where I need to restrict the user to enter leading, trailing and consecutive space and if the user enters do not update the text with space b

Pass context to store data in Room

I am trying to save received data to local storage using Room library. I have created a database class in which I define the parameters I need and define the co

bottom navigation view doesnt shows fargment unless double click

i fixed the previous error but now this here. fragment isnt visible if i dont click bottom navigation two times. my code: activity_main.xml <androidx.fragmen

Agora SDK- Is it possible to implement peer to peer (one to one) "video chat" using Agora SDK for Android?

I was wondering is there a way to implement one-to-one video chat using Agora SDK. I found lot of resources to implement the video call feature with establishin

Kotlin Cannot Inflate Layout

I am building an application that has a GridView that contains a dynamic amount of CardViews. I am having issues accessing the TextView elements in the individ

Redirect a Fragment to another Fragment

I'm studying a lot about Kotlin, and I have a single project to make. So, I have some Fragments and one Activity. All actions from left menu are working, ok. Bu

How can I do work with a coroutine in a foreground service? Kotlin Android

I am trying to build an app that will run in a foreground service and give feedback to the user only through audio. I have followed this example: https://better

embedding golang server with flutter

I have web server written in golang which uses graphql package gqlgen and gorm for database. Since golang can be compiled and run on android I wanted to create

Switching back to previous task in android

I have three activities A, B, and C. As expected when C is changed to pip (picture in picture) mode, it is separated out as a new task. When back pressed is pre

How test a ViewModel function that launch a viewModelScope coroutine? Android Kotlin

I´m trying to figure out the simplest way to test this kind on function members, I´ve seen more complex cases like Coroutines - unit testing viewMod

How to create a list from scanned BLE results

as invers to the question asked here How to convert Flow<List<Object>> to Flow<Object> I want to convert my Flow<Object> to Flow<List

SavedStateHandle kotlin always receiving null

I need a Factory to support Viewmodel WITH ARGUMENTS. I tried to implement the class which is commended "AbstractSavedStateViewModelFactory". I applied the trou

Monitor reading access to contacts ANDROID without rooting of device

There is a way to monitor reading access to contacts? I tried this experiment: I developed an application that reads contacts subsequentially i ran it. After th

Add a loading effect with progress

Often when we download something use the terminal or the command prompt, we get a progress like this: ----------10% after a while ----------------------------

How to add elevation just in the bottom of an element? Jetpack Compose

I'm trying to add some elevation or shadow just in the bottom of an element. For this element I'm using a Tab composable. How can I add this elevation/shadow ju

Can't fetch saved account from Keychain

I made a simple analog of the account manager for iOS using Apple Keychain: @Serializable data class Account( val name: String, val password: String,

ArrayList get value of another ArrayList

I have a problem with ArrayList. I have 2 ArrayList and they are dependent. class MainActivity : AppCompatActivity() { var arrayList1 = arrayListOf<Stri

How to count how many times document was downloaded in Firebase?

I have a collection in my Firestore Database with posts. Each post has some comments as a document in the collection comments in the main post document (screens

getStringExtra() not working in Adapter Class

I am trying to get the pass the current user data into the this adapter class. However, I failed to use the getStringExtra() where it keep mentions that the get