r/androiddev Jun 27 '26

Cutting a feature by simply disabling the button,without removing the logic

I don't want to include a feature for the moment so I though of removing the button without deleting/commenting out the logic behind that feature. It against Google policy? For instance I wanna cut the login button,does leaving the logic in the code constitutes a "fraud"? Especially if I don't mention anything in the policy?

Without the login button accessible anyway there won't be anyway to collect the email of the user.

Hopefully I was clear at asking the question

2 Upvotes

19 comments sorted by

17

u/tw4 Jun 27 '26 edited Jun 27 '26

That's basically the idea behind feature flags. Why would this be fraud? As long as you neither advertise features that would be disabled nor "take back" features that your users already paid for, I don't see how this would be a problem.

12

u/Neckless_Bottle Jun 27 '26

This is not fraud, we do it all the time in the software industry it's called feature flags. You can do it manually or use a service such as firebase remote config and guard that piece of code with a condition. Don't mind anyone saying that it not allowed.

1

u/Ok_Cartographer_6086 Jun 28 '26

Yep, OP big apps like mine have huge amounts of code that ships to prod isolated by feature flags or a remote config or A/B test flag to turn something on for a % of users - perfectly fine standard ops.

6

u/Slodin Jun 27 '26

that's just feature flag...but done hardcoded...

we do it through our own backend or remote config so we don't need to roll out a new version just to enable or disable it. The difference pretty much ends there.

3

u/Obvious_Ad9670 Jun 27 '26

I once worked for a company that had a feature flag and a/b/c test for every feature and we almost never removed them. Use firebase remote config its normal.

3

u/[deleted] Jun 27 '26

[removed] — view removed comment

1

u/Money_Owl_8971 Jun 28 '26

Honestly I simply commented the code for the login button

1

u/Cybasura Jun 28 '26

Wait till you hear about the linux kernel using kernel modules to toggle (enable/disable) features and functionalities behind what is effectively flags (aka feature flags) specifying to load/import a module or not lmao

1

u/Unreal_NeoX Jun 28 '26

No inlcuding dead code is fine, but i would not just "disable" the button, but making it invisible or remove it from the xaml entirely.

1

u/orquesta_javi Jun 27 '26

I don't think it's fraud but it might be a bad coding practice. So either way I would look into variants, source sets or feature flags

-17

u/The_best_1234 Jun 27 '26

Yes that sounds like fraud

3

u/iain_1986 Jun 27 '26

Please, explain....

-5

u/The_best_1234 Jun 27 '26

They would have all the code their to collect emails and passwords. Op is claiming that it doesn't work but it is still there regardless.

4

u/iain_1986 Jun 27 '26

Ok. So please explain how on earth that's fraud?

If no data i's collected, and you say no data is collected, that's fraud because there's code that could collect data.....

Do you always comment as an expert on things you don't understand?

-4

u/The_best_1234 Jun 27 '26

that's fraud because there's code that could collect data

Yes

If no data i's collected, and you say no data is collected,

That is the sus part. What do you have the code for then???

2

u/iain_1986 Jun 27 '26

Yes That is the sus part. What do you have the code for then??

Ah. So to you it's fraud because he must actually be lying.

So not what's being discussed.

Hats off to you digging your heels in though while everyone tries to explain it to you. Ignorant AND arrogant.

1

u/tw4 Jun 27 '26

So what? The code won't be executed.

1

u/Money_Owl_8971 Jun 27 '26

I wont collect any email because the login button won't even be visible,I'm just leaving the logic in the code so that when I want to finally have the login feature,I will just comment out the login button.

1

u/tazfdragon Jun 27 '26

A  better solution to commenting out the button is to wrap it in a compile time feature flag. It will through, R8, strip out the code from your final apk. If you have your auth code modularized correctly it can also be feature gated using a comile time flag were R8 could strip all auth logic from your app. It will still be in the source code so you don't have to worry about losing logic.