97,649 questions
Tooling
0
votes
3
replies
49
views
Pass data to parent in layout phase
I'm trying to have a parent decide its children's positions based on information about its grandchildren (or other general data), passed upwards by its children.
This should be possible, since the ...
-2
votes
0
answers
89
views
Can you please tell me how to position components in a JFrame in Kotlin? [closed]
I'm learning Kotlin for use as a general purpose JVM language, and I wanna use the javax.swing module. I am trying to position a JLabel at the very middle of the frame, but I cannot find any functions ...
0
votes
0
answers
83
views
PowerSync: How to serialize data for crud upload
I'm connecting a mobile app to Supabase via Powersync. I managed to log in and even upload some data. But now whenever I create new data or update data on the client side (the device), it is not ...
1
vote
1
answer
63
views
PowerSyncException: get() called with query that returned no rows
I'm connecting PowerSync to an Android app. Upon launching the app I get the:
PowerSyncException: get() called with query that returned no rows
error. That's all it gives me, it doesn't point to a ...
Advice
0
votes
2
replies
72
views
Camera2 + MediaRecorder: How to crop recorded video to match preview (portrait WYSIWYG) on Android (Rockchip device)?
I am building an Android app using Camera2 API + MediaRecorder where the device is locked in portrait mode (kiosk mode).
Problem
The camera preview looks correct (portrait, 9:16), but the recorded ...
-1
votes
0
answers
50
views
KMP Windows Run Failed with Navigation3
Code as below:
First Screen:
@Composable
fun FirstScreen() {
Column(
modifier = Modifier.fillMaxSize()
) {
Toolbar()
}
}
@OptIn(ExperimentalMaterial3Api::class)
@...
Advice
0
votes
0
replies
26
views
Optional Koin injection parameter
I could not find any good solution online, so I will post what I found to work here.
In order to have an optional parameter for Koin injections you can use the following code:
val someModule: Module = ...
0
votes
1
answer
63
views
How to instantiate a connected PowerSyncDatabase by calling a suspend function inside a synchronized block?
I'm trying to create a singleton to return an instance of a PowerSyncDatabase.
class OnlineSyncDatabase {
companion object {
// @Volatile
private val instance: PowerSyncDatabase? = ...
0
votes
0
answers
56
views
MediaMetadataRetriever fails after 102 requests with exception 0x80000000
I want to check if each of my mp3 files has a valid picture that the Android system can read.
For this I iterate over all the items in the MediaStore.Audio.Media and then ask the ...
2
votes
1
answer
44
views
How to provide a PowerSync database instance via Hilt
I have a Hilt module that is supposed to provide a PowerSync database instance, which is then injected into ActivitydataSource, and the ActivityDataSource is injected into ActivitiesRepository.
import ...
1
vote
1
answer
144
views
Is `This argument is a new instance so stopService will not remove anything` valid for `stopService(Intent(...))`, or is it a false positive?
When I run Inspect Code in a specific version of Android Studio, I get a warning for the following code in MainActivity, specifically at the point where the Intent is created:
stopService(
Intent(
...
0
votes
0
answers
63
views
I can't play this specific clearkey drm in my app
I tried this stream in other players, they played it perfectly. While, my app isn't able to play this, there shows a blank screen in my app. But, it's playable in other iptv players. Please, tell me ...
0
votes
1
answer
59
views
AppCompatDelegate.setApplicationLocales() restarts activity when switching from system default to any other language despite configuration handling
Similar unresolved issues:
Android restarts activity although locales configuration changes are handled by app
Activity recreating on first locale change
My activity has `layoutDirection|locale` which ...
1
vote
1
answer
81
views
Unresolved reference 'await' and 'user' in Firebase Auth (Kotlin Multiplatform / AndroidMain)
I'm working on a Kotlin Multiplatform (KMP) project and I'm trying to implement a Firebase Authentication DataSource inside androidMain. Even after adding the Firebase dependencies, the compiler ...
Best practices
0
votes
3
replies
48
views
Ways to hint the compiler about return type when calling generic function
A nice generic function I use to call python functions in another process, using Json....
inline fun<reified Tin0, reified Tin1, reified Tout> callPy2(
methodName:String, input0: Tin0, ...
