Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
after exploring a lot of ui frameworks and architectures, i am trying to go back to android dev but again with the curiosity for the one single question that i had at the start of my career 5 years back : why is it's ui so complex?
can anyone help me understand it?
like comparing with the most basic ui framework : html/css/js, why android is so different? we got activities, fragments and views. the worst thing in android is lifecycles, that each of these ui components have.
The view lifecycle is simple to get over with : whatever is the lifecycle of its parent, is the lifecycle of view.
a view's parent is another view, whose parent is another view, whose parent is... and so on until we reach the root view which is stored by either a fragment or activity
therefore a view's lifecycle = lifecycle of activity or fragment
till here its very clear. the fuckup is simply in the next part:
WTAF is activity ?WTAF is fragment? why are their various functions called in the sequence they are called? oncreate, on start, onstartview, ondestroy... why?
activity is still somewhat okay, but fragment is completey weird af : it can be a part of activity: basically it can cover your complete screen and behave as an activity itself (so you don't get to say that activity === screen and fragment === view) AND IT HAS ITS OWN FUCKING LIFECYCLES! So does that mean fragment's fucntions cna also be called by OS?
what's more mind fucking, is the fact that android activity can destroy/pause or recreate fragments on its own, by some "views" like viewpager , or even hold multiple fragments as "alive" at the same time, using something called a "backstack" ??!??!
and each of these fragments in the stack can be called by system at any time? like wtf???
all these stuff is super confusing and i haven't even scratched the surface. the newer , more complicated stuff like viewmodel, livedata and again "lifecycles" has a complete seperate behavior and functionality of their own. plus the various "reality-check" scenarios like: when a user is streaming a video in picture-in-picture mode while keeping your app in split screen with maps in the second split, when a call comes and the video keeps running, and user rotates the device, let me know the clusterfuck situation for the 3rd fragment in your 5 icon navigation view currently at the payment page with 2 fragments and 1 activity in backstack!!!
god bless thy soul for this shitty framework isn't going anywhere , rather its super strong and getting more clusterfucked with new beautiful shit everyday.
(if someone can ignore my gentle language, i would really like to know/get redirected to some resources where i can learn more on this)
rant