r/androiddev • • Jan 11 '20

[Possible rant] Why Android development seems like a mess?

New here. And new to Android development. Developing in .NET is my job.

So I developed so far 3 Android apps by myself, and publish 2 of them to Play Store.

I just finished one's latest version and published, and I feel I want to share some of my experience on my Android dev journey. Maybe some rant and misunderstanding here, I apologize for this in advance (and please comment).

Simply put, I feel Android *seems* like a mess. Maybe I am still not proficient enough to get everything right at once.

- For very simple apps or scenarios, I think the default setup of Android IDE & SDK, as well as docs, is all right. But once I want to use more system features, or apply more designs, Android seems to be really hard or complicated to get everything right. The official Android dev docs seem good for learning, but if you have some special scenarios, it seems you are on your own.

(For example, if you want to send network / HTTP request, the official docs recommended using Volley / Cronet libraries, which are quite complicated to use if I want to achieve something like JSON-Object serialization (maybe I didn't get it right). This makes me wonder "Why the system itself does not have built-in network / HTTP API like Windows or Linux?". Not to mention, Retrofit+OkHttp is (IMHO) way much easier than either of them. Why this was not mentioned in docs?)

- Support / Compat libraries / classes. OH MY GOD. Maybe I don't fully know the logic behind this, but I hate these things. Every time when I try to use something, like, Activity or Fragment, I have to figure out whether I should use support libraries or system native ones. I know usually I should use support libraries. The problem is, some classes from libraries (maybe system also? I cannot remember) derived from the native ones. In some scenarios, if I want to use support library ones, I will get errors. I don't really know anymore.

- Outside Android system territory, it surprises me a lot that a lot of libraries are lack of proper documentation. I know this happens everywhere, not only in Android, but one thing I feel about Android is the lack of "conceptual consistency".

Allow me to present an example. When you are working on Windows, say, .NET, even though there are many differences in .NET BCL (Base Class Library) and 3rdparty libraries or even BCL itself, you still can have some expectation on how they approach the objective, since all .NET stuff has more or less a unified "feel" on design rules, so that you will not get lost very easy. Linux is kinda similar (but maybe this has my own factors - I did a bunch of Linux system programming).

But in Android, system does not provide a lot of stuff (either non-exist or simply broken), so a lot of 3rdparty libraries took over the roles what I think should be a part of system (like high-level network stuff). These libraries have their own (and sometimes hacky) ways to do things. But they sometimes don't provide good documentation to explain them, even for the new features. Examples such as:

- Retrofit2's Kotlin suspend function feature (what I can do, and what I cannot do, can I return a list instead of one object, or such)

- Dagger's DaggerApplication, DaggerAppCompatActivity, DaggerFragment, etc., and how to do ViewModels properly (I didn't know these classes until searched through tons of results online)

- Epoxy's generated models and integration with Android ViewModels ("I see red in Android Studio, it says Unknown symbol! What should I do???" / "why I cannot compile? - oh, different class name in package-info.java")

- Gson's ProGuard rules (Where is it? - Production build got my model classes stripped out and caused Retrofit stop working properly)

- The integration among all these libraries ("How can I use Epoxy + ViewModels + Dagger altogether???")

And it is quite insane that I have to use all these libraries in an Android to achieve "maintainability". Why Android doesn't have a built-in way to do these? Why Android Jetpack???

- Maybe I'm really unlucky. But for some reason, every time when I try to figure out how to solve a particular problem in StackOverflow, I always bumped into a page that has either no answers (10%), or has a bunch of answers without that green mark (70%, the rest 20% are jackpot). I thought tons of people use this System, so statistically most of the problems should already have answers. But nope.

(Not to mention tons of pages have outdated information. Gosh)

(...and because of the rapid changes on all Android stuff, it is impossible to find a friendly beginner book talking all these things I mentioned above - I like to read a book to get my hands dirty, and I think books are more trustworthy)

- Tons of blogs. No offense. I just never see this kind of things before. A lot of developers from all over the world write blogs in Medium or such to explain the same things in many different ways.

For example, Dagger. To be fair, Dagger is complicated because it tries to solve a complicated problem (dependency injection). But man, I read a lot, I wrote a lot, but when I first read these blogs, they just gave me tons of confusion (especially when someone uses outdated information). Even Google's official docs are confusing as hell (Thermosiphon? REALLY?) Where is the really official documentation???

- System bugs. This really shocks me. Like, a crashed NotificationListenerService must be restarted by restarting my device. Or, broken EditTextPreference not being able to limit inputs to numbers even if I set it so.

- Flutter / Fuchsia. I don't know whether Google is seriously considering using these to solve Android's issues...

Well, not quite pleasant. I guess maybe because I am still a beginner. I may misunderstand most of things here.

I can only hope I will get better on these things and not be frustrated easily like now.

374 Upvotes

193 comments sorted by

45

u/Zhuinden Jan 11 '20 edited Jan 11 '20

New here. And new to Android development. Developing in .NET is my job.

Welcome! It's always interesting to see insights from other platforms.

I've actually always been hoping to see someone who's an Angular expert to come to Android and see what they think of the navigation options available. Maybe one day that'll also happen.

Simply put, I feel Android seems like a mess. Maybe I am still not proficient enough to get everything right at once.

Nope, some things like android:elevation, shared element transition support, fragmentTransaction.addToBackStack() and fragment lifecycle predictability, these things are generally just flat out broken out of the box and take lots of effort to get right (if you at all eventually get it right at all -- shadows are easier to render on the canvas than to use the shadow "support" in the framework).

(For example, if you want to send network / HTTP request, the official docs recommended using Volley / Cronet libraries, which are quite complicated to use

Oh yes, the official docs are absolutely bad in that regard. They really like Volley so they are trying to sell it, but it's not worth using over either Retrofit, or a regular HttpUrlConnection.

Surprised they didn't try to sell Agera a lot more (before it was officially dead).

Not even sure where Cronet came from. Jake Wharton said "you know when you need Cronet" so in our case that's probably "never".

People who talk to REST APIs on Android, they just use Retrofit + GSON/Moshi always.

I think the Jetpack docs actually recommend Retrofit.

  • Support / Compat libraries / classes. OH MY GOD. Maybe I don't fully know the logic behind this, but I hate these things.

And it is quite insane that I have to use all these libraries in an Android to achieve "maintainability". Why Android doesn't have a built-in way to do these? Why Android Jetpack???

It's so that new features aren't locked to a given API level. For example, they introduce MotionLayout at API 28, but they want to make it usable on API 19 reliably.

So they have the support libs (now called AndroidX core libraries).

That made sense when they started, although lately they separated everything and lost unified vision across the AndroidX libraries.

Also androidx.transition is broken where android.transition isn't, super weird.

but one thing I feel about Android is the lack of "conceptual consistency".

The framework exposes Activity/Service/BroadcastReceiver/ContentProvider and they eventually hacked in some "helper frameworks" like Fragments, and otherwise they absolutely don't care what you do.

They also provided the View system as an abstraction over the Canvas, where the Views are able to persist/restore their own state, and get parameters from XML (and define their hierarchy in XML).

Anything beyond that (managed cursors, Loaders, SyncAdapters, LocalBroadcastReceiver, AsyncTask, ...) which were usually intended to "help" proved to be hindrances, and were an API mistake in hindsight. Most of them are deprecated by now.

  • The integration among all these libraries ("How can I use Epoxy + ViewModels + Dagger altogether???")

I don't use Epoxy and honestly have no intention to use either Epoxy nor MvRx.

If you have integration problems, you probably don't want them either.

Same applies to ViewModel, really.

Although if you want to get it in Dagger, then you either need to pass the Provider<ViewModel> into your ViewModelProvider.Factory, or you create a @Subcomponent that @BindsInstance's the ViewModelStoreOwner then defines the @Provides method that actually uses the ViewModelProvider and the ViewModelStoreOwner to get the instance of the ViewModel by invoking the Provider<ViewModel> inside a Dagger @Module.

Not hard, just convoluted. But if you do the subcomponent variant, you can safely inject ViewModel class into your Activity, and still not break onCleared() callback. Yay!

That's kinda the one thing that Dagger-Android does (beyond the ability to auto-generate the subcomponent that can inject an Activity/Fragment while @BindsInstanceing it automatically).

Speaking of which...

  • Dagger's DaggerApplication, DaggerAppCompatActivity, DaggerFragment, etc., and how to do ViewModels properly (I didn't know these classes until searched through tons of results online)

You only need Dagger-Android if you need the unscoped subcomponents for the injection site. If you do that, you can move the ViewModelProviders.of(viewModelStoreOwner).get(T::class.java, object: ViewModelProvider { return viewModelProviderMap.get(T::class).get() } into a @Module.

All of this is totally optional. Hell, even ViewModel is optional.

  • Maybe I'm really unlucky.

I think it's mostly a question of tooling. For example, I have an absolute horror experience with @BindingAdapter and InverseBindingAdapter and ListenerUtil and so on with Databinding.

I'd rather just write Kotlin extension functions and never write logic in my XML, so much easier to work with and maintain and explain and onboard. Why would I choose Databinding? No idea.

For example, Dagger. To be fair, Dagger is complicated because it tries to solve a complicated problem (dependency injection). But man, I read a lot, I wrote a lot, but when I first read these blogs, they just gave me tons of confusion (especially when someone uses outdated information). Even Google's official docs are confusing as hell (Thermosiphon? REALLY?) Where is the really official documentation???

They have a new tutorial at https://dagger.dev/tutorial/01-setup

Their "official documentation" is probably the code and the unit tests, though. Feels like BouncyCastle.

  • Flutter / Fuchsia. I don't know whether Google is seriously considering using these to solve Android's issues...

Flutter seems to be a second team (Chromium team) working on a completely separate product.

Even if Google switches the Nexus/Pixel series to Fuchsia, Android will still live on elsewhere, I'd think.

System bugs. Or, broken EditTextPreference

Yeah you learn over time what's broken and what's not. For example, OutlineProvider is absolutely broken, I haven't used any of the Preference framework in my past 5 years of development. Because it sucks and you can do it yourself with a SharedPreferences.

So many things you cannot trust, wow. I think the biggest mistake though is to use the Activity task stack, and Fragment transaction backstack for navigation. They make everything hard to manage and extremely unpredictable. The intent flags just flat out don't work, singleTask still allows a second task, and so on. Absolute garbage tbh. The new Jetpack Navigation builds upon them and inherits their flaws as such. Now they even want to deprecate the alternatives.

Well, not quite pleasant. I guess maybe because I am still a beginner. I may misunderstand most of things here.

I can only hope I will get better on these things and not be frustrated easily like now.

I think some of the new "additions to the Android developer toolkit" were written by people who hadn't written Android apps, but try to build abstractions for them without a true understanding of what they're solving.

So now instead of 1 solution/framework, they have 7 frameworks you need to lego together and hope they work in conjunction.

Or you get errors like "Restarter must be created only during owner's initialization stage", you never know.



I haven't had quite a few of these problems people often mention ever since I ditched Jetpack and the Fragment Backstack and the Activity Task Stack using https://github.com/Zhuinden/simple-stack. Maybe I should write more tutorials and make it as accessible as Koin.

3

u/[deleted] Jan 12 '20

Thank you for your kind (and enlightening) comment! Especially, thank you for your explanation on the purpose of support libraries. I totally forgot about that.

Indeed, I made this post to contribute my perspective. Also, I want to see how far my feeling is not reflecting reality. Like what I said, I'm a beginner, so it is inevitable I could misunderstand something.

Most of these libraries I used are due to the experience I have on interviews. Companies asked me to write an Android app using these libraries explicitly to "prove I have the ability to make business apps". Personally, I don't quite like this trend, as I feel that learning specific libraries are not "real" learning (just my personal opinion).

With that said, I still used some of them in my own apps mostly because they did provide some value to simply further maintenance (like Dagger). But this page of comments helped me get a much clearer picture of the Android ecosystem. After all, I still don't want to bind myself to certain libraries.

A personal opinion regarding Flutter and Fuchsia, considering how Android developed, I am currently cautiously optimistic. I will definitely try Flutter at a later time, though.

Again, thank you very much!

2

u/eff-your-stupid-app Oct 03 '24

Angular dev here! I'm just using Capacitor to wrap our web app, and not a day goes by I don't bitch about Android Studio and Gradle or the emulation (or both.)

As a rule, I don't shitpost on github repos just bc they haven't fixed the bug I ran into. As a fellow dev, I've also made plenty of stupid bugs and have fixed < 100% of them, made poor design decisions, and fallen short of the mark. And by extension, I treat software in general the same way.

But goddamn does the Android ecosystem make me rethink that policy.

2

u/Blaze2020 Jan 11 '20

In regards to databinding I found out that when you overuse and begin to put logic in xml or binding adapter things go bad very fast but if you use a display model generated from view model for example and you map inside the display model all the properties you want to bind then you will save alot of code that you will write inside the fragment.

2

u/Zhuinden Jan 11 '20

On the other hand, if I need to delete a file that has an associated binding object, then I have to delete the Gradle build cache in .gradle/build-cache-1, invalidate caches and restart, AND clean the project, in some random order.

So far I don't feel that it paid back for the 1 or 2 lines of Kotlin extension functions that it moves to XML. :/

3

u/[deleted] Jan 12 '20

Wow. Thank all of you for your kind and enlightening comments (over the night)! I read all of them one by one.

As I mentioned, I'm a beginner on Android, and plus, when I was writing this I just finished my app's dev and I was tired (around 2:00 AM). Hopefully my words are appropriate and polite to you.

Just some rumbling in regards to the comments I have seen (and things from them I have learned).

- Believe it or not, I started to learn Android because I don't want to bind myself to Microsoft stuff. My philosophy of this is that, learning only platforms / frameworks / libraries is not real learning, as they will be ultimately deprecated (remember Microsoft Silverlight?). I know this is hard to achieve (after all you need them to finish the jobs), but I try to make sure what I learn is transferrable.

So, when I found out that some (venture) companies I have interviewed treat libraries as "technologies", it just made me nervous. Even though these interviews are the reason I was using these libraries, I agree with what u/hskdob said:

But with vanilla Android SDK, you have to write a lot of messy verbose code to code some simple features. Thus, increasing the need for learning architecture.

This is what I want to achieve. "I can write software regardless of what platforms, frameworks, or libraries I will use".

- Another thing is, my day job is mostly to maintain software, most of the time .NET. But I also do old stuff related to embedded systems (anyone remember MS BASIC 7.0/7.1 in MS-DOS? VB5/6? Watcom C?). I dealt a lot of "legacy code". For some reason I quite like this, maybe because I grew up with DOS and Windows and knew Windows' internals quite well.

IMHO, maintaining software (already in production) is a little bit different from writing new ones to be sold. It is not only about using the latest / coolest technologies / patterns / architectures, but also about how to minimize the negative impacts on production / manufacturing / customer's workflow on my best, etc.

So when I was writing these "rants", I actually have some (not mature, though) business / enterprise thinking in mind. After all, assume I have a small company, and I got products that the code looks like a mess. This only affects my company's livelihood. But I was kinda shocked that a giant corporation did similar things like this.

- When I write my own stuff, I tend to avoid using too many libraries and stick to vanilla ways (e.g. use Android SDK only and not involve with NDK). Of course, my last Android app was not like this, because I tried vanilla but found it hard to maintain (possibly due to my experience not good enough). I understand every platform has its own weirdness. I just feel comparing some other platforms, Android changed way too fast.

u/ZeikCallaway mentioned Web development. Believe it or not, I did that as well, and was exactly like that. This is one of the main reasons why I decided not to get into Web development yet (nor use it in my job's products). Basically, I have to work out a stable workflow for our guys before I can start using them. Again, minimal impacts on customers and manufacturing guys.

(My-immature-thought on this is that, maybe this is good for venture companies, because they need to show the latest and coolest stuff off to get venture money)

Anyway, again, thank all of you for your kindness commenting on my immature post. I really hope I can reach the point of contributing real stuff to the community someday.

1

u/[deleted] Jan 12 '20

But with vanilla Android SDK, you have to write a lot of messy verbose code to code some simple features. Thus, increasing the need for learning architecture.

This is what I want to achieve. "I can write software regardless of what platforms, frameworks, or libraries I will use".

Yeah, from my perspective, Android SDK, its community ecosystem, Java, Kotlin helped me learn to write better code. But still, most jobs theese days require a language and a framework (Java and Spring, PHP and Laravel, Ruby on Rails etc). If I'd had to switch, I will still have to spend some months to completely learn the language and the framework. Some of those are very big and very magic (Spring), thus harder to learn.

4

u/dantheman91 Jan 12 '20

Not to mention, Retrofit+OkHttp is (IMHO) way much easier than either of them. Why this was not mentioned in docs?

Because it's not maintained by Google.

"Why the system itself does not have built-in network / HTTP API like Windows or Linux?".

It does, they're just not particularly friendly compared to the alternatives.

In some scenarios, if I want to use support library ones, I will get errors. I don't really know anymore.

You're really not grasping the problem compat libraries solve. You essentially always want to use them. What errors are you getting?

Retrofit2's Kotlin suspend function feature (what I can do, and what I cannot do, can I return a list instead of one object, or such)

Read about coroutines? They're not too difficult to get started with, there are various easy to follow tutorials. I would think in a day or two you can know enough about coroutines to be using them in a not horrible way.

Dagger's DaggerApplication, DaggerAppCompatActivity, DaggerFragment,

Dagger Android was a mistake. Just use standard Dagger, they've deprecated dagger Android.

Epoxy's generated models and integration with Android ViewModels ("I see red in Android Studio, it says Unknown symbol! What should I do???" / "why I cannot compile?

So don't use Epoxy? That's a library issue, not really Android

- The integration among all these libraries ("How can I use Epoxy + ViewModels + Dagger altogether???")

This, along with other comments, just seem like you aren't taking the time to actually understand how and why these libraries are solving problems. I typically don't recommend blindly using libraries without having an idea of how they work.

And it is quite insane that I have to use all these libraries in an Android to achieve "maintainability".

Very sane compared to anything using NPM. There are relatively few libraries you need to pull into a project. The framework has been broken out into smaller libraries, that's not a problem. You don't need to use dagger or epoxy or most other libraries. Right now I would say you can get pretty far in a project with retrofit, moshi, coroutines and the support libs.

- Maybe I'm really unlucky. But for some reason, every time when I try to figure out how to solve a particular problem in StackOverflow, I always bumped into a page that has either no answers

Typically if you're finding very obscure bugs like this you're doing things very wrong and need to take a step back and make sure you understand what you're actually trying to do and how the system works that you're working with.

I like to read a book to get my hands dirty, and I think books are more trustworthy

You work in technology and don't realize that the offerings change frequently? I wouldn't trust things written more than a year or two ago on most topics. You could still make an app with things that were out there 5 years ago but there are better tools available these days. This isn't unique to Android.

Tons of blogs

That's literally every framework in every language. There are tons of blogs and tutorials on literally everything.

System bugs. This really shocks me.

I would love for you to show us a system that hasn't had bugs in production. You work with Windows, how frequently are there patches and how frequently do things break? It's not rare.

- Flutter / Fuchsia. I don't know whether Google is seriously considering using these to solve Android's issues...

No one knows about fuchia, not worth worrying about .It would be years away from being mainstream. It seems like you may not really be understanding flutter if you're asking that.

Yes, Android has it's share of problems. I've professionally done Scala/Lagom, nodeJs/TS/JS, Android with Kotlin/Java, Angular with TS, and a few others as well and I can say that I don't think Android is particularly harder than any of these other tools. They each have their own problems, many of which you've posted here. Documentation from the creator is never enough to be proficient with best practices. It would be a full time job for them to keep updating it and it's heavily opinionated as well.

I would say you should start trying to figure out how things actually work. You're using libraries and running into issues. Nearly every library you've mentioned is opened source. Go through and figure out at a high level what they're doing. It'll help you a lot in the long run.

3

u/[deleted] Jan 12 '20 edited Jan 12 '20

Thank you for your comments.

I may not make it clear on the library thing. Actually I'm not a person who likes to use libraries and not asking why. My first Android app actually uses none. So yes, I agree with you about the library usage. They indeed may obscure or limit my view of the development.

I mentioned in another reply. 2 of the 3 apps I wrote are only hobby apps (1 is requested by the company which interviewed me). They are definitely not professional ones. The reason I used these libraries is that I can see the reason and value behind them, so I want to give it a try in my own stuff and see how it goes.

Even though most libraries are not Google's (except Dagger), I've found that they were widely used in Android development (and I've encountered in several job interviews). As a beginner, I think these are a part of the Android development "ecosystem", even though they are not Google-made, thus I made these points.

Some points I want to comment:

- I've done Windows and Linux programming for several years, but I just started Android in less than 2 months. So I agree that I have not taken time to fully understand what is going on behind (which I mentioned it a little bit in the original post)

You work in technology and don't realize that the offerings change frequently?

I am fully aware of that. But like I mentioned in another reply, my day job is to maintain software, so not only I need to think in technical, but also in business sometimes. Android moved and deprecate things too fast in my case. Microsoft didn't deprecate Windows API and .NET API in such a scale. I like to learn something new, but on the other hand, I want to put them into use in my job. So I don't want to have something less than 1-2 years getting into my workplace's codebase. This is the point I want to make (and this is just my opinion).

(Same as Flutter / Fuchsia. I mention or think about this because I do need to think about what will happen in 3-5 years. This is my point)

- About blogs, again, no offense. This is just my observation, nothing else. Combining the libraries required to use in practical, I could not find enough docs to help me understand what is going on. So searching online yielded a lot of results in blogs. I know this is really common in Web and Mobile development. Maybe I am more familiar with desktop app development, thus I didn't read a lot of blogs.

- Yes, every system has bugs. But I never see the main functions of Windows controls (Win32, WinForms, WPF, UWP) didn't work as expected. They might have minor bugs, but not something that you set a property and it did nothing. Again, maybe I don't see many other systems, but I think this should be normal, not something I need to take care of.

(P.S. You mentioned Windows. I thought about it, it is not rare to see Windows breaks, especially in Windows 10 (which I'm not pleased either). But since this post is about Android, I didn't mention this at all - plus I know Windows enough to solve most of the problems I encountered. Still, I never see a Windows control just didn't work at the basic function level, though)

I guess mobile and Web are moving quite fast, thus I may not get used to this yet. What I see is that mobile shares a lot of things like the Web, and they are quite open compared to desktop apps like Microsoft. So yes, your points are right, it is just I didn't get there yet (I only did Android stuff less than 2 months).

Again, I don't mean to offend you, nor saying I am incompetent to learn. This post is merely showing my own experience from a desktop app (and embedded system) developer, nothing else.

1

u/dantheman91 Jan 12 '20

I mention or think about this because I do need to think about what will happen in 3-5 years. This is my point)

That's not really a thing in the mobile world. Native apps are not the right approach if that's what you want. You'll be a lot more successful with that with a PWA or something along those lines, browser technologies are more stable.

Most large apps are rewritten within every 5 years or so. I've been a part of multiple fortune 100 rewrites, with the previous codebase being 5-7 years old on most of them. It depends how much functionality and how important the app is.

Android has promised backwards compatability and for the most part they've kept it. If you want it to still be maintainable years down the road then I would advise avoiding as many libraries as possible.

1

u/[deleted] Jan 12 '20

That's good to know. It's just that I'm not in a Fortune 100 environment, nor writing a large app.

I will say whether rewrite or not is depending on the environment. If I was in Fortune 100, then yes, you are probably right. But still, I prefer verifying it by myself.

For my case, if I were writing an app to control one of our small portable machine testers, we expect the app can support as many devices as we can, and we expect the app needs only a few maintenance after we shipped it.

Yes, you might say this is a desktop app way or native app way. But the thing is, not every company has the resources to rewrite apps every 5-7 years, especially the companies that are not software shops.

(I have heard of this rewrite idea when I was in college. I asked a Microsoft Visual C++ guy coming to our school a question about legacy C++ application, and his answer is the same)

BTW, I fix legacy code. I was in the same mood that when I saw someone wrote bad code because he/she didn't understand how things work (like using Application.DoEvents() instead of using multi-threading), I was frustrated and thought they should not do that, etc.. But after several years working with other people, I started to understand sometimes it is not all their fault. They have to develop the software using whatever they have.

So I get your point, yes, I probably should not use that many libraries without knowing how Android actually works. But I do actually know (to some extent), and I use them (successfully) in my hobby app because they do provide a cleaner structure than what I did in the previous version without them. But this does not mean I cannot say something about the practice on docs or architecture. In my opinion, it has problems. Even though many people adapted to it, it still has problems. Working around something broken should not happen from the first place.

Again, no offense. I am aware of the fact that I don't have the same experience (in Android) as you (only 2 months), and I'm not saying you are wrong (in fact it is good to know how this works in large organizations). It is just different people having different backgrounds. So I guess don't take my words too seriously?

1

u/dantheman91 Jan 13 '20

I will say whether rewrite or not is depending on the environment.

I'm at a start up now, I've done big and small companies and I'd say its' really not dependent on the environment. It's dependent on the requirements and how much time it'll take to manage the tech debt vs redoing it.

we expect the app can support as many devices as we can, and we expect the app needs only a few maintenance after we shipped it.

Well it should more or less work then. Especially if you don't upgrade the devices running the app, it should work fine. The problem is the OS keeps on progressing so if you want your app to work on the latest, it needs to be maintained.

legacy C++ application

You realize that the language has little to do with this. Languages have updates and require updates as well. Swift has breaking changes every year etc.

I started to understand sometimes it is not all their fault. They have to develop the software using whatever they have.

It's their job to bring up the cost of doing it that way. Most good engineers don't stay in environments where they're not given the time they need to make a maintainable and quality product.

Working around something broken should not happen from the first place.

Have you never worked on a system that promises backwards compatibility? Decisions are made that seem good at the time, and then things progress and sometimes it wasn't the optimal solution. They either have to break backwards compatibility, live with the changes, or introduce a new api that doesn't have backwards compatibility. There is no such thing as a widely used framework that doesn't work around something broken.

I'm confused how you say you shouldn't have to work around something broken but you also don't want to rewrite anything and also say "They have to develop the software using whatever they have."

It is just different people having different backgrounds. So I guess don't take my words too seriously?

For context, I've been a tech lead at fortune 100s, been sole maintainers at startups that have their whole business depend on their apps, and a variety of things inbetween. I've had offers at FB and Amazon, at this point I've seen how things are done in a variety of places where things would generally be considered "being done right". A lot of your complaints are things that are not unique to Android and you'll encounter in nearly any modern framework.

1

u/[deleted] Jan 13 '20 edited Jan 13 '20

I think you are confused because you didn't get my points (and intensions of this post). I can see from your replies.

That's fine. As I said, you have your backgrounds, I have mine. I agree with what you said, especially I agree that everything should be done in right, good order. I have the same mind, but reality is not always like that.

I made this post because I want to check myself and see how others feel about this topic, not crying for any technical help, merely complaining, or start any arguments (actually I don't use Reddit very often). I know what I am doing. I hope this will answer your questions such as:

You work in technology and don't realize that the offerings change frequently?

Have you never worked on a system that promises backwards compatibility?

Also, to be clear, I never said I "don't want to rewrite anything" - My words are immature, but they are precise.

1

u/dantheman91 Jan 13 '20

I tried my best to explain this background and what I think, but if you didn't get it that's fine.

There's nothing for me to get. I understand that you have a different viewpoint but your viewpoint is going to hold you back. These problems will come up again and again as you do different technologies. Instead of complaining, you'll get a lot further understanding why things are the way they are and how to adapt to that.

In software development there's a ton of problems that you'll encounter and your job is to figure out how to get past them. This isn't different.

1

u/[deleted] Jan 13 '20

I made this post because I want to check myself and see how others feel about this topic, not crying for any technical help, merely complaining, or start any arguments (actually I don't use Reddit very often).

Sorry, I should finish the reply before submitting them.

I agree with what you said about viewpoint holding me back. This is a problem I am trying to address.

2

u/[deleted] Jan 12 '20

If you like using .Net and C#, you could give Xamarin Android or even Uno Platform a spin. The performance for Xamarin is really good, and it might feel more natural to you, especially if you're coming from a Windows background.

3

u/[deleted] Jan 12 '20

Thank you for the comment!

Yes, actually I did try it once.

This is just my own thinking. I like Xamarin's idea, actually. But I feel that I probably should not jump into this too quickly without knowing how the native app development goes.

I was trying it before I started to do native app development in Android (and iOS), so at that time I encountered some UI inconsistency (I was using Xamarin.Forms). I decided to deal with that at a later time.

Also, my habit of doing software development is that I think in both technical and enterprise perspective (again, maybe not mature enough, though). I haven't figured out a workflow regarding Xamarin, so I need to keep trying. Plus, Google has Flutter, Facebook has React Native, I need to evaluate them so that I can make a better decision.

(Unfortunately, both Google and Microsoft have a history of abandoning stuff :()

With that said, I will definitely try Xamarin later on when I have time. I just keep it fair to technologies and try not to stick specific ones for my own goal.

2

u/[deleted] Jan 12 '20

Sounds like solid reasoning. I hope you find what works for you! :)

85

u/AsdefGhjkl Jan 11 '20

Even Google's official docs are confusing as hell (Thermosiphon? REALLY?) Where is the really official documentation???

Don't worry. There is a special circle in hell for the person who thought of Thermosiphon to explain DI.

20

u/[deleted] Jan 11 '20

This! I absolutely can relate! At first I was confused about DI and then I was confused like what the hell is thermosiphon?

1

u/trin456 Jan 27 '20

This thread is the first time I read about thermosiphon

It is probably an ancient Greek, is it not? Like Calliphon or Xenophon

9

u/[deleted] Jan 11 '20

I know what DI is, and I just looked up what a themosiphon is, and I have literally no idea how you could use it to explain DI. DI is not complicated! It does not need analogies to be explained. And even if it did... a thermosiphon? It's that really used?

2

u/mainohga Jan 12 '20

Yup. https://dagger.dev/users-guide. Same thing on Dagger 1 as well.

15

u/Zhuinden Jan 11 '20

And the people who re-use it to explain their OWN DI solutions!

4

u/coffeeHeaterWtf Jan 17 '20

That awful example caused my user name choice

209

u/[deleted] Jan 11 '20

You are not mistaken, neither are you unlucky. I've done Android dev for years now and I picked up Android after Windows dev.

Android seems to have inherited a lot of Java's problems: you have 9 ways to solve a problem. 4 of those are outdated or deprecated, 3 are hacky and you won't sleep well if you implement them. The 2 r emaining are okayish but there is no documentation, no one in the community has published how they did it and you are on your own.

You seem to be doing the JDK/Kotlin stuff and I envy you. Get to a point where you need to do NDK and work in C++. You'll keep a gun on your desk and consider shooting yourself in the head several times.

65

u/AwkwardShake Jan 11 '20

Deprecation is a real problem with Android. And plus the way things are changed frequently by Google. (Scoped Storage for example). And then handling stuff in different ways on different OS versions (what happened to backward & forward compatibility?).

52

u/Zhuinden Jan 11 '20

They killed the idea of backwards compatibility with the Canvas.clipPath() region operator depreciation where they changed them to throw a runtime exception above a given targetSdkVersion.

The commit message just says "this is hard to support". Really? It's been supported for 28 API versions, all you had to do was not touch it. Especially not break it.

What I find funny is that if you ask anyone on the Android team about it (/u/aurimas_chromium comes to mind as I asked him last) they just stop responding to you entirely. Really shady!

7

u/pavi2410 Fuchsia Dev Jan 12 '20

And they won't remove/deprecate isUserAGoat() & isUserAMonkey()

1

u/Thor-x86_128 Feb 27 '22

isUserAMonkey

Despite 2 y/o post, I'm going to mention the fact that these functions are actually working as an easter egg. Here's the latest sources I can get:

isUserAGoat() β€” https://stackoverflow.com/a/13375461/3730834 (Only works from Android Lollipop to Android Q)

isUserAMonkey() β€” https://stackoverflow.com/a/7792165/3730834 (Only for testing environment)

19

u/Tolriq Jan 11 '20

Not only those they also removed quite a few other APIs with just saying you can use reflection on older Androids :)

Fragments are moving to we do not care about any of the use cases that we not use you should think like us and provide lower end user experience because we do.

31

u/jimmysprinkles92 Jan 11 '20

I found out a few days ago that an API added in 28 was deprecated in 29.. Without any alternative provided. They are incredibly short sighted.

8

u/Arkanta Jan 11 '20

That's the notification api in a nutshell

12

u/[deleted] Jan 11 '20

And WiFi Manager... Good GOD what the fuck is going on with that. Making an app with minSDK 18, just needs to connect to a local wifi device and send a file directly, there are like 5 different sets of approaches needed depending on version range. It was not a pretty experience.

12

u/[deleted] Jan 11 '20

yea. Google pushes updates but never enought documentation and learning courses. Their Udacity or whatewer their courses are, is a trash. They are joking around not seriously making apps.

9

u/ZeikCallaway Jan 11 '20

As someone who works on an app that relies on some NDK and C++ modules.....this.

3

u/pavi2410 Fuchsia Dev Jan 12 '20

F

1

u/GrandAdmiralDan Android NDK Jan 13 '20

Anything in particular?

1

u/ZeikCallaway Jan 13 '20

There's no 1 specific headache but it just seems to compound all the normal issues. For example sometimes, you get weird gradle hiccups and need to clear caches and resync. When we have that issue, we have to do that but also recompile the NDk side of things too, but even after that we've ran into issues of it not seeing some of the JNI functions after. So 1 re-sync process turns into 3 before AS finally sees everything.

1

u/GrandAdmiralDan Android NDK Jan 13 '20

Sounds like a bug in the Gradle plugin. I'd bet that's caused by the .cxx directory that the Gradle plug-in uses to cache the C++ build info. It's tracked differently than most of the build because it is very expensive to generate (especially on Windows, since the cost of process creation is higher). A regular clean doesn't purge that directory; only the "Refresh Linked C++ Projects" option or manual deletion. I'm really not a fan of the behavior, but it's a trade-off. If a bug were filed that got a reasonable amount of support, it might be something that could change.

4

u/GrandAdmiralDan Android NDK Jan 11 '20

Any major NDK pain points that we should be aware of? I read a fair amount of the traffic here so I'm guessing I know the answer, but I'm curious what issues you're having.

13

u/g4m3c0d3r Jan 11 '20

The biggest pain point, IMO, is the Android NDK and Windows. Most major game studios use C++ and Windows for development, so good luck convincing your corporate IT to let you run and support a couple Linux build machines and workstations on their network. I would also like to see the NDK ship with common libraries pre-built into static libraries, like LibreSSL or libCURL. Lastly, the Google attitude of "do everything in Java/Kotln and only tiny C++ libraries for performance" needs to stop. That's not how the world works. If you have an existing code base in C++ and it runs on Windows, Xbox, PS4, Switch and iOS, it shouldn't be an existential nightmare to get it running on Android.

2

u/GrandAdmiralDan Android NDK Jan 11 '20

The biggest pain point, IMO, is the Android NDK and Windows.

Can you elaborate? AFAIK the painful part of this is Windows. There's nothing specific to the NDK that makes this a painful experience.

There definitely used to be issues, but I can't think of any current ones.

I would also like to see the NDK ship with common libraries pre-built into static libraries, like LibreSSL or libCURL.

This is shipping very soon: https://github.com/android/ndk/issues/916

Lastly, the Google attitude of "do everything in Java/Kotln and only tiny C++ libraries for performance" needs to stop. That's not how the world works. If you have an existing code base in C++ and it runs on Windows, Xbox, PS4, Switch and iOS, it shouldn't be an existential nightmare to get it running on Android.

I'm not sure where you're getting this. Supporting cross-platform code is the main reason the NDK exists.

2

u/pjmlp Jan 12 '20

We are getting this by being forced to use JNI for APIs like image codecs, permissions, among many others.

By having IDE support only for network debugging, if written in Java/Kotlin.

By being forced to go to GitHub, to get stuff that should be part of the SDK and compile ourselves from scratch, e.g. Oboe.

By being told to go elsewhere to educate ourselves, compile tooling from scratch, and resort to command line tooling, e.g. Vulkan.

By having bare bones Android Studio templates.

1

u/GrandAdmiralDan Android NDK Jan 13 '20

We are getting this by being forced to use JNI for APIs like image codecs, permissions, among many others.

Please file platform bugs for any APIs you want to see made available to native. I can't promise that'll get them added, but it's definitely more likely than if you don't file the bug. Android has a lot of open feature requests and bug reports, and those that get filed take priority over those that don't.

Keep in mind the goals of the NDK: cross-platform and high performance. If the API helps one of those cases then it's something that could be an NDK API.

By being forced to go to GitHub, to get stuff that should be part of the SDK and compile ourselves from scratch, e.g. Oboe. ... compile tooling from scratch, and resort to command line tooling, e.g. Vulkan.

These are also covered by https://github.com/android/ndk/issues/916

By having bare bones Android Studio templates.

What other NDK templates would be helpful?

0

u/pjmlp Jan 13 '20

Lack of access to built in codecs has been a constant complaint since the early NDK days, no bug tickets will help here, when in 10 years the only change was to keep using JNI to load images on the Android samples, and dropping the ones that required permissions, instead of actually improving the experience for NDK users.

The NDK templates should be full blown examples written mostly with NDK code, without JNI hoops or having to hunt down Github repositories with code that should have been part of NDK to start with.

Keep in mind the goals of the NDK: cross-platform and high performance.

So I gather that NDK productivity, aka being able to do C++ development/debugging as easy as with Microsoft and Apple's platforms tooling, is not a goal.

Curious that you mention high performance and then accessing image codecs requires the performance hit of JNI calls, or increasing the APK size with our own codec libraries, having the additional danger of possible security exploits, like it happened to WhatsApp, having included their own GIF codecs.

2

u/GrandAdmiralDan Android NDK Jan 13 '20

These codecs? https://developer.android.com/ndk/reference/group/media. If that's not what you're referring to, please be more specific.

Apparently the word from the media team regarding any missing codec APIs is "please file bugs".

The NDK templates should be full blown examples written mostly with NDK code, without JNI hoops or having to hunt down Github repositories with code that should have been part of NDK to start with.

Okay, so you meant the samples rather than the new project templates. 100% agree that those need some love.

So I gather that NDK productivity, aka being able to do C++ development/debugging as easy as with Microsoft and Apple's platforms tooling, is not a goal.

Not sure where you're getting that from.

1

u/pjmlp Jan 14 '20

These codecs https://developer.android.com/reference/android/graphics/BitmapFactory.html

Media codecs currently available on the NDK are for video rendering, not loading image files.

Filing bugs does not lead to features, https://github.com/android/ndk/issues/476 (closed with the forked tickets marked as unplanned).

Thankfully those of us that care about proper C++ wrappers and less pain inducing JNI calls, already have implemented ours.

I just pity NDK newcomers.

Apparently Jetpack for NDK isn't relevant, this is what I mean about Android not caring about NDK productivity, and as you answered on your reply "Keep in mind the goals of the NDK: cross-platform and high performance.".

Go spend some time developing with C++ on iOS or UWP, even though other languages take the front seat and then admire how the Visual Studio tooling and platform libraries, or XCode tooling and iOS Frameworks work together to actually provide a pleasant way to develop with C++ alongside Objective-C/Swift/.NET, and the contrast of doing the same with C++ on Android.

How it is to deal with Objective-C++ or C++/CX, C++/WinRT components, versus having to do bare bones JNI for the last 10 years!

Or better yet, try to do a prototype for a customer presentation with Metal on iOS using MetalKit versus the bare bones support that the NDK offers with Vulkan, we are even advise to compile stuff from scratch!!

https://developer.android.com/ndk/guides/graphics/getting-started

And better write the rendering code without bugs, unless we also want to go down installing gapid, which provides zero support for cross reference between the code that is being debugged and the IDE tooling.

No wonder that the latest Android talks for game developers were focused on Unreal and Unity support instead of having to use the NDK directly.

So I am getting this from having cross development experience in IDE based tooling, being exposed to environments where C++ developers get a nice piece of the cake, and don't have to wait for each IO during 10 years, hoping to get some breadcrumb left over from the Java/Kotlin party.

1

u/GrandAdmiralDan Android NDK Jan 15 '20

I'm confused, because these appear to be image codecs: https://developer.android.com/ndk/reference/group/media#group___media_1ga9c3dace30485a0f28163a882a5d65a19

Filing bugs does not lead to features, https://github.com/android/ndk/issues/476 (closed with the forked tickets marked as unplanned).

Filing bugs does not lead to features instantly. Those three are blocked waiting for https://github.com/android/ndk/issues/916. "Unplanned" does not mean "never", it means it's not currently planned for the next release.

Filing a bug doesn't guarantee that it will be fixed, but not filing a bug almost guarantees it won't be fixed.

... Android not caring about NDK productivity, and as you answered on your reply "Keep in mind the goals of the NDK: cross-platform and high performance.".

There's no contradiction here. The goal is for you to be productive writing cross-platform and high performance code.

→ More replies (0)

8

u/[deleted] Jan 12 '20
  1. Debugging native code takes you to console hell. The IDE itself is pretty much worthless. What beats me is GDB works very well on Linux, but Google crapped all over it in Android. So you are stuck with printf.

  2. Too many build systems have come up alongside Android and trying to pick ond is a nightmare.

  3. The AndroidC library that still isn't fully ANSI C. This should have been sorted from the get go on v1.

  4. Google has their own JNI wrappers and they aren't exposed to the NDK so wth.

  5. You need go draw a few cool 3D lines? Get native or use JNI calls.

  6. Then the broken integration of NDK dependencies with the SDK tooling.

If you can build a complex app that works using the NDK, you deserve a medal and should go down in history as a legend.

2

u/GrandAdmiralDan Android NDK Jan 12 '20

Debugging native code takes you to console hell. The IDE itself is pretty much worthless. What beats me is GDB works very well on Linux, but Google crapped all over it in Android. So you are stuck with printf.

I'd be happy to help get IDE bugs triaged. It's not what I work on, but I can make sure the right people get involved.

As for gdb, if you're referring to ndk-gdb not working out of the box with gradle projects, yeah, I hear you. That should be fixed fairly soon (as well as being able to optionally use lldb as the debugger). It's unfortunate that it's taken until now for us to have the time for it, but we do what we can with limited resources.

Too many build systems have come up alongside Android and trying to pick ond is a nightmare.

ndk-build is your best bet if all you care about is Android, otherwise CMake is the right choice.

The AndroidC library that still isn't fully ANSI C. This should have been sorted from the get go on v1.

Are we missing anything these days? We can't fix Jelly Bean after the fact, but what are you missing in Q?

If you're just griping then I understand. I'm just trying to figure out if there's something more we should be fixing or if this is just a matter of needing to worry about old OSs.

Google has their own JNI wrappers and they aren't exposed to the NDK so wth.

What are you referring to? If you mean libnativehelper that'll be available to the NDK very soon via https://github.com/android/ndk/issues/916.

You need go draw a few cool 3D lines? Get native or use JNI calls.

I don't understand. Is this complaint not related to the NDK?

Then the broken integration of NDK dependencies with the SDK tooling.

I don't know what you're referring to here either. Could you elaborate? What's broken?

2

u/ArmoredPancake Jan 12 '20

I don't know what you're referring to here either. Could you elaborate? What's broken?

Don't expect constructive critisism from people, they just want to vent out.

I was the same until I RTFM, and then everything came together.

1

u/stereomatch Jan 13 '20

I hope not being able to do fopen() in your C legacy code doesnt throw you off.

Starting with Android 10 you wont be able to write files persistently to internal storage uding fopen().

1

u/drew8311 Jan 12 '20

Not to mention whenever you do finally solve a problem and everything seems to be working you'll have someone tell you it's wrong.

0

u/pjmlp Jan 12 '20

NDK is indeed a pain point.

Things have improved throughout the years, but it is incredible how little it has evolved in 10 years, versus C and C++ tooling in another platforms offer since their initial release.

0

u/[deleted] Jan 11 '20

[deleted]

13

u/Zhuinden Jan 11 '20

It's okay to be alpha but damn it takes 1 year to get an RC1

67

u/[deleted] Jan 11 '20 edited Jan 11 '20

That's the result of 13 years of hectic evolution of Android and technical debt, with stuff changing constantly, including introducing a new official language: Kotlin. And when you Google stuff or search SO, you have ton of outdated information, assuming you can even find what you search. Also Android has become so big in term of APIs and support libs (some of them in perpetual alpha/beta), that nobody can grasp it all. It's all very messy and intimidating. The best way to go about it is maybe to study a few open-source apps published on github (supposedly) using current best practices. Until it is completely different 2 years from now of course, with revolutionary new architecture being the hot new thing. If having the choice, learning Android in-depth in 2020 is highly debatable as this is a huge effort and will not age well.

34

u/[deleted] Jan 11 '20

And when you Google stuff or search SO, you have ton of outdated information,

It would be nice if Android team would fix the following scenario: you google for something like Fragment. The first reference link takes me here

https://developer.android.com/reference/android/app/Fragment

Which says right up top "This class was deprecated in API level 28. Use the Support Library Fragment for consistent behavior across all devices and access to Lifecycle."

OK, so lets click on the Fragment link, oh no..

"This package is part of the Android support library which is no longer maintained. The support library has been superseded by AndroidX which is part of Jetpack. We recommend using the AndroidX libraries in all new projects. You should also consider migrating existing projects to AndroidX."

When I google Fragement, it should either take me right to the androidx fragment page, or the first link in a super obvious place should do so.

9

u/[deleted] Jan 11 '20

Yeah it wouldn't be so bad if they could get their APIs right the first or second time. They never seem to though. Animation is on its fifth or sixth attempt. And pretty much everyone knew fragments were a disaster from the start.

1

u/ArmoredPancake Jan 12 '20

Animation is on its fifth or sixth attempt.

What are you talking about? Animation APIs are fine, and even better with MotionLayout.

0

u/[deleted] Jan 12 '20

[deleted]

1

u/Zhuinden Jan 12 '20

I think Fragments are great, their animation support sucks, and FragmentTransaction.addToBackStack is absolutely terrible.

1

u/ArmoredPancake Jan 12 '20

their animation support sucks

Check latest fragment RC, they finally fixed Z-ordering issue and animations are working again.

1

u/Zhuinden Jan 12 '20

Isn't that only true if you use FragmentContainerView?

It's interesting how the "fix" is analogous to what Gabriel Peal and co figured out in ScreenCoordinator, the mad lads :D

But yes, you can now finally slide a Fragment on top of another Fragment. I've had to use custom views for more involved animations (most notably circular reveal where you can't just use an R.anim.* to describe it, but it definitely works for simpler cases.

1

u/ArmoredPancake Jan 12 '20

Isn't that only true if you use FragmentContainerView?

They switched internal implementation to use FragmentContainerView. You don't need to change anything, afaik.

1

u/[deleted] Jan 12 '20

[removed] β€” view removed comment

0

u/Zhuinden Jan 12 '20

I avoid them because of their poor life cycle

Their lifecycle is only poor if you use addToBackStack, otherwise it's actually pretty well-defined and reliable.

and state saving hell,I don't wanna be responsible for all the fields and data in the views saved between pause and resume

Well that is not unique to Fragments, you have to do that in Activity as per onSaveInstanceState/onCreate(Bundle savedInstanceState). In fact, you'd have to do it in Views by overriding Parcelable onSaveInstanceState() and void onRestoreInstanceState(Parcelable savedState).

On activities all ui components state is saved outofthebox but with frags it's hell

With fragments it's the same thing, it's a question of having view IDs on all your nested containers.

Then it should persist itself automatically as a Fragment.SavedState via fragmentManager.saveFragmentInstanceState().

If that's not happening for you, then something is wrong on your side.

2

u/ForbidReality Jan 12 '20

learning Android in-depth in 2020 is highly debatable as this is a huge effort and will not age well

Is that because Android as a platform somehow coming to an end, or development is gonna shift to flutter only?

3

u/OffTheCheeseBurgers Sr Android Engineer, Kotlin Enthusiast Jan 12 '20

They aren't switching to flutter only... If they do, they're effectively killing the platform

2

u/NeonXero Jan 12 '20

Any examples of those "best practices" apps you're talking about? I've been doing dev for a few years and feel like I'm stuck in my old ways and am not sufficiently keeping up with new or proper things. Projects at work are getting bigger and more complex, and I'm still not great at architecture or organization or whatever. Really would like to (need?) brush up on some swaggy new effective methods.

0

u/Zhuinden Jan 12 '20

Well the ones that kill complexity revolve around "not using multiple Activities in your app" and generally need to be plugged in at the start.

Having a second, or worse a third Activity in the app (especially if they can exist at the same time on the same stack!!) is absolutely painful. That's the rabbit hole where most "traditional Android development" state management complexity comes from.

1

u/NeonXero Jan 13 '20

Yeah my most recent app has a singular activity and then use the navigation lib to move between fragments. That seems fine. I know there's more to improve on though for sure.

67

u/[deleted] Jan 11 '20

Google has too many employees trying get their promotion and stand out and there is no unified vision for anything. Everything feels half assed because once something is introduced, it is left to rot when the developers move on to their next pet project. The entire SDK is held on by tape of hopes and dreams.

7

u/ClerkAcceptable2969 Jan 31 '23

True. Culture! These guys do not understand the first principal, and made things more complex.

Look at iOS development, simple but elegant.

Android is over designed.

34

u/josefadamcik Jan 11 '20

Oh, you are not wrong, it's broken on so many levels. It's basically a piles of technical debt which they try to hide under a layer of support/jetpack libraries.

(For example, if you want to send network / HTTP request, the official docs recommended using Volley / Cronet libraries, which are quite complicated to use if I want to achieve something like JSON-Object serialization (maybe I didn't get it right). This makes me wonder "Why the system itself does not have built-in network / HTTP API like Windows or Linux?". Not to mention, Retrofit+OkHttp is (IMHO) way much easier than either of them. Why this was not mentioned in docs?)

I cannot believe they still have Volley in the docs. It was always terrible library, but now it's no longer developed and using deprecated APIs (at least when I checked for the last time). Of course you are right, it would be better if they rather recommended Retrofit, OkHttp because that is something what developers actually use. (I haven't heard about Cronet, so not commenting on that one). BTW there's indeed and HTTP/network API on Android. But they already deprecated and replaced it once and it terrible too. Not really worth using.

Support / Compat libraries / classes. OH MY GOD.

Yeah, I can feel your pain. The rule of thumb here is use support/compat all the time. That's what google expects you to do. It had some development and it kind of make sense and helps in the end. But as I mentioned above, it's mainly covering pile of technical debt with gold blanket. But it's most likely the only option they have (while staying as backward/forward compatible as they would like to.

- Maybe I'm really unlucky. But for some reason, every time when I try to figure out how to solve a particular problem in StackOverflow, I always bumped into a page that has either no answers (10%), or has a bunch of answers without that green mark (70%, the rest 20% are jackpot). I thought tons of people use this System, so statistically most of the problems should already have answers. But nope.

(Not to mention tons of pages have outdated information. Gosh)

I think I have been having much more luck there and SO most of the time works for me. But the outdated information indeed is problem and is hard to fix with the way how SO works and how the incentives works there. I think it's problem everywhere, bu the faster the things change the worse. And it is pretty fast in the Android ecosystem, as you noticed. They tried to create SO Wiki which was supposed to deal with this, but they failed and abandoned that project.

- Tons of blogs. No offense. I just never see this kind of things before. A lot of developers from all over the world write blogs in Medium or such to explain the same things in many different ways.

There has been this "write to grow yourself" culture propagated a lot in the recent years. The idea is that when a developer writes technical blogs and explains things it helps to grow their technical (they need to learn more about the topic that he would normally need) and non-technical (explaining writing longer text). I believe both claims are true and it does help the author of the article a lot. But it also creates a lot of noise which is quite hard to navigate when you actually want' to find something. And of course, problems with old, outdated stuff and low quality content are here too. It would be best if this content got auto deleted after some time if it doesn't get enough attention.

For example, Dagger. To be fair, Dagger is complicated because it tries to solve a complicated problem (dependency injection). But man, I read a lot, I wrote a lot, but when I first read these blogs, they just gave me tons of confusion (especially when someone uses outdated information). Even Google's official docs are confusing as hell (Thermosiphon? REALLY?) Where is the really official documentation???

Yeah, Dagger2 is very confusing for many and the developers experience on Android is terrible. And official "best practices" are changing and things getting deprecated as we talk. I wish I had better alternative, except not using any library at all. As soon as you realize Dagger just generates a ton of boilerplate for you, it might be bearable to write that boilerplate yourself (for small projects).

- Flutter / Fuchsia. I don't know whether Google is seriously considering using these to solve Android's issues...

We can only guess. Nobody knows, not even Google itself.

Well, not quite pleasant. I guess maybe because I am still a beginner. I may misunderstand most of things here.

Nope, you are nod misunderstanding. This is my daily bread and I am a professional Android developer and I do have significant experience. I have learned to navigate around many of the problems and got used to the rest. But it is not ideal and the most productive technology stack around.

On the other hand, at least for me, there is certain level of satisfaction in mastering hard things. That helps me a lot to stay motivated.

6

u/ZeikCallaway Jan 11 '20

- Tons of blogs. No offense. I just never see this kind of things before. A lot of developers from all over the world write blogs in Medium or such to explain the same things in many different ways.

There has been this "write to grow yourself" culture propagated a lot in the recent years. The idea is that when a developer writes technical blogs and explains things it helps to grow their technical (they need to learn more about the topic that he would normally need) and non-technical (explaining writing longer text). I believe both claims are true and it does help the author of the article a lot. But it also creates a lot of noise which is quite hard to navigate when you actually want' to find something. And of course, problems with old, outdated stuff and low quality content are here too. It would be best if this content got auto deleted after some time if it doesn't get enough attention.

As an Android dev that's recently been trying to learn webdev, it feels 10x worse in this space. At least Android has a set of common tools that are pretty ubiquitous. Webdev seems to have 50 different ways to do them and they're all valid given different circumstances. So there's a blog for damn near every approach.

3

u/yaaaaayPancakes Jan 12 '20

This is why I left webdev for Android dev. Although it seems Android is always changing fast, the web seems to totally pivot on "the right way to do things" about every 6 months-1 year.

1

u/vinng86 Jan 12 '20

I left webdev around the days of IE6...for good reason lol

2

u/Zhuinden Jan 12 '20

At least on Android we have well defined tooling (apart from the outliers like Bazel, Buck and OkBuck), we have Gradle - on the web I can't even track their Grunt, Gulp, Webpack, Systemjs stuff and their various CLIs.

No wonder some people just want to sit down and write document.getElementById instead of spending days setting up just a single Hello world's tooling!

I know there's Vue but is Aurelia dead? What about Backbone? Cycle.js? Who knows!

Redux? MobX? Elm Architecture? Maybe globals services with BehaviorRelays? Who knows!

0

u/pjmlp Jan 13 '20

Well defined tooling if you don't do NDK that is.

2

u/Zhuinden Jan 13 '20

I thought they have CMake for that but I don't know anything beyond that.

I'm mostly glad the Gradle experimental whatever got nowhere and disappeared.

2

u/pjmlp Jan 13 '20

Now they have CMake, after going through multiple reboots with alternative Gradle plugins, deprecating ndk-build and then re-instanting it again.

There are ndk-build workflows that still arenΒ΄t properly mirrored on CMake.

2

u/josefadamcik Jan 12 '20

I had a suspicion that webdev is even worse. Even though it has been a long time since I wandered in that area.

1

u/Drakhelm Dec 26 '25

If they want to write, then they can write. They don't have to publish. Especially if it's going to be a C-A-T spells Cat article taken straight (read: plagiarized) from another source.

4

u/CraZy_LegenD Android janitor Jan 11 '20

Yeah, Dagger2 is very confusing for many and the developers experience on Android is terrible. And official "best practices" are changing and things getting deprecated as we talk. I wish I had better alternative, except not using any library at all. As soon as you realize Dagger just generates a ton of boilerplate for you, it might be bearable to write that boilerplate yourself (for small projects).

I'm currently working on a big project and using manual DI, it has been a long time since I stopped using Dagger and it's just a peaceful time, yes there are times when you have to type

component.something.doThis

or component.subcomponent.doThis

But it's worth it, I don't have to inject annotations and binding maps what not and also slowdowns on build time, it may be a long way to go but I'm not relying on a Google's library that's deprecated and who knows what's going to happen since they said they'll stop supporting it.

I've tried to use Koin but it seems to not eliminate my manual DI problem where I ended up using .get.get.get and it's just not worth it.

3

u/Zhuinden Jan 11 '20

They stop developing Dagger-Android (which is just fluff over map multibinding a common superclass that has a void inject(T t); method implemented by the subcomponent and then uses @BindsInstance over T), Dagger isn't dead yet.

1

u/iyasham Jan 11 '20

RemindME! 20 hours "read this rply"

1

u/RemindMeBot Jan 11 '20

There is a 1.7 hour delay fetching comments.

I will be messaging you in 18 hours on 2020-01-12 15:59:54 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


InfoCustomYour RemindersFeedback

11

u/[deleted] Jan 11 '20

The greatest mistake in my career was trying to start with Android after I had a beginners course on it in college. The teacher said I was good because I was getting concepts quickly, so I thought I would roll with it.

Turns out that due to the mess that is the ecossystem, the barrier of entrance higher than other fields, since nobody wants a beginner messing their codebase (justifiably). Also, for the same reason, it's harder to get up and running with developing your apps so you can start a portfolio.

I should have started in other field, get some money (so I can afford a computer that can run Android Studio smoothly) and experience and then switch to Android.

Now I've spent way too many holidays studying to go back to other fields. I'm all in.

The good thing is that this got me interested in design patterns and software architecture that I've never studied before, since I come from a computer engineering background.

Also I've seen like 5 other posts like yours since I've joined this sub, so yup the platform is probably a mess.

That's my rant on top of your rant. I don't like to complain much about stuff, but I just need to vent out.

34

u/AdmirableBrick2 Jan 11 '20

I started developing on Android in 2011, on Android 2.1. Back then, it was relatively easy to make an app. But then boom, the ecosystem exploded in all directions, and having to be backward compatible with 5 to 6 different major versions (Android 5 to 10 as of now) doesn’t help at all.

Android development seems more complex every day, and libraries (jetpack, compose, play services, firebase, third-party, dependency injection, ...) doesn’t help at all, they even complexify even more.

Android has become too big, and some are now arguing that we should start to specialize in some areas of Android development, like in UI, animations, firebase, architecture, etc...

And yeah, honestly it’s hard to follow everything that is released every week. Google seems to release a new MVx pattern every year and can’t really find any consensus as what is the best way to architecture an app.

9

u/SignalCash Jan 11 '20

Back then, it was relatively easy to make an app.

But apps also looked fuck ugly

3

u/blurrry2 Mar 09 '22

They still do.

5

u/pagalDroid I love Java Jan 11 '20

Google seems to release a new MVx pattern every year and can’t really find any consensus as what is the best way to architecture an app.

Really? I thought AAC-based MVVM is what they have been recommending since 17. Have they moved onto MVI or something?

17

u/Zhuinden Jan 11 '20

Yeah but none of their samples actually support state restoration across process death so it's not production ready in its current form

2

u/Zhuinden Jan 11 '20 edited Jan 12 '20

Android development seems more complex every day, and libraries (jetpack, compose, play services, firebase, third-party, dependency injection, ...) doesn’t help at all, they even complexify even more.

I think most of the complexity in "large projects" comes from trying to separate features that depend on each other into a bunch of separate compilation modules. That's when Dagger-Android, Subcomponents, Map-Multibinding or some equivalent come in.

Or they would need a general abstraction to describe a feature and then create a "module management system", like badoo/MVICore and badoo/RIBs (and badoo/reaktive).

Either way, it's definitely more complex than just writing 1 app in 1 module and you don't need to bind anything to anything across module boundaries where you don't see the class you want to talk to. If you need to reuse components across projects then it can be useful, otherwise it's just more complexity for questionable gains.

6

u/[deleted] Jan 12 '20

Interesting. For those who are experienced in both Android and iOS development, how does iOS (Swift) differ? I've only done desktop GUI applications in C++ and Python with toolkits like GTK. It would be good to know how ObjectiveC or Swift are to work with.

5

u/pjmlp Jan 14 '20

Apple's platforms are more focused on out of the box experience and overall development productivity.

Whereas Google only provided us with Lego bricks and expected the community to come up with our own solutions, until they finally came up with JetPack and stuff.

On the other side you always had frameworks for each use case, layout, graphics animation, real time audio, SIMD processing, 2D games, 3D visualisation and games, graphical debugging,...

The only negative issues are the occasional crashes of XCode (not that Android Studio is any better on 8GB systems) and certificates can be a pain to manage.

2

u/[deleted] Jan 14 '20

I see, thanks for the insights. :)

1

u/cool_and_nice_dev Mar 19 '20

I focus in iOS, but have done Android as well.

Swift is awesome and is similar to Kotlin.

Building UIs in iOS is.. okay. Apple's UIKit is a constraint-based layout engine that is old and based on ObjC fundamentals, which is very event-based. It feels a little bit like you're going against Swift's idea of being a "functional" language when you're working with UIKit. HOWEVER, Apple just announced a brand new UI framework called SwiftUI, which uses data-driven UIs, with hot reloading and all that jazz. Frameworks like Flutter and ReactNative are built around this paradigm. Everyone's excited about SwiftUI, but it's still very new and buggy and iOS13-dependent, so it likely won't see production use for a couple of years.

ObjC as a language is wild lol. It's syntax is a pretty big hurdle for some people and they are immediately turned off by it. I personally haven't used it too much. It interops with C, and you can even write C++ code in a iOS project with ObjC++.

There is a much less api fragmentation in iOS. Support libraries aren't a thing in iOS like they are in Android. A feature is either supported in a specific version of iOS or its not.

As far as IDEs go, everyone always shits all over Xcode, but I really like it. IMO, it gets out of the way and doesn't overwhelm you with options and buttons immediately. Opening Android Studio is like an anxiety attack lmao. There are a million buttons and draggable things and pop ups and spinning loading indicators EVERYWHERE.

just my 2 cents

9

u/WebFront Jan 11 '20

Well, not quite pleasant. I guess maybe because I am still a beginner. I may misunderstand most of things here.

I think you understand it better than most android developers that have never done anything else. It's a complete mess.

I can only guess the reasons but here are some ideas :

  • backward compatibility leads to things like support lib / jetpack but I think what they really messed up is that they expose the system functionality as well. Meaning: they should just give you the support lib and keep the "native" implementation secret, so that the lib can use it for newer Android versions. I think they might actually start to go more in that direction since jetpack exists as the recommendation now is to use jetpack instead if "native" anyway (probably they initially expected quicker update rates when they made up the system)

  • unopiniated/bad opinion Initially the plan was to give only frameworks to developers and let them figure out the rest which lead to many different ways to do the same thing and over the years to complicated learning experiences. Then they started to form opinions about how to do stuff but always pick the stuff that's easiest to implement for beginners and small apps. For big apps almost all their tutorials are worthless. I have no idea why Microsoft is so much better at doing this but it seems like the Android framework developers have never written a real app before

  • googles dev culture? It is only something I heard anecdotally but it seems like their culture of promotions works around the idea of releasing new things that have fancy names and not fixing issues. So they make new preferences framework (no idea why this is needed?) instead of fixing pain points.

7

u/ArmoredPancake Jan 11 '20

I have no idea why Microsoft is so much better at doing this

I'm also clueless why Software development giant that built it's business on developing system software is better at providing development tools than ads company that tries to play who ever knows what.

4

u/[deleted] Jan 11 '20

I have no idea why Microsoft is so much better at doing this but it seems like the Android framework developers have never written a real app before

strongly agree

17

u/VasiliyZukanov Jan 11 '20

Why Android development seems like a mess?

Because it's a mess. Furthermore, Google seems to be more interested in working on sexy "projects" with no real gain (e.g. "architecture" components), than fixing real problems and providing good documentation.

Many full-time Android devs like this situation because they constantly have new things to learn and feel like they are progressing somewhere. Developers like you, who just need to get shit done, suffer. Especially developers who aren't full-time Android and don't have the resources to keep updated about latest developments.

I'm not sure it'll help you in any way, but I wrote this article recently where I tried to summarize the current state of Android development.

1

u/ArmoredPancake Jan 11 '20

Developers like you, who just need to get shit done, suffer

Suffer how? Just write everything using native Activity without any Jetpack stuff.

2

u/Zhuinden Jan 12 '20

You can even do single-activity, custom view-based apps since API 1

1

u/ArmoredPancake Jan 13 '20

Hey, this isn't how you're supposed to do, you're supposed to complain and ignore actual solutions.

12

u/[deleted] Jan 11 '20

Fortunately, Flutter exists

4

u/jj06 Jan 11 '20

I was on a project a year ago that has me create a couple (production level) proof-of-concept Flutter apps. I really liked it, but nothing has come up since.

I left that company, and presently interviewing. Some companies want to talk about Flutter, but none have any interest beyond a curiosity. They seem much more interested in react native - as far as cross platfom.

I've read about people using Flutter for Android only and liking it. I'd be really afraid of painting myself into a corner.

3

u/[deleted] Jan 11 '20

I'm a beginner on Android field, but I've tried Flutter and worked with React Native on a 6 months internship.

I believe what is holding Flutter back is Google pushing flutter (Dart) at the same time as pushing Kotlin for native Android. It's awkward to keep up with both ecosystems at the same time (I've tried for a while and then gave up).

I think a lot o people have this same fear of going into Dart because it not very used into other fields, so you kinda putting all your eggs in one basket and hoping that Google doesn't end Flutter, as it is your only money maker.

React Native is being used in other fields as well, so I believe companies are more keen to adopt it. One engineer that I've met said they were using it to make smart TV UI (or something like it, I just remember it was related to TVs).

With that being said, I hated the ecossystem because almost everything is given by a third-party library so you end up with dozens of dependencies and a lot of them are really buggy so you pass a lot of time diving into github issues. Flutter is way more consistent regard this, at least with the small amount I've tried.

6

u/Fmatosqg Jan 11 '20

My 2 cents,

1- google spent many years trying to encourage herd wisdom by both providing low level apis and not telling people how to approach problems. That has resulted in wonderful things such as timber, retrofit as the ultimate winner of how to do networking (although volley was the official way for a while, and retrofit supports either rxJava or Coroutines / Jackson, gson, moshi or kotlinx for marshalling) or the disaster of camera, camera 2.0 and finally cameraX. So sometimes it goes right, sometimes it goes wrong. A few years ago it started a big atitude shift of offering higher level apis embodied in the jetpack libraries, as well as opinionated ways to do stuff. I welcome most of these, but I for myself am tired of using dagger 1 or 2 and its meaningless tutorials that still involve teapots and never made sense to most people. The community knows better than to follow the 'omnipotent creator' blindly so we have good alternatives for DI such as koin and toothpick.

2- as much as everybody wants to get free of past mistakes (fragments I'm looking at you) there are handful of reasons that I won't get into that make radical change impractical. So have a look into flutter which has learned from a decade of experience in native and hybrid mobile development and started with a clean canvas. The learning experience is much better and the potential is huge and not limited to mobile.

In hindsight it's easy to point at mistakes. I feel your pain on a daily basis, and I understand how easy it is to get overwhelmed by so many choices, specially when you didn't have the chance to see the advantages of the new libs coming in.

1

u/ArmoredPancake Jan 11 '20

we have good alternatives for DI such as koin

Except Koin is not a good alternative.

Boilerplate, no compile time safety kills whatever good API it might have.

1

u/Fmatosqg Jan 11 '20

Good enough for me and other devs who chose it. It's not a one size fits all world in android and that's maybe it's biggest strength.

2

u/[deleted] Jan 12 '20

[removed] β€” view removed comment

2

u/ArmoredPancake Jan 12 '20

Oh, really nice. I get that for free without writing any line of code in Dagger.

8

u/Stem3576 Jan 11 '20

For the reasons you listed I looked into flutter and haven't turned back.

3

u/wellbranding Jan 11 '20

Tried flutter and never want to back to native. It is much easier to build awesome UI/UX in a declarative style!

1

u/Zhuinden Jan 11 '20

6

u/kkultimate Jan 11 '20

Native instance state saving and restore is specifically mentioned in the flutter 2020 roadmap. Personally its hard to go back to the hell of workarounds that is android development after using flutter.

0

u/Zhuinden Jan 12 '20

Kind of them to consider it after 5 years. But technically the plugin mentioned above isn't that complex -- it's more-so that if you have keys, UI descriptors, so on, then you need a separate model, and that model must be compatible with persistence, and the navigation state must also be serializable in a particular way. Basically, you must have a snapshot that can be restored; and people don't like creating a snapshot that is used to reload from asynchronously.

3

u/elliot_1217 Jan 11 '20

Oh, the dagger was really a challenge to learn indeed

3

u/Plasmalaser Jan 12 '20

Trying to learn android dev seriously for the first time as well, I remember what turned me way off on it a year-ish ago was when I started a blank Kotlin project (this was like beginning of 2019, so Kotlin wasn’t exactly new by that point), and the blank project failed to compile & threw gradle errors at me...needless to say it took a while for me to try at it again.

1

u/lordmyd Apr 12 '22

Same happened to me. I hate Gradle with a passion. I also setup a Ktor project with IntelliJ's default template and couldn't produce a JAR without discovering some Gradle plugin called Shadow. It's a shit-show.

3

u/NEWKKQ Feb 26 '22

Already 2022, still as bad as before. It's just a very bad experience to developed Android using this IDE.

3

u/[deleted] Nov 22 '22

Closing in on 2023 and I really want to make Android Apps for personal use. But it's just so fucking frustrating and stupid I cannot even begin to comprehend. I'm used to TypeScript. npm i axios. await axios.post(url, {..}). DONE for my API request.

Now what the hell is this shit in Android? I cannot even find a single useful guide on how to make a simple API call. Like holy shit, how do people even uses this! It's all so utterly over complicated.

Soul crushing experience.

1

u/[deleted] Oct 28 '23

I had the same experience trying to figure out how to make an API call. I'm also a web developer, and I'm used to being able to skim the docs and figure out how to do something and implement it really quickly. That was not the case at all for me trying to do anything on Android.

1

u/MembershipSolid2909 Mar 27 '22

Yes, it still sucks. I took a short break from it, but have had to dive into it again.. Yuck, everything is a nightmare...

3

u/abalta90 Jan 16 '20

Android development is like a trial and error experiment.

3

u/jirolupatmonem Jul 06 '20

Reading this thread made me realize how many million years of people's life have sunk into this

9

u/[deleted] Jan 11 '20 edited Jan 11 '20

I'm a professional Android dev for 5 years. Before that, I used to create C# / WinForms / Windows apps as a hobby.

In C#, there always was a right, easy way to do things. I remember I used almost no library at all, except .NET framework and Newtonsoft JSON.

But then, I got employed, switched to Android development. Got amazed about how many libraries my colleagues were using in their apps. For very basic stuff: Networking (Retrofit, OkHttp), communicating between Activities / Fragments (EventBus), DI, MV* architecture etc

A quick example, opening another form (window) and getting an output object from that form, was like... if(form2.ShowDialog()==DialogResult.OK) use(form2.output); but in Android, I have to start an Intent, then use onActivityResult, read the output from the result intent. Very ugly, verbose, overly complicated. But my colleagues (and also myself) did not used that, but EventBus -- with EventBus you just send an event object in some activity and receive the event in another activity by declaring a method annotated with Subscribe. Sure, it's a hack. A big one. But it simplifies things, thus bringing more code cleanness.

So yeah, on Android development, the rules are:

  1. the SDK is kind of low level. It has many problems: it's overly, prematurely optimized, it has God objects (context), it doesn't have any kind of nice clean architecture (you'd just have to extend Activity / Fragment and place ALL your code there - but, of course, many of us avoid that), navigation is hard (passing data via Intent, Bundle, onActivityResult, instead of using constructors (for instance, instantiating an Activity with its constructor, passing objects and lambdas in that constructor)), lots of verbose "best practices": "saving instance state", "restoring instance state" etc. I would rather avoid those overly verbose "best practices", have some bugs, lock my app in potrait mode, but keep my code simpler, cleaner.

  2. always use compatibility libraries. They're okay because they provide both forward and backward compatibility

  3. use many good-quality community libraries to avoid SDK problems and verbosity, to write cleaner code

But, there's a good thing about the state of the SDK. By not having a framework that has a solution to everything, I was forced to learn a lot about software architecture. I started to make my own libraries, to learn about design patterns, antipatterns, OOP, functional programming etc. A lot of theory to learn to write clean code (in Android, but not only). When I was developing Windows apps, I was just a code monkey, because I only wanted to develop features and the .NET framework provided almost everything out of the box. The code looked kindof okish. But with vanilla Android SDK, you have to write a lot of messy verbose code to code some simple features. Thus, increasing the need for learning architecture.

2

u/Zhuinden Jan 11 '20 edited Jan 11 '20

with EventBus you just send an event object in some activity and receive the event in another activity by declaring a method annotated with Subscribe. Sure, it's a hack. A big one.

If you're not talking to another Activity that is currently not in the task, or with another Activity that lives in another app / process, then this is not a hack at all.

"saving instance state", "restoring instance state" etc. I would rather avoid those overly verbose "best practices", have some bugs, lock my app in potrait mode, but keep my code simpler, cleaner.

>:(

with vanilla Android SDK, you have to write a lot of messy verbose code to code some simple features. Thus, increasing the need for learning architecture.

:)

1

u/[deleted] Jan 11 '20

Yeah, I mean, it's a hack from the SDK's point of view. The Standard, Recommended by Google way is to use onActivityResult and Intents with their key-value store.

1

u/Zhuinden Jan 11 '20

The alternate also-Google solution used to be LocalBroadcastManager though, which was a singleton instance event bus that accepted only Intents with Bundles (while still being single-process event bus)

5

u/[deleted] Jan 11 '20

.Net from the beginning had enterprise backing. Microsoft always meant it to be a platform for all, but first and foremost, enterprise. Lots of companies adopted it, and made changes that Microsoft incorporated into it. It also has a bit easier job as it's not an OS, but a runtime.

Android has always been a consumer platform. That, and the detached way Google works meant that one thing was implemented one way, another was different.

.Net progressed in less, but larger steps. Major releases were rare, and those included well rested features on language level. Android got stuck in a yearly release pattern, which, right now, does not allow for such large scale changes, or such level of testing.

Luckily Google is finally going the Microsoft way, so hopefully in 3 to 5 years we will see some unification.

5

u/grishkaa Jan 12 '20

I've been making Android apps for 9 years now. It wasn't always like this, and I usually still do things the old way. Not only "the old way" of using system APIs directly at all times doesn't change every week, apps turn out to be surprisingly efficient. Like, 2-megabyte apk that does perfect 60-fps animations on a Galaxy Nexus efficient.

So basically my way is ignoring the entire "ecosystem" altogether. I'm not having any of the Google's bullshit. Including the support libraries because you don't need these things if you target 21+. I've recently made a fork of some AndroidX components that uses system APIs directly instead of doing the stupid WhateverCompat.whatever that's just a method call wrapped in an API level check that's always true because everyone targets at least 21. I also pretend Kotlin doesn't exist. And I still don't quite understand what this "dependency injection" thing is that everyone keeps talking about.

Now, the problem is that even though my apps are smooth as fuck, good luck to me finding a job. :'(

0

u/Zhuinden Jan 12 '20

Including the support libraries because you don't need these things if you target 21+.

What do you use in place of ViewPager / RecyclerView? I know those require AndroidX and Support Libs (and more specifically the AppCompatContextWrapper as they crash without it).

I also pretend Kotlin doesn't exist.

I used to do that until it was Kotlin 1.0.5 (proper kapt support), but in the past 2 years, Kotlin has been popping up in external libraries (OkHttp 4.x most notably), and more and more apps add it. In fact, I've worked with Kotlin for the past 2 years now, and I feel it's become unavoidable lately.

The reality is as Vasiliy has said, Kotlin's introduction has split the ecosystem in half: you need to know both to get a full picture.

5

u/grishkaa Jan 12 '20

What do you use in place of ViewPager / RecyclerView? I know those require AndroidX and Support Libs

I made my own fork that doesn't. See the link in my comment.

but in the past 2 years, Kotlin has been popping up in external libraries (OkHttp 4.x most notably)

I use OkHttp 3.x in all my projects that involve networking and it's fine. It supports all the new stuff like http 2.0, and it's 100% Java.

In fact, I've worked with Kotlin for the past 2 years now, and I feel it's become unavoidable lately.

For me it's quite the opposite: I'm able to build literally anything without there being the kotlin package in the resulting apk. I'm very stingy with libraries. When someone might use a library for every trivial thing, I'd rather write those 10 lines myself.

The reality is as Vasiliy has said, Kotlin's introduction has split the ecosystem in half: you need to know both to get a full picture.

Yeah and I couldn't care less about the dumpster fire that is the Android development ecosystem at this point. As long as my apps look fine, I'm fine. And it turns out you don't need 99% of the ecosystem to put the right pixels on the screen. Hiding real states and implementations from myself was never on my list of things that I need.

4

u/joe_fishfish Jan 11 '20

Honestly, it's been a shit show for ages. I started in 2011, started full time in 2013, and believe it or not it's actually better now than it ever has been.

The key thing to remember with Android is that outside of the absolute basics of the framework like Activities, Intents, Manifests etc you can get away with pretty much anything. Google do not care about third party developers in the same way Apple do. So take everything with a pinch of salt, and remember that practices that make you a good engineer across other platforms will likely help you on Android too, albeit with a bit of finagling.

1

u/Aguyhere180 Dec 11 '21

do not care about third party developers

very true and I have my own experience :(

4

u/DevGary Jan 11 '20

What about the 50 different ways to schedule tasks. Thank god for libraries like Android-Job.

6

u/isakota Jan 11 '20

I'm also working as .NET dev, and share exactly same feeling. When they started pushing Kotlin it was game over for me. Not because Kotlin is bad but because they outsourced entire offical toolings. Even if you leave all frustrations about Android vs .NET behind, just working with Android Studio will make you cry, specially after working in VS.

11

u/ArmoredPancake Jan 11 '20

Android Studio will make you cry, specially after working in VS

What are you taking about, lmao. I left this huge pile of technical debt behind and never looked back, Intellij products are on another level.

0

u/[deleted] Jan 11 '20

[deleted]

6

u/[deleted] Jan 11 '20

So you don't trust someone for having a different opinion. How do they think they view you?

It's entirely possible they like VS for valid reasons (in the context of their likes and dislikes), and you like Intellij/Android studio for valid reasons (in the context of your own likes and dislikes).

We're all different, it's immature to not 'trust' someone for having a different view.

That said, Kotlin is amazing and I don't trust anyone who thinks otherwise ;-)

0

u/[deleted] Jan 11 '20

As a beginner who is not in the industry yet. The only problem with Android Studio is the amount of RAM it uses, it's gotten better since I started but it's still so bad that I had to save money to buy a computer with 16 gb of RAM (Keep in mind that I live in a third world country, so computers are expensive).

I believe what's better in VS is that it doesn't put all features that it has all at once, you just add the plugins you need, so you only pay for what you need.

It makes no sense to me with a 4Gb RAM computer to use the layout editor. It was kinda slow so I just learned to edit the xml. If I could remove it to save RAM it would be great.

Not that the layout editor is bad, is just that my computer can't handle it.

0

u/[deleted] Jan 11 '20

[deleted]

1

u/isakota Jan 11 '20

It's not only memory, it's CPU. I work in a small office with few people. Everytime I fire it up they just look at me and smile because my computer makes sound of turbo jet engine.

1

u/[deleted] Jan 11 '20

Yup, I still prefer Android Studio though. I really like their code completion that works everywhere and the tips they give that helps into making your code more idiomatic.

6

u/hlongpl Jan 11 '20

I've been developed Android and iOS for 10 years. Now both has so many problems that I couldn't keep up anymore. My solution, change to Flutter if possible and only maintenance old projects. It's not a solution for everyone, but it works for me. :)

2

u/wellbranding Jan 11 '20

It is indeed a solution for everyone! I could never imagine that flutter is so amazing :)

2

u/taoyx Jan 11 '20 edited Jan 12 '20

Outside Android system territory, it surprises me a lot that a lot of libraries are lack of proper documentation.

Android's documentation is not very good itself. First, they have a feedback with stars but no way to comment to tell them what is wrong. Today I was looking at creating Dialogs with the navigation component, I didn't find ONE working example.

Here is what a good documentation looks like: it explains the structures, and gives working examples. It's enough to get something working.

I think Google is rather working on a new OS rather than fixing Android's flaws.

ETA: another one, I noticed today:

https://developer.android.com/reference/android/os/Bundle

Where is getInt()?

3

u/Zhuinden Jan 12 '20

https://developer.android.com/reference/android/os/Bundle

Where is getInt()?

Inherited from BaseBundle.

1

u/taoyx Jan 12 '20

A good doc would list the inherited members, don't you think?

1

u/Vishu2048 Jan 12 '20

What are the apps ?

1

u/konmik-android Jan 14 '20

PWA can be a better answer for most projects.

1

u/Agnostos_666 Feb 09 '20

short story:-We should switch Lang for Android and possibly change a lot

1

u/damian2000 Mar 21 '20

Don't worry, you are spot on. And it doesn't get any better the more Android experience you have. I also develop in .Net alongside Android. I originally did a course on Udacity to learn Android from the horse's mouth (Google).. it was ok but I felt the unnecessary complexity immediately. I since then picked up the Big Ranch guide (book) which was good, but they took the view of using support fragments rather than native fragments, which I thought was bs. I've been learning Kotlin recently, and hoping it gets better moving forward. I have four personal apps on Google Play and maintain two apps for my day job, but I still don't feel like an expert yet tbh.

1

u/Antique-Set-1404 Jun 14 '25

It is a mess. All the platforms are messing. And quit frankly, extremely immature at every turn

1

u/MathMachine8 Oct 04 '22

Android studio is so bad I want to cry

1

u/unlokia May 14 '23

Keep away from Google and their clumsy, childish politics and clumsy, cluttered, amateurish mobile platforms and live a calm and cheerful life. Seriously, their junk ain’t worth any time or financial investment.

Ghastly company, zero conscience or ethics. Go to Apple and make apps people love AND you will get $$$$ for. No one with any discernment invests in Android. Yuck.

1

u/[deleted] Jan 11 '20

This! Thank you! I can relate.

1

u/advertikon Jan 11 '20

The same with me. When I was started with android I had a feeling that the only working code is the code you copied from a tutorial. When you are trying to modify to - it stops working. But with time the feeling subsided a little :)

1

u/a_cam_on_the_dash Jan 11 '20

Recently strung up a wear os app. what a nightmare. the docs are so bad. not to mention there's actual unfixable bugs. for example I needed the user to enter in an IP address so obviously I'm gonna use a numeric keyboard. However in doing so, the keyboard view doesn't show extra decimal points entered, but will still register in the resulting string.

I have no idea how they missed this but there's literally nothing I can do unless they fix it or I give my users a terrible UX by giving them an alphanumeric keyboard. such a pain in the ass.

2

u/codeledger Jan 12 '20

Given that Wear OS has articles like: https://arstechnica.com/gadgets/2019/01/googles-fossil-deal-wont-save-wear-os/ and the Android Developer YouTube channel has been quiet about Wear OS since 2018 I think everyone has their doubts about it. At least with Android Things it was frozen pretty quickly (unless you are a OEM supporting Assistant).

If you had a SO post, I think I commented on it. Regardless I would recommend filing a bug report with Google just to at least tell them that the problem exist.

1

u/a_cam_on_the_dash Jan 12 '20

Yeah I made two posts on SO during my project, one asking if anyone found a workaround for the keyboard bug, and another because the simulator for wear is broken af lol. I also filed a bug report for the keyboard thing.

It's a shame though, because once I ramped up, I did quite enjoy what I had built. It was very clean compared to my co-worker who did the iOS version. He had like 2 buttons on screen for navigation, and mine was entirely gesture based with a 2 second peek of the nav to display that to the user.

I'd honestly love to make a fitness app that works like a video game or RPG, but it's just too much of a pain with not enough helpful resources. back to react I guess.

-10

u/[deleted] Jan 11 '20

πŸ˜‚ yea, it is a mess. Becuase many developers make simple apps or use other's libraries, so they dont know how it works or how rhey can make it themselves. Google pushes Flutter for design and new developer wont know how to design by themselves. What if they want to create their unique design but cant because Flutter doesnt supports.

Same with Kotlin. Maybe it reduces code, but it also reduces creativity. In java you can create whatewer you want.

And most bloggers dont know what they are talking about, it's just copy/paste.

Read books. And only books.

2

u/wellbranding Jan 11 '20

Flutter supports any kind of design, even custom. It is much easier to use than Android, too.

2

u/kkultimate Jan 11 '20

You will have a much better time making something custom on flutter rather than native , especially due to the composition over inheritance approach

2

u/Zhuinden Jan 12 '20

And most bloggers dont know what they are talking about, it's just copy/paste.

Read books. And only books.

Books are technically just very long blog posts. Except by the time they come out they're usually half-way outdated.

I was arguing with some guy on Twitter who claimed that onSaveInstanceState is a "legacy way of writing Android applications". Bitch please that's not how Android works, oh you wrote a book? Great, now I know that book can't be trusted either!

Literally anyone can write a blog, but that doesn't mean all blogs are bogus.

Same with Kotlin. Maybe it reduces code, but it also reduces creativity. In java you can create whatewer you want.

Considering Kotlin's feature set is generally a close-to-complete superset of Java, that statement either doesn't really make sense, or it's completely wrong, sorry.

1

u/localadmin1234 Jan 11 '20

What books do you recommend?

-3

u/Yikings-654points Jan 11 '20

Thanks for the compliments.

4

u/[deleted] Jan 12 '20

[removed] β€” view removed comment

2

u/Aguyhere180 Dec 11 '21

The biggest problems lie rather in the way Google acts with its Google Play Store by not taking into account the developers who made it successful.

This is so true.

5

u/[deleted] Jan 11 '20

[removed] β€” view removed comment

4

u/ArmoredPancake Jan 11 '20

Why the downvotes, they were under pressure from iPhone release.

4

u/ballzak69 Jan 11 '20

There's very little refining going on.

1

u/[deleted] Dec 02 '23

[removed] β€” view removed comment

1

u/NationalAd5239 Oct 31 '24

Seriously? One activity with a webView - it's just a few lines of code!

0

u/[deleted] Jan 11 '20

[removed] β€” view removed comment

1

u/Zhuinden Jan 11 '20

Swift breaks every year, which makes libraries all incompatible, and they don't have a unified way of distributing libraries like we do with Gradle + jCenter/MavenCentral/Jitpack

2

u/Gilleland Jan 12 '20

I thought that's what Cocoa Pods was? I'm not an iOS dev at all so I don't really know...

3

u/atomicrat2552 Jan 12 '20

Not every library uses CocoaPods, however. Some choose to use Carthage, some only ship source, some are Swift Modules. It can sometimes be a challenge to use a library on iOS

1

u/Zhuinden Jan 12 '20

If I heard correctly from iOS devs, then Cocoapods downloads the source, adds it to your project basically, and then you have to compile it along with your code.

Unlike our world, where you can get AARs, this basically means that every library adds to your compile time.

0

u/Gilleland Jan 12 '20

This is an extreme example, that prob occurs less and less these days - but I've seen iOS developers have to work weekends/overtime to fix app issues & crashes when a new version of iOS released.