Questions tagged [android-multithreading]

7 questions
8
votes
3 answers

Why can you run a Kotlin coroutine on the main thread?

I am having trouble understanding why this piece of code can work properly: override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) launch(Dispatchers.Main) { log("A") } log("B") } which is…
0
votes
0 answers

Android FMX C++ builder : Why does my thread seem to stop until I click a control

Android FMX C++ builder : Why does my thread seem to stop until I click a control I'm using C++ Builder 10.4 update 2 to write an android app. A thread, "FindThread", has been created to scan an array of words for words that start with a particular…
0
votes
0 answers

Can't use volatile and synchronized in KMP project for iOS source set

I'm trying to develop a KMP library and I'm not able to use @Volatile and synchronized for iOS source set. For @Volatile, the error is: Declaration annotated with '@OptionalExpectation' can only be used in common module sources and, for…
-1
votes
1 answer

How to run multiple UI threads in one Activity without ANR?

I want to create a monitoring application and their updated UI every second. for example I have 10 textView for display timing and 10 Progress bar to set some progress to display and 6 timers for display time like a stopwatch. all things in the same…
-1
votes
1 answer

How to send variable between classes while multithreading

This a much simplified version of my multithreading project and its just a way to replicate the issue in a simpler way for easy understanding. So I have two classes startSession.java and main.java what I am trying to do is to send a variable from…
-1
votes
1 answer

Capturing every frame to recognize text ARcore - Do i need to use semaphores?

I am developing an app in which I want to recognize text in real-time. At first I was using onTapListener so whenever the user was tapping on the screen the current frame was being captured and after that the text recognition was called. Right now I…
-2
votes
1 answer

Do we need to use a synchronized block for Room database

I have some code that I would like to use something like a threadpool because I am making multiple transactions at once. I used to use a SQLite database with a synchronized block. I figure that Room handles multi-threaded behaviour for you. Is…