/r/androiddev
News for Android developers with the who, what, where, when and how of the Android community.
News / Articles / Talks / Tools / Open source!
News for Android app developers with the who, what, where, when, and how of the Android community. Probably mostly the how.
Here, you'll find:
This sub-reddit isn't about phones' and apps' general functionality, support, or system software development (ROMs). For news and questions about these topics try using other subs like
Starting Android career in 2022
Android Job Interview Questions and Answers
App Portfolio Ideas, Tiered List
Autoposted at approx 9AM EST / 2PM GMT
/r/androiddev
Hi guys,
What would you recommend for AR small object tracking (shoebox size) on Android? Vuforia works well, but at $25K a year (premium license), it’s a bit steep 😅, and AR Foundation’s object tracking is iOS-only.
Thanks for your time
I’m part of team working on a platform for context-aware, text-based ads in AI-driven apps. Our solution uses REST calls to display relevant, non-intrusive ads, offering an alternative to Google’s SDK for banner ads.
With our API, apps can make a call with context (e.g., ‘user is discussing anime’) and receive a tailored text-based ad, like: ‘Stream your favorite anime on Crunchyroll! Start your free trial and enjoy unlimited access to classics and new releases. Visit crunchyroll.com now!’ Developers have the flexibility to display these ads as they see fit.
Would this align with your app’s strategy? What features or challenges do you think would make this effective compared to Google’s SDK?
I’m open to paying for insights on this. Please DM me if you’re interested.
Bug 1 - In Java classes I can do Alt+Insert and I have this options:
And if I do Alt+Enter I have more options:
Let's go to a Kotlin class, Alt+Insert:
And Alt+Enter in the same Java class:
There are options that are java specific but where is the Tests and Copyright options?
Is this some bug, or were the options removed for kotlin, or did they ever existed?
Bug 2 - Smart completion
In Java Smart completion works nicely to autocomplete interface implementations, just do Ctrl + Shift + Space:
Why does kotlin have no suggestions with Ctrl + Shift + Space?
Bug 3- Auto convert java to kotlin also not working
I try to paste a piece of code from a java file to a kotlin file and it never converts. In the past it even converted code copied from a webpage. The option is enabled in the settings.
I've uninstalled all plugins, uninstalled AS, removed files, reinstalled AS from scratch and the bugs persist.
Anyone has the same issues?
I have been working to get my indie game - SnowFall - to be available in the Audi Application Store for many months. I was not informed that it is available in the store. But out of curiosity, checked my dashboard today and saw I had 32 installs. Has anyone else published their android apps thru Audi or other vehicle company? Anyone getting better support or communication from the companies?
So I am developing an app that is currently using firebase as a database. I am now looking into a way too store secret keys so they aren't written in the code. I did some research and one of the most secure ways I found was to use a keystore. So I used it following this video: FULL Guide to Encryption & Decryption in Android (Keystore, Ciphers and more) which uses a keystore and writes the hash to a file in the internal storage.
I copied exactly how this video has done it then I went to bed. Then I just started thinking but can't i not just store the secret keys in my firebase database and retrieve it from there? Like is this not a valid approach because I am thinking since the database has limited access, it would be reasonably safe in there. Can anyone tell me which approach is better or if there is a better one i should use?
I have some concerns about the multi-domain modul
What if you need to use usecase class declared in two modules: domain:user and domain:coupon?
To solve #1, we create a usecase interface and declare the interface in the domain:user:api and domain:coupon:api modules, respectively, but how do we share the model declared in the domain?
Thanks for reading
So far we have been using Android modules + git submodules to share our libraries between apps. It is getting tiring and we think we need to publish them as libraries to make version and code management easier.
We are looking to host it ourselves, and want anything that works with android gradle. Is there any FOSS that helps do that? Anybody who have tried or done it and is willing to share experience?
Excited to announce Ksoup 0.2.0, the latest update to our Kotlin Multiplatform library for HTML and XML parsing. This release includes several key fixes and updates specifically for Android, making it easier and more reliable to work with structured data on Android devices.
📲 Android-Specific Improvements:
• Resolved Android Empty Document Error (#96) - Fixes empty document issues that occurred with network libraries
• Metadata Parsing Enhancement - Shortcut icons are now parsed as part of metadata (#89)
• Updated Compile & Target SDKs - Now supporting SDK 35 for both compile and target, with adjustments to ensure compatibility with older Android versions
• Upgraded AGP - Bumped Android Gradle Plugin to 8.7.1 for improved build performance and stability
🔄 General Enhancements:
• WatchOS Support - Expands Ksoup’s cross-platform capabilities (#90)
• JS Unpacking - Added for seamless integration across platforms (#86)
• Upgraded Dependencies: Kotlin 2.0.21, Ktor 3.0.1, Gradle 10.7.2
👉 Check it out and get started here: https://github.com/fleeksoft/ksoup
We’d love to hear your thoughts or feedback from the Android community!
So I learned about the remember keyword to remember some previous code in a composable. That's nice I guess , but I could just run that code in a constructor/remember some states as member variables. Why would I use remember?
I come from C++ btw.
This frustrated me to no end until I resolved it, and Google's own support wasn't any good at helping me. And I couldn't find any info online.
If you have tried to update your "Organization Address" in the Google Payments settings in order that it will display correctly when starting to confirm your Google Play Developer account but you keep seeing your settings revert back to what they were before when you refresh, I have your solution.
Apparently, the problem is that the information does not save correctly following the prompt for "use this address or use suggested address."
So, the way to get around this is to make note of EXACTLY what Google's suggested address for you in (including the +4 of the Zip) and type that in manually as your address.
Ignore Google's attempt at autocomplete when typing in the address, as they will autocomplete to something different than their suggested address (for example, the autocomplete says "Avenue" but the suggested address says "Ave").
If it's a perfect match, then the save will be successful, and you will receive an e-mail saying that the payment settings were updated.
I had thought initially my issue was that I hadn't updated my US tax into, but even once I did that, I was still having my problem of the organization address reverting to my old address upon refresh (and never getting an e-mail that a change happened).
But this "type the exact address that will be suggested in order to avoid the next prompt" method turns out to be the real solution.
Let me know if this post helped you.
I'm about to build an app which will use an llm and was wondering if anyone has been able to use a local llm in production? I'm guessing not but would love to be surprised.
When messing around on my own I use llama right now so hopefully it isnt too much longer!
I'm trying to configure an SD card for my Android Studio virtual device, but the "External File" option is greyed out in the AVD settings. I've already tried changing the target API level from 35 to 33, but the option is still unavailable.
Our team running AS Ladybug has to force quit ADB multiple times a day. We do plug / unplug a lot of USB devices as we have to test on them.
ADB will be running 100% in Activity Monitor and be unresponsive. If you do adb devices it will just sit there until you cmd+c kill it in terminal.
Going into Activity Monitor and force killing it will then get it back in shape as AS will restart it.
This is a newer issue to us but happens to every developer but I don't have replication steps. I know I just get to restarting it multiple times a day, 3 or 4 times.
Currently I'm using github actions ci/cd platform for: lint, ui/unit tests and packaging. I want to add static code analysis - SonarQube wa my first go-to but it turns out they are free only for public repositories. Looking for a good alternative
Hi, I need some help and explanation if u can. Im writing characteristics on my device but doesn't get any response. Did I wrote command in a wrong way? I'm so confused, Log's says im writing but im never reading.
private fun calculateChecksum(data: ByteArray): Byte {
var sum = 0
for (byte in data) {
sum += byte.toInt()
}
return (sum and 0xFF).toByte()
}
val commandGetDataPart1 = byteArrayOf(
0x51.toByte(), // Start byte
0x23.toByte(), // CMD
0x00, 0x00, 0x00, 0x00, // Data
0xA3.toByte() // Stop byte
)
val checksum = calculateChecksum(commandGetDataPart1.copyOfRange(0, 7))
val commandGetDataPart1WithChecksum = commandGetDataPart1 + checksum
Google recommends using play signing which means you won't have access to the keystore file. I want to know if this will cause conflict when you want to release your app to other stores
So I've been kinda force do work with KMP/Compose and wonder - has Android went full compose or material-components (MDC) are still a thing? (having to deal with kotlin-compose combo recently and looking at MDC it looks somewhat nicer…)
Spent whole day trying to get emulator working. Best I managed was running a macOS-13 emulator and took 26min to start the app and run 1 instrumented test.
Where can I find some good script to run instrumented tests on Github Actions CI/CD?
Or should I switch entirely to some other CI/CD?
Posting here cause I think most people who are not that well versed with compose will come across this issue, when working with custom clusters that need to be swtiched around.
I have been trying to create a google maps screen, with clustering, that based on a condition, will switch between markers (positioning and image). When switching, performance is TERRIBLE. It literally lags for 2 seconds, and any click while updating makes it crash.
I can kind of see why this would be terrible for performance, but not how to fix it
@Composable
MyScreen {
GoogleMap(
modifier = Modifier
.weight(weight = 1f),
properties = MapProperties(mapType = MapType.NORMAL),
uiSettings = MapUiSettings(
zoomControlsEnabled = false,
mapToolbarEnabled = false,
tiltGesturesEnabled = false,
myLocationButtonEnabled = false
),
cameraPositionState = cameraPositionState,
onMapLoaded = { }
) {
Clustering(
items = if (selectedType == ProjectType.TYPE_1) items1 else items2,
clusterItemContent = { item ->
val isSelected = (item == selectedItem)
val imageRes = when {
selectedType == ProjectType.TYPE_1 && isSelected -> R.drawable.ic_drawable_1
selectedType == ProjectType.TYPE_1 -> R.drawable.ic_drawable_2
selectedType == ProjectType.TYPE_2 && isSelected -> R.drawable.ic_drawable_3
selectedType == ProjectType.TYPE_2 -> R.drawable.ic_drawable_4
else -> R.drawable.ic_drawable_5
}
Image(
modifier = Modifier.size(36.dp),
painter = painterResource(id = imageRes),
contentDescription = null,
)
},
onClusterItemClick = { item ->
coroutineScope.launch {
...
}
true
}
)
...
}
We have an app that's preloaded into OEM devices. After a FOTA update, certain permissions that were pre-granted (e.g., ACCESS_NOTIFICATION) are reset and un-granted, even though they were granted during the preload process. Question is whether the resetting of ProtectedPermissions is a standard behavior after FOTA updates or if it is an issue related to specific OEMs or device configurations?
Has anyone written or know of a compose written login UI using the Firebase Auth sdk? I've been using the prebuilt UI from Firebase for the past year and its unbelievably broken & annoying.
Seems like a very standardised component, so curious if anyone is aware of an existing version before I go re-invent the wheel!
I use a windows PC and I build my code on archlinux inside virtualbox (windows bad for rust, ndk, env vars etc.). Virtualbox crashes if I try to run the emulator inside it so I've been trying to run the AVD on windows itself. However I can't connect the studio to the emulator. I tried wireless debugging but studio won't discover device. On google I found this but I'm not sure how I do this on windows.
How can I connect the studio to the emulator so that it detects the device and I can run apps? Should I try to first connect using adb?
EDIT: It is 'Host' AVD in title
as the title says my phone can't generate bluetooth hci snoop log. I've restarted it many times but the bugreport always shows just "firmware_events.log" in the folder where the logs are supposed to be.
Here's a screen from the report folder i've generated with adb:
Btw weirdly my phone doesn't display the option to generate bugreport in the developer options, here's a screen (it doesn't show the whole developer options tab but it should be at the beginning of it right?):
I'm using android version 10, my phone is a POCO X3 NFC. If you need more information ofc ask
Would you recommend it for serious development? I know that Android Studio works well on Linux since I have that OS on my work laptop and Android Studio runs way better on that than on my personal Windows 10 laptop. However, I am not sure how well it would fare on the Steam Deck (the cheapest one and not the OLED one)