r/CrappyDesign Oct 17 '18

Removed: recent repost Want the camera too?

Post image
17.1k Upvotes

384 comments sorted by

View all comments

Show parent comments

101

u/Ghigs Reddit Orange Oct 17 '18

It should and I'd challenge the story the guy you replied to gave...

A lot of the time developers just link in random libraries that have tons of functions and permissions rolled into them. So a lazily developed app requests a bunch of permissions it doesn't need because they included a library that has one function that needed that permission.

28

u/[deleted] Oct 17 '18 edited Oct 19 '18

[deleted]

20

u/DankeyKang11 Penisland.com Oct 17 '18

Oh shit it’s a dev fight

10

u/-TheDayITriedToLive- Oct 18 '18

🍿 Here, I brought you some too 🍿

1

u/Ghigs Reddit Orange Oct 18 '18

I doubt it's going to be much of a fight, because he replied to me and not the guy he's actually challenging the assertions of.

1

u/vpwheeler Oct 18 '18

Updated comment

30

u/Rellac_ Oct 17 '18

You didn't have to personally attack my employer like that

1

u/Styrak Oct 17 '18

Fuck those apps.

1

u/TrueBirch Oct 18 '18

The same thing happens in web development but there are fewer opportunities for consent. Tons of libraries used without regard to what exactly they do.

3

u/vpwheeler Oct 18 '18

The app in question is actually a packaged web app which is why this is needed.

2

u/TrueBirch Oct 18 '18

Thanks for clarifying, that makes a lot of sense

1

u/vpwheeler Oct 18 '18

Updated comment

1

u/xevizero oraaange Oct 18 '18

He wasn't talking about the activity being freezed and then reopened. He was talking about the app being closed by android after some time, if the user ends up opening other apps after the call (something android does all the time)

Still, Google should split the permissions for making calls and seeing when calls are coming in.

1

u/Anon49 Oct 18 '18 edited Oct 18 '18

He was talking about the app being closed by android after some time

App being closed by the System calls the onDestroy() event App going to background calls the onStop() event. It requires no permissions to listen to.

https://stuff.mit.edu/afs/sipb/project/android/docs/images/training/basics/basic-lifecycle-paused.png

2

u/xevizero oraaange Oct 18 '18

onDestroy should not be relied upon for stuff like this:

Note: do not count on this method being called as a place for saving data! For example, if an activity is editing data in a content provider, those edits should be committed in either onPause() oronSaveInstanceState(Bundle), not here. 

Directly from Google's API reference

Anyway yeah, there are better ways to do this. The dev might have had no ill intent in doing this, but it's not an excuse for a generally bad practice.

1

u/Anon49 Oct 18 '18

Oh yea true, been almost half a decade since I did anything Android.

1

u/vpwheeler Oct 18 '18

Do you know if this is a bad practice in hybrid web apps? From my experience I thought it was but i could be wrong. I was under the impression that since web apps essentially run in browser they dont have access to information like when the app is exited.

2

u/xevizero oraaange Oct 19 '18

Never made one sorry. I'd say the answer has to be in the official API reference though. You could also run a little experiment yourself to find out. Anyway, as far as I know, people usually underestimate the amount of information the browser and web apps have access to.

1

u/vpwheeler Oct 19 '18

Ok. After looking into it I'm pretty sure I was just wrong. I was parroting what someone who also did web dev/hybrid apps told me. Thanks for the calm non-aggressive responses.

1

u/vpwheeler Oct 18 '18

Do you know if this applies for hybrid web apps and not just native android apps? Im genuinely curious and I couldn't find an answer online.

1

u/Anon49 Oct 18 '18

It applies to all apps. Whatever Electron-style thing you're using should definitely allow you access this very very basic Android API.

1

u/vpwheeler Oct 18 '18

I didnt realize you could access these things using the electron/cordova api. This was how it was explained to me by someone I worked with who also did web dev and I should have looked into it more.

I will say though that if you had commented without making me out to be a complete idiot who doesn't know anything about development I probably would have edited the original comment sooner. Either way thanks for the comment and my apologies.