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
Search - "that other dagger"
-
Set out to copy the iOS alarm on android because a) android's stock alarm is fugly and b) all other sleep reminder apps either offer me way too much or no functionality.
Week 1: "Oh, custom UIs need a lot of math... Ok."
Week 2 "Why on earth is my ram usage at 400 mb?!"
Week 6: "I have come to the realisation that android's ByteArrayDecoder should burn in hell.
Week 7: "Man... They sure made the management of intents and pending intents a pain."
Week 10: There. It works. Two classes, 7000 lines of code.... Hmmmm maybe apply MVP."
Week 11: I discovered embarrassment driven development, throw away all my code and start from scratch.
Week 12: Oh ButterKnife, where have you been all my life?
Week 17: I might actually finish this in my life time!
Week 28: Man, this MVP and managing Context, intents, SQLITE DB and pending intents do not mix well.
Week 46: I discover RxJava and Dagger 2
Week 47: I discover that the 'V' in MVP does not refer to an 'Activity'
Week 48: My StudyBudy says to me "Man, exams are only a month away!"
Week 49: I put all your code in my github, delete it locally and focus back on being a student.2 -
aaaaaghh fucking Handlers man. Android is so fucking full of shit, i wonder why am i still doing it. love is pain.
Why can't there be one mother fucking solution to all lazy ass asynchronous programming? handlers, threadpools, asynctask, executers, Broadcasts, intentService, coroutines, rxjava,.... i don't what new stuff are people snorting these days.
Ok , leave everything. A handler is class- no sorry, Handler, alongside some fucking Looper clss (and maybe some more stuff i don't know) other classes is a way of handling inter thread communication. Handlers can:
-send data to ui thread
-recieve data from ui thread
-send "messages" to ui thread
-recieve "messages" from ui thread.
- can be attached to ui thread
- can be attached to any child thread
- can be accessed anonymosly via any view
- can be present in multiple places, working together
- can kill night king with a dagger
- can do porn better than johnny sins
- can run for president of the whole fucking world
- do some more shits that i have yet to discover
And where do i find this? buried deep insides some medium articles or in some guy's horrible accent video.
Is background processing really this much of a toughnut to crack?
earlier i was all about using asynctask or foreground/background services, because these are the most easy to understand abstraction of a fairly difficult topic.
But as i see more projects, i see underlying apis like handlers, threadpools , executers , being directly used.
Why cant there be a fucking single abstraction, that could be "lightly tweaked" to handle every ugly case.6 -
Daaamn.. Dagger.io is actually quite cool. Spent 2 days learning and building a dagger module for my project's ci and I've gotta tell ya - I'm lovin' it!