/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 r/androiddev š¾
If you are paranoid and obsessed with privacy the app will help you in critical situations.
I wanted to combine usability and would be happy to get your feedback š
You can check out the source code - https://github.com/hardalgorithm/ParanoidsPal-PrivacyLock
Hi everyone,
Iām an independent Android developer with several apps published on the Google Play Store. My apps are simple and only display AdMob ads; they donāt collect, store, or process any user data beyond what AdMob might handle.
Recently, Iāve been concerned about the legal side of things, especially since Iām based in Europe and need to comply with GDPR. I want to make sure my apps are completely legal, but the process feels overwhelming for a small developer like me. Hereās what Iāve done and what Iām unsure about:
1. GDPR Consent: I understand that in Europe, I need to display a consent dialog for AdMob ads. How exactly should this be implemented to be compliant?
2. Privacy Policy: I know I need one, but what should it include if my apps donāt collect data directly (only AdMob does)?
What I also find confusing is whether most developers actually follow these legal requirements. There are so many apps out there, and it seems like not everyone is doing this. Do developers often skip these steps, or is this something Google and regulatory bodies take very seriously?
I want to ensure everything is legal and avoid any future issues, but I feel lost with all the regulations. If anyone can share clear steps or resources (especially for small developers like me), Iād really appreciate it.
Thanks for your help!
I have recently been in the closed testing phase for my app and have noticed that my app only displays a default app icon and not the name that I chose on for the Google Play Store. How do I fix this or is this normal for the closed testing period?
Say I use int for my auto generated pk, and the limit of int is about 2 billion, does that mean I can have simultaneously 2B entry, or a total of 2B inserts to this database?
If I delete the item with pk 1, will autoGenerate know 1 is available to be the pk again?
Android-related features:
Read more about it here:
https://medium.com/p/93d7fddae8c0
I will start. Weirdest question I got was probably this:
Do you agree or disagree that we can replace Builder pattern with data classes in Kotlin?
I answered some gibberish but the correct answer was that Builder pattern is still very useful when we want to initialize complex objects.
Hi,
For my company we are developing an app where we have multiple subscriptions. All these subscriptions belong to one "group" as so to speak. When reading the docs it is confusing how Google Play Store handles this.
In the docs they come with different tiers ("Gold", "Silver"). In their documentation and images this one tier represents a single subscription.
But at the section Allow Users to upgrade, downgrade, change their subscription, they say this: If you sell multiple subscription tiers, such as basic and premium subscriptions, you can allow users to switch tiers by purchasing different subscription's base plan or offer.
I'm not a native speaker, but in my opinion this contradicts eachother. So atm I do not know which way to pick.
As an business example:
A user buys a subscription which allows him 50 items on a monthly basis. When he buys the subscription which gives access to 100 items, this means that he should be able upgrade to 100 items on a monthly basis, disregarding the earlier 50 since this is a lower tier.
With apple you have such thing as subscription groups, which is exactly what we wanted. When you upgrade, apple let's you pay the difference in cost and you use the upgraded subscription until the end of the month where it gets renewed with the upgraded subscription.
Hi! I'm looking for a way to get notified about incoming RCS messages from different services or users, specifically to handle incoming message events. I found Google's RCS Business Messaging API, but it seems like it's only meant for businesses to send messages, not to receive them.
Iāve also heard about a Samsung API for RCS. Does it work on newer Android devices?
Lastly, is there a way to check if RCS is supported or enabled on the phone programmatically?
Any info is appreciated. Thanks!
I made an app for a real state agency that showcases it's projects etc Now they want to publish it on Google play The problem is the company is located in algeria and don't have duns number yet which takes a month to get Is it a good approach to create an individual account for the CEO and publish the app in that account even though it's about his "organization"?
I'm losing my mind here. I have a React Native app on Google Play that works fine for most people, but some users can't even find it in the store. When they use a direct link, they get the "not compatible with your device" message.
The weird part? These EXACT SAME devices:
I've checked literally everything:
Tested on:
(Probably affects more devices but these are the ones I could test)
I've gone through all the Android manifest stuff, checked all Play Console settings multiple times, and everything LOOKS correct. The app is doing fine with most users, but these specific devices just won't play ball with the Play Store version.
Any ideas what could be causing this? Happy to provide more technical details if needed, but I'm running out of things to check. š©
Edit: If anyone needs the technical nitty-gritty (manifest, config), I can add it in the comments.
Hey Android Devs!
A while ago I thought would be nice to automate generating composables @ Previews
with standard placeholders by "simply pressing a button" in the IDE. I then thought that could actually become true by developing an intelliJ plugin, so here I am :)
I added a few options and have a few more in mind. The plugin is also K2 compatible.
Curious if you also find this useful and if you have any feature requests.
You can find it in the plugin marketplace
š
Is there a way to validate the architecture of an app? I mean for example I have my usual data, domain, presentation split and I want to enforce Viewmodel classes only being inside the presentation package, usecases being inside the domain package and repository implementation being in the data package. This is just a rough example for clean architecture.
Is there a tool to test this? I know it sounds draconian but a lot of companies seem to do this and I was just wondering whether there is an open-source tool that can do this.
I have interview coming up and I'm having a competency based interview under the following categories in native android development. It's an Android II
Kotlin + key language features, Compose and other key frameworks, basic architecture
I'm fairly confident in all Kotlin/coroutines and it's features but haven't haven't had much interview experience in Compose. I'm fairly familiar with Compose but don't know what to expect.
Specifically speaking about animating screen changes. I've found little to no discussion on this and Google's sample apps offer no guidance. I am extremely curious to hear what people here think.
So let's say we have the following, simple setup:
From Screen A I can navigate towards a Screen B and a Screen C.
Screen B is supposed to slide in from the right as Screen A slides out to the left and vice versa when the backstack is popped.
Screen C should slide in from the bottom while Screen A is not animated at all during the transition.
When navigating from Screen A to one of the other screens, the enter transition is used based on my destination declaration of B/C so they slide in from the right/bottom as expected. But instead of using the exit transition declared in B/C, it uses the exit transition declared in A! So now I'd have to check whether I'm transitioning to B or C in my setup for Screen A when determining the exit transition, which is doable in this simple setup but very quickly becomes unreasonably difficult to manage in a more complex app. It seems incredibly counter-intuitive to me that the exit transition isn't taken from the destination that I'm navigating towards, similar to how it works in XML when executing a fragment transaction.
I had implemented a generic solution, passing in my desired transition as a navigation argument to each screen and retrieving it from the target state in the enter/exit and from the initial state in the popEnter/popExit transition lambdas. That worked totally fine and was very easy to use after the initial setup but refactoring an app of mine to use type-safe destinations has opened this question for me again. How do other folks here deal with this? I'm kind of baffled that I haven't managed to find discussion or any helpful samples on this as it seems like an extremely common issue to me?
Hey folks, wondering if anyone else is running into issues using the debugger in AS with their (large) jetpack compose app.
We've got an app written 100% in jetpack compose - it's fairly large - a quick git ls-files
shows 183k LOC.
The app is pretty slow in debug mode which I believe is expected, but if I attempt to run the debugger or attach the debugger to an already running project everything grinds to an absolute halt. If the debugger gets running at all it takes multiple minutes between any action (click a button to go to a new page or something) to see the screen progressing and to eventually hit the breakpoint. It becomes effectively unusable.
I'm wondering if anyone else has run into something similar or has any tips to debug this type of issue.
For reference I have a 2023 macbook pro with 38 gigs of memory so I feel like I should be fine on the hardware side.
The majority of Android apps, including Reddit, some parts of Facebook, Facebook Messenger, Instagram and many many more, simply do not work in landscape mode on phones, tablets or ChromeBooks? Their website counterparts work fine in landscape mode using browsers on PCs, laptops, tablets and ChromeBooks. Some apps cannot even be installed on tablets and ChromeBooks from Google Play Store.
However, many apps from smaller organisations and independent developers do work just fine in landscape mode and cope admirably with rotation of the screen, usually expanding the data displayed to avail of the screen width or switching to splitscreen mode as is the case with Android Settings, WhatsApp and a variety of e-mail apps.
Hey everyone,
Does anyone use Compose Preview Screenshot Testing for UI localization testing?
We currently go to screen in the app on emulator, take a screenshot and send it to the vrt (visualtesting) , where QA approve the standard of screenshot. And the nex time screenshots will be compared. And we can see the differents
I want to understand whether Compose screenshot testing can be used instead of our approach or is it more like an addition
I was playing with Play Asset Delivery and I created 2 versions of the same app to target different devices (mobiles and watches). Since the app is very simple, the two versions of the application shares the model and the viewmodel in which the AssetManager is called to download an Assetpack. The issue is that it works perfectly fine on the mobile but on the watch as soon as I call the requestPackStates function the application crashes and I get a "Failed to bind to the service" error. Has anyone of you encountered the same issue?
com.google.android.play.core.tasks.RuntimeExecutionException: com.google.android.play.core.internal.aa: Failed to bind to the service.
Android development can be a confusing world for newbies; I certainly remember my own days starting out. I was always, and I continue to be, thankful for the vast amount of wonderful content available online that helped me grow as an Android developer and software engineer. Because of the sheer amount of posts that ask similar "how should I get started" questions, the subreddit has a wiki page and canned response for just such a situation. However, sometimes it's good to gather new resources, and to answer questions with a more empathetic touch than a search engine.
As we seek to make this community a welcoming place for new developers and seasoned professionals alike, we are going to start a rotating selection of highlighted threads where users can discuss topics that normally would be covered under our general subreddit rules. (For example, in this case, newbie-level questions can generally be easily researched, or are architectural in nature which are extremely user-specific.)
So, with that said, welcome to theĀ November newbie thread! Here, we will be allowing basic questions, seeking situation-specific advice, and tangential questions that are related but not directly Android development.
If you're looking for the previous October thread, you can find it here.
Hello!
Recently, I started working on a new logging/tracing library, written exclusively in kotlin. Is compatible with the OpenTelemetry standard. In the latest version I added the ability to create metrics (such as counters, gauges, etc.) for your application and also an easy way to extract those metrics in the OpenMetrics standard (aka Prometheus). If you want take a look here: https://github.com/smyrgeorge/log4k
Let's say that I have a screen called ItemScreen
with an ItemViewModel
. To navigate to it I use a route called Item
defined as follows:
@Serializable
data class Item(val id: String)
What approach should I take to pass that id
to the ViewModel?
Should I fetch the route in the ViewModel itself using SavedStateHandle like this:
@HiltViewModel
class ItemViewModel @Inject constructor(
private val savedStateHandle: SavedStateHandle,
) : ViewModel() {
val item = savedStateHandle.toRoute<Item>()
}
Or should I pass it to the screen composable:
composable<ItemScreen> { backStackEntry ->
val item: Item = backStackEntry.toRoute()
ItemScreen(
id = item.id,
)
}
And then pass it to the ViewModel from the composable e.g. using LaunchedEffect with the id
as the key:
LaunchedEffect(id) {
viewModel.setId(id)
}
The first approach is mentioned in the Android docs here. Is it the right approach to get nav args in the ViewModel when using a screen-scoped ViewModel?
Problem Description: I am working on an Android project in Android Studio, and each time I try to build or sync the project, I encounter the following error:
A problem was found with the configuration of task ':app:processDebugMainManifest' (type 'ProcessApplicationManifest').
- In plugin 'com.android.internal.version-check' type 'com.android.build.gradle.tasks.ProcessApplicationManifest' property 'mainManifest' specifies file 'E:\15kmes\GESTIONALOYA\APP\gestionalo\app\src\main\AndroidManifest.xml' which doesn't exist.
Reason: An input file was expected to be present but it doesn't exist.
Possible solutions:
1. Make sure the file exists before the task is called.
2. Make sure that the task which produces the file is declared as an input.
Environment Details:
E:\15kmes\GESTIONALOYA\APP\gestionalo
gradle-wrapper.properties
: Gradle 8.7AndroidManifest.xml
: E:\15kmes\GESTIONALOYA\APP\gestionalo\app\src\main\AndroidManifest.xml
What Iāve Tried So Far:
AndroidManifest.xml
File: I have confirmed that the AndroidManifest.xml
file is in the path E:\15kmes\GESTIONALOYA\APP\gestionalo\app\src\main
. I even tried replacing the file with a new one to ensure itās not corrupted.AndroidManifest.xml
file and the containing folder (src/main
) have proper read and write permissions.build.gradle
:app/build.gradle
file to ensure the sourceSets
block points to the correct manifest file: sourceSets { main { manifest.srcFile 'src/main/AndroidManifest.xml' java.srcDirs = ['src/main/java'] res.srcDirs = ['src/main/res'] assets.srcDirs = ['src/main/assets'] jniLibs.srcDirs = ['src/main/jniLibs'] } }.gradle
Folder:.gradle
folder in the project directory (E:\15kmes\GESTIONALOYA\APP\gestionalo\.gradle
) to force a cache and configuration regeneration. Then, I rebuilt the project, but the issue remains.gradle-wrapper.properties
to previous versions, such as 7.5
and 8.3
, but I encounter the same error regardless of the version.JAVA_HOME
and in Android Studio match (Java 17).--stacktrace
and --info
:./gradlew build --stacktrace --info
command to get more error details, and it consistently points to the AndroidManifest.xml
file not being found in the specified path.Summary: Despite all the above attempts, the error persists, and Gradle continues to fail to recognize the AndroidManifest.xml
file in the specified path, even though the file is indeed there.
Question: Has anyone experienced a similar problem or can suggest other methods to solve this issue? I am looking for help in identifying if there are any additional configurations or tool version conflicts that could be causing this. Any suggestions would be greatly appreciated.
Hello! Iād like to share with you a step-by-step guide on how to upload an app to the Google Play Store.
I hope you find it helpful!
Hello, Iām working on a new compose app and i need to make it build and run all tests in git pipeline, but here is the catch, I need to run ui tests for phone version in portrait and landscape and the same for tablet.
Why do I need that? I need to get the coverage report because we use sonar and the minimum accepted coverage is 70%. (We use jacoco and we are aware about the issue in compose code coverage)
My question is how do you guys deal with it? Is there any git repository that I can use as an example ?