Live data from Hacker News

Why is Android Development so difficult/complex? (compared to Web and Desktop)

news.ycombinator.com

1–10 of 30 posts

Why is Android Development so difficult/complex? (compared to Web and Desktop)

#1
This is as much a philosophical question as it's a pragmatic one. I've developed all kinds of apps in my life including Visual Basic GUI programs, Windows Forms Apps with Visual Studio, web apps using PHP and Flask, console scripts in bash, python, etc.

In terms of layers of complexity, none of that experience even comes close to Android Development though. To be honest, even Swing GUI in Netbeans/Eclipse wasn't that byzantine! (in fairness, I hardly ever went beyond Hello World there). To begin with, we are absolutely married to the Android Studio IDE and even though developing a project without AS is theoretically possible, the number of hooves you must jump though are probably too many for the average programmer to comprehend. Honestly, I still don't know how exactly the actual APK/AAB is built or compiled!

On other systems, compilation is a straightforward process like `gcc hello.c` or `javac Hello.java`, maybe a few extra parameters for classpath and jar libs for a GUI app but to be absolutely dependent on an IDE and gradle packaging system just to come up with a hello world APK? Don't you think there is an anti-pattern or at least some element of cruft here?

I get that Android operating system itself is highly complex due to the very nature of a smartphone device, things like Activities and Services aren't as straightforward as GUI Forms. But the point is that Android programming doesn't have to be that complex! Don't you think so?

Re: Why is Android Development so difficult/complex? (compared to Web and Desktop)

#2
I can't theorize on the 'Why' part of your question, but there are ways around using Android Studio IDE to make Android builds without gradle build system.

If you want to learn exactly how the APK/AAB is built and compiled, here are some resources I used to learn:

- https://stackoverflow.com/questions/59504840/create-jni-ndk-...

- https://stackoverflow.com/questions/69566622/android-build-w...

- https://github.com/HemanthJabalpuri/AndroidExplorer/blob/mas...

- https://developer.android.com/tools

Some of the links haven't aged too well, but it's a starting point for learning how things work under the "Android Studio" / "gradle" hood.

Re: Why is Android Development so difficult/complex? (compared to Web and Desktop)

#3
Instead of using the barebones Android SDK you might want to experiment around a bit with Kotlin.

https://kotlinlang.org/

Note that Google is using Kotlin internally themselves for writing Android apps because reasons.

If you want to have a great multiplatform development experience based on Kotlin, add Kotlin Multiplatform (https://www.jetbrains.com/kotlin-multiplatform/) and you are all set.

Re: Why is Android Development so difficult/complex? (compared to Web and Desktop)

#4
Gradle is a very strange build system.. it actively downloads things if you are missing things, but then still will only work if you have the right combination of things on your system (on linux at least), and fails in cryptic ways. Not sure I know anybody actively likes Gradle and that entire build system -- there was something previously like ant something, etc.. if you have an older project good luck having it actually build even when trying to use Android Studio.. it seems to only work if you actively use Android Studio quite often and slowly adapt to each random change to keep your project working properly.

Re: Why is Android Development so difficult/complex? (compared to Web and Desktop)

#6
Only 2 equally contributing reasons:

1. UI is inherently a very complex problem, because of the state. Most of the so called web apps are thin clients with most of the state machine delegated and spread over backend services.

2. Android platform was shitty designed to begin with. Terrible architecture, ugly UX, frustrating docs etc.

Re: Why is Android Development so difficult/complex? (compared to Web and Desktop)

#7
I think its a combination of:

* Android having made lots of compromises to get Java running on resource constrained devices, leading to things like manually saving state in Bundles, Parcelables, SavedStataHandle, etc in combination with Component Lifecycles. These deep seated things remain.

* Lots and lots of undocumented behavior, poor documentation, etc. The Javadoc is in disrepair for many APIs, being just skeleton but not mentioning semantics, arguments, return values in all scenarios etc.

* Lots of API churn, stuff being deprecated constantly. You may need lots of compatibility paths.

* Just straight out bad ideas like Content Providers, which are still used in various APIs like DownloadManager (getting status, etc).

* Still have plenty of fragmentation and behavior differences (Samsung devices, etc)

* Google Policies continue to become more onerous. Seems like more of my effort goes towards administration than actually building. I suspect this is intentional, so only larger teams can get their stuff in Play Store.

* Mobile development in general is still kinda like shipping software on CDs, there is some delay for approvals, and some people won't get your update for a bug fix etc

Re: Why is Android Development so difficult/complex? (compared to Web and Desktop)

#8

I wonder if this is also one of the reasons why Android apps are usually worse than their ios counterparts.

iOS development is honestly the worse.

It got a bit better with Swift instead of ObjectiveC but you still have to deal with XCode and a stupid process to sign and publish your apps.

Re: Why is Android Development so difficult/complex? (compared to Web and Desktop)

#9
I wrote apps for Android when I first got a smartphone, circa 2011, and it was so easy. There was a bit of doc to read to understand activities and intents but that was basically it. At that point you could write an app without running into new surprises.

I tried again to write a tiny Android app last year and couldn't figure it out. There's so many moving parts with SDKs, API levels, support libraries, contexts, fragments, Gradle, ... And the documentation is built similarly, bolting on new chapters when new concepts are introduced, making a whole that is useless and inscrutable.

It's really a shame. Is there a better starting point that could get someone ready to write a simple app in 2024? Some document that would introduce some reasonable workflow from A to Z (whether SDK, React Native, Kotlin, or whatever is simple)?

Post reply on HN