/r/androiddev

Photograph via snooOG

News for Android developers with the who, what, where, when and how of the Android community.

News / Articles / Talks / Tools / Open source!

About

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:

  • News for Android developers
  • Thoughtful, informative articles
  • Insightful talks and presentations
  • Useful libraries
  • Handy tools
  • Open source applications for studying

Alternatives

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

New Developer Resources

Build your first app

Starting Android career in 2022

Android Job Interview Questions and Answers

App Portfolio Ideas, Tiered List

Awesome Android UI

Material Design Icons

7000 Icons for Jetpack

Weekly Threads Calendar

Autoposted at approx 9AM EST / 2PM GMT

Links

Rules!

Wiki and FAQ!

Discord!

/r/androiddev

244,560 Subscribers

1

Sign the app for release to Google Play

Before you publish your Android app on the Google Play Store, there's a crucial step you must complete: app signing. This process involves assigning a cryptographic key to your app, confirming its authenticity and safeguarding the security of future updates.

If you're preparing to submit your app, it’s essential to understand how to correctly sign it. To help you with this, I’d like to share a comprehensive guide with step-by-step instructions on signing your app for release on Google Play.

Hope it will be useful for you.

0 Comments
2024/12/18
12:37 UTC

1

Push notifications after target API 34 enforced by google

I honestly just want to vent some frustrations.

I work on a communication app, that are dependent of push notifications, some legacy code with to many cooks that trying to improve.

I don't know if I'm right or if I'm just overthinking things, but I've noticed some downgrades in behavior after Google forced the target API to be 34. And not just for my own app, but also for other apps like discord, Messenger, what's app etc. Where it seems there can be several minutes before a message push actually pops up on my phone -.-

I was waiting a little to see if anyone else would mention it, but have not come across anything on the internet.

I personally find it super annoying when I don't get notified about messages. I've even started regularly opening my discord just to check if there was a message Ive missed, cause it seems like even when i have the app backgrounded it won't notify that there was a response. Now I don't work for discord but I assume that they work with the same restrictions I face at my own job for message notifications.

0 Comments
2024/12/18
12:03 UTC

4

Stable annotation in Compose good question asked no answer on SO

Maybe you know?
https://stackoverflow.com/questions/76667774/stability-and-stable-annotation-in-jetpack-compose

I've been exploring @ Stable in compose. Having encountered this topic:

https://stackoverflow.com/questions/76667774/stability-and-stable-annotation-in-jetpack-compose

I also have concerns in two following:

class SomeViewState {

var isLoading by mutableStateOf(false)

}

for such a class.

1 Is adding a Stable annotation even necessary? Why did they bring it up here then? It's already (mine class) marked as Stable using metrics. By here then I mean post below:

https://stackoverflow.com/questions/68575936/what-do-the-stable-and-immutable-annotations-mean-in-jetpack-compose

u/Stable
class SomeViewState {
  var isLoading by mutableStateOf(false)
}

2 Doesn't adding an unstable public param already violate item number 3, and the contract? As i checked it doesn't recompose without changing param but definition says it should not be, right?

u/Stable
class SomeViewState {
var isLoading by mutableStateOf(false)
var someList : List<String>
}

Is the addition of stable with list passed underneath a trick done to the compiler?
Is there any example that stable/ immutable annotation is used incorrectly and could lead potential bugs? If possible an example would be nice to see how wrong usage breaks recomposition...

1 Comment
2024/12/18
11:57 UTC

12

Firebase Authentication Template with Jetpack Compose

Hey fellow Android devs! I've created a complete authentication template using Jetpack Compose and Firebase.

It includes email/password auth, Google Sign-In, email verification, and Firestore integration - all following clean architecture principles.

Features:

  • - Material 3 Design
  • - Complete auth flows
  • - Production-ready Firestore rules
  • - ProGuard configuration
  • - Proper error handling

I know how time-consuming it can be to set up auth properly, so I hope this helps someone! Available on Gumroad: AuthFlow

Let me know if you have any questions about the implementation!

0 Comments
2024/12/17
19:16 UTC

4

Testing in Play Store

Is it possible to create test so:

- I don't have to add testers email manually

- App is not visible for non-testers in Play Store

- Testers can join by link?

1 Comment
2024/12/17
09:48 UTC

0

Push notification channel: audio file from custom directory

Hello, I have an app that receive push notifications.

Is it possible to set a notification sound using a file store in application download folder or another where app can write? We need to do some custom operation like downloading from internet and record from microphone.

I'm trying doing

channel = new NotificationChannel(id, name, importance);

Uri soundUri = Uri.parse("file://" + applicationContext.getExternalFilesDir(null).getAbsolutePath() + "/Download/Chord2_Rev.wav");
channel.setSound(soundUri, audioAttributes);

But when I receive the notification the audio does not play. The audio file is present and play normally.

Can you help me? Thanks!

4 Comments
2024/12/16
23:30 UTC

107

This will be a huge relief for developers! Was this released recently?

75 Comments
2024/12/16
16:31 UTC

50

ADBR-Server: A Modern ADB Server Reimplementation in Rust

I wanted to share with you ADBR-Server, a complete reimplementation of the Android Debug Bridge (ADB) server written in Rust. It's focused on code maintainability, stability, and better error handling. Currently supporting Linux systems and USB devices (with network and Windows support planned for future releases).

I've split the traditional ADB into two parts - the server (ADBR-Server) and client (ADBR Client). Together they provide enhanced stability, better error handling, and some unique features when used as a pair. Check out the client here: ADBRClient

ADBRServer Repo link: ADBRServer

Why ADBR-Server?

  • Clean, modern Rust implementation compared to AOSP's C-based ADB server
  • Improved error handling and stability
  • Well-structured and maintainable codebase
  • Proven stability with multiple devices (successfully tested with 16+ concurrent connections)
  • Innovative device actions system

Currently Supported Features:

  • Device management (list, monitor, wait-for-device)
  • File operations (push, pull with sync options)
  • App management (install, uninstall with various flags)
  • Port forwarding
  • Reverse port forwarding
  • Shell commands (interactive and specific commands)
  • Root commands (root, unroot, remount)
  • System commands (reboot)
  • Logging (logcat with filters and options)
  • Bug report generation
  • Verity commands (disable/enable for userdebug builds)

Features Coming Soon:

  • Network/Wireless device support
  • Windows OS support

A key innovation in this reimplementation is the Actions system - something that doesn't exist in regular ADB. It lets you automatically run scripts when devices connect or disconnect, all configured through a simple YAML file. You can set up global actions for all devices or specific actions for particular devices, perfect for development environments, testing labs, and automated workflows.

Licensed under the Apache License, Version 2.0 - feel free to contribute or fork it! I'd love to hear what features you'd like to see in both ADBR-Server and Client - drop your ideas below!

5 Comments
2024/12/16
11:20 UTC

292

The OG

16 Comments
2024/12/16
01:03 UTC

11

Mobile Tech Talk Slides from Droidcon NY 2024

0 Comments
2024/12/15
19:00 UTC

2

Testing on specific devices via ADB tunnel

I want to try to reproduce a bug that only happens on Xiaomi devices, and I want a quick edit/compile/test loop. Ideally, I’d sign up somewhere (happy to pay), and they’d give me ADB tunnel access to a specific device somewhere in the cloud.

I looked at Firebase Test Lab, but that involves running automated tests across a whole set of devices, not the kind of quick editing and testing that I want to do.

BrowserStack seems closest to what I want: https://www.browserstack.com/app-live. But they want an annual subscription rather than usage-based pricing. I won’t be needing this on a recurring basis, just from time to time.

Any other options? Thanks!

4 Comments
2024/12/15
19:46 UTC

9

Help with Kotlin Jetpack Compose

(Solved) App is working normally but just the drop down list is not opening. I am still new to kotlin and need some help here

https://preview.redd.it/j75leoqgx17e1.png?width=1920&format=png&auto=webp&s=76a6ca9cfb0f8a9701ede27dde2965716a0fc5f5

ExposedDropdownMenuBox(
expanded = isInputDropdownExpanded,
onExpandedChange = { isInputDropdownExpanded = !isInputDropdownExpanded }
) {
OutlinedTextField(
value = inputMassUnit,
onValueChange = { },
modifier = Modifier
.fillMaxWidth()
.padding(16.dp),
label = { Text(text = "Input Mass Unit")},
trailingIcon = {
ExposedDropdownMenuDefaults.TrailingIcon(
expanded = isInputDropdownExpanded
)
},
readOnly = true
)
DropdownMenu(
expanded = isInputDropdownExpanded,
onDismissRequest = { isInputDropdownExpanded = false }
) {
DropdownMenuItem(
text = { Text("Kilograms") },
onClick = {
inputMassUnit = "kg"
isInputDropdownExpanded = false
}
)
DropdownMenuItem(
text = { Text("Pounds") },
onClick = {
inputMassUnit = "lbs"
isInputDropdownExpanded = false
}
)
DropdownMenuItem(
text = { Text("Stones") },
onClick = {
inputMassUnit = "st"
isInputDropdownExpanded = false
}
)
}
}

13 Comments
2024/12/15
18:00 UTC

8

Best practices for Service-Activity communication in MVVM/Clean Architecture?

Hi Android devs! I'm working on implementing proper service communication in my app following MVVM and Clean Architecture principles, and I have a few questions:

  1. What's the recommended way to handle communication between a Service and Activities/Fragments while maintaining clean architecture principles?

  2. Currently, I'm considering these approaches:

    • EventBus/Flow-based communication through a repository (seems to be an antipattern)
    • Callbacks/Interfaces (but this might tightly couple components)
    • Repository pattern with UseCase layer

How do you handle one-time events vs continuous events?

12 Comments
2024/12/15
12:57 UTC

0

Looking for Android Developers for interview [30min audio-only + $10 gift card]

I'm Karl from limbar.io and I'm looking for Android Developers who've written at least a couple of apps to go through their day-to-day development flow and how they test their changes in order to help us shape our product features.

It's just a 30min call and the participants will receive $10 Amazon gift card right in the end of the meeting!

You can fill out the contact form here !

EDIT: A video call with screen share is preferred but audio-only is also OK, just wanted to make it less work for the participants.

EDIT 2: Thanks everyone! We've reached the quota and will start meeting with the folks!

4 Comments
2024/12/14
18:32 UTC

0

Why embedded activities do not work

Please help me with my configuration: gitgub

I want to make an Android version of an already existing open source project, because the structure of the project must use a NativeActivity (calling via jni is not suitable, it can only contain a NativeActivity), and then I want to add some android ui to the project, so a kotlin is required activity and NativeActivity are displayed together in a task window.

6 Comments
2024/12/14
15:57 UTC

22

Do you personally reply to user reviews on Google Play? Worth the effort?

I’ve been thinking a lot about how we engage with our users on Google Play. Replying to reviews can be time-consuming, but I’ve also seen it turn some negative ratings around. I’m curious. Do you take the time to reply to reviews, especially the negative ones ? Have you noticed any improvements in user sentiment, updated reviews, or overall ratings & hence visibility after engaging with them?

I’m asking because I’ve been working on a tool (it uses a bit of AI) to help streamline the response process. I’m hoping to fine-tune it based on real-world feedback from those who’ve tried different approaches. I’d love to hear your experiences and any strategies you’ve found effective!

31 Comments
2024/12/14
11:29 UTC

8

Multiple Google Developer Accounts?

Hi there,

Just want to ask what the current policy is on having multiple google developer account?

I am currently on a Business Account (co-founder) publishing a live mobile game. I am thinking of going off and creating a new game with a new official company, in the exact same industry.

Is this legal?

Obviously, it would be horrible if the two accounts were "linked" in anyway in that one terminated account will destroy the other as well.

Thanks.

8 Comments
2024/12/14
09:11 UTC

1

How can I programmatically open the Wear OS watch face (homescreen) instead of the app launcher when using an Intent in Wear OS?

I'm using the following code to open the homescreen on Wear OS. However, when I execute this, it opens the app list (launcher) instead of the watch face. Is there a way to directly navigate to the watch face (homescreen) instead of the app list in Wear OS?

val startMain = Intent(Intent.
ACTION_MAIN
)
startMain.addCategory(Intent.
CATEGORY_HOME
)
startMain.addFlags(Intent.
FLAG_ACTIVITY_NEW_TASK
)
startMain.addFlags(Intent.
FLAG_ACTIVITY_CLEAR_TASK
)
startActivity(startMain)
0 Comments
2024/12/14
08:52 UTC

0

Service to distribute app to friends and keep it updated?

I've prepared a Native React app (with expo) that I now have to distribute to some friends.
This app is uselesss to anyone else other than us, so I'd rather keep it on a private feed.

Other than that, I'd like for them to have a simple installation and automatic updates. iOS support is currently not needed but welcome, and obviously I'd rather have something free but I'm open to some light spending.

I've read that Expo allows me to do this, but to use it they'd have to install the Expo Go app and go through it to access my app, while I'd rather have a standalone application.

Any suggestions?

10 Comments
2024/12/14
09:19 UTC

1

Gradle issue: No model of type 'DummyModel' is available in this build.

I got an OutOfMemorryError when trying to rebuild my project, removed .gradle/cache which was like 140GB. And now AS is giving me this error:

No model of type 'DummyModel' is available in this build.

> No builders are available to build a model of type 'com.intellij.gradle.toolingExtension.impl.model.utilDummyModel.DummyModel'.

Any ideas on how to fix this? thanks in advance.

1 Comment
2024/12/14
02:15 UTC

8

Looking for beta participants

Hey /r/androiddev.

I'm working on a project and I'm looking for Android devs to participate in my beta to provide feedback.

The project is an app release management application meant to make submitting releases to the Google Play Store a bit easier and quicker.

If this sounds interesting to you, let me know or check out https://appdeploypro.com to sign up.

0 Comments
2024/12/14
01:41 UTC

4

Sticky headers in side column (Jetpack Compose)

Hi everyone,

I'm working on an app where I want to display a list of cards with dates shown on the left side, similar to the Google Calendar app (see attached image). The dates should stick to the top as sticky headers while scrolling through the list.

So far, I’ve managed to implement sticky headers with the dates displayed in between the cards, but I can’t figure out how to position them next to the cards instead.

I’d really appreciate any tips, advice, or resources to point me in the right direction—I've been stuck on this for quite a while.

Thanks in advance!

https://preview.redd.it/a89fwkzchn6e1.png?width=445&format=png&auto=webp&s=cf4b783a0e11dcd00bc4a5004428dcc054d48bc6

2 Comments
2024/12/13
17:56 UTC

0

Help me understand some strange issues with multiple instances of an activity being created.

I'm having a heck of a time dealing with an issue in a Xamarin Forms app. I need some native platform advice here, though.

The issue is being caused by customers doing something that caused Android to decide to create and foreground a new copy of our MainActivity. This app effectively ONLY has that activity, so it is not our intent to have both. For a long time I could not determine what users were doing to cause this but yesterday I had a breakthrough. These two actions can reliably create the problem:

  1. Plugging in or unplugging a USB device.
  2. Changing the system text size in system settings.
    • (There are probably other system configuration changes that work too, this is just the first one we noticed.)

We DO register for USB attach/detach events as outlined in this article. We do have a device filter, but curiously this happens even if I plug in a device that is not our intended device. I have tried a build that does NOT register for these broadcasts and that has no effect.

In working on this I determined the launch mode of our activity was NOT being set to singleTask or singleInstance, and those sound like they're the solution. Easy fix, right? So I did that and I made a build. On my boss's tablet it works just fine, when he plugs/unplugs devices the app doesn't respond.

On MY tablets, this produces no change in behavior. I've tried both singleTask and singleInstance. Both result in my app clearly starting a new MainActivity and pulling it to the Foreground. My onNewIntent() method is NOT being called. Something is not right.

Further, I see odd behavior in other apps. Like, if I'm in Google's Calendar app, when I plug in a keyboard I see the background momentarily disappear then reappear. That makes me think this app is having the same thing happen to it as well. Is this normal?

So I'm currently asking for more people with the same tablets to test, but I'm curious if more people have seen an issue like this or if there is something cursed about my particular tablets. These aren't common tablets, they're a ruggedized industrial tablet. I have one with Android 11 and one with Android 14 and see the same behavior on both, but have witnessed the "correct" behavior on another person's Android 11 tablet.

I guess another thing I'm working on is trying to cobble together an app in Android Studio to test this out WITHOUT Xamarin involved, but if you could hook me up with the source for something that'd help me diagnose! To say I'm rusty with Java is an understatement. But I'm somewhat confident it will still be an issue, as other apps like Google Calendar seem to be impacted.

Update

This MIGHT be solved. We were not setting up our activity to handle Keyboard, KeyboardHidden, or the relevant font scaling configuration changes and it looks like that can cause EXACTLY what I'm seeing. Definitely a thing I hadn't seen before because I don't CREATE apps, I INHERIT them.

1 Comment
2024/12/13
17:35 UTC

17

Compose / ViewModel Data best practices

Hello everyone!

I just got a question from a colleague and now wondering how you guys handle string formatting on your side.

Let's take some examples:

You have a date that will be shown to the user, do you pass the DateTime (e.g ZonedDateTime / LocalDateTime) in the state to the Compose screen and do the formatting logic in the Compose screen or do you do your required formatting date logic in the ViewModel and pass the formatted string in the state they object to the Composable?

You have to display a string composed of two strings e.g "$stringA, $stringB". (Assume there is no other usage) Do you pass in the state object both stringA and stringB in two different fields and you concat them in the Composable or do you concat them in the ViewModel and pass concatenateString in the state?

On my side I handle both cases in the Composable since it's display logic and I want to keep it here but I'm curious to see how you would handle it and arguments on the other way 👍

19 Comments
2024/12/13
14:36 UTC

42

How Notion Builds Their iOS and Android Apps

4 Comments
2024/12/13
13:55 UTC

Back To Top