Details
-
AboutI am sak96
-
SkillsI code and rant :/
-
Location127.0.0.1
Joined devRant on 5/17/2017
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
-
Just did my first JobIntentService on Android. Hoo, boy.
The problem: I need to send a network request.
The issue: Android.
Of course, you can't do network on the main thread. That's silly in any application. Android really does try to punish you, though. The Android lifecycle can really fuck you over here. Imagine a long-running network operation, like 15 seconds. Plenty of time for the user to do something silly, like rotate the screen.
If you opened up a good old new Thread from Java, you'd get a crash because of a screen rotation. Same thing with Android's AsyncTask, which is the top answer on StackOverflow. AsyncTask is made for things that will take no longer than a few seconds (less than 5!). Network, especially cell network, can take longer.
So the solution? Create a JobIntentService class. It's a service, it will run in the background. You need to register it in your Android Manifest and ask for a new permission (wake lock). You need to implement another class for the receiver, and then you need to go to your activity and implement the receiver interface you just wrote.
Just. For. A. Network. Request!
And as far as I'm aware, this isn't even that bad considering the rest of Android's bullshit.
What a headache!8 -
Technical Founder at today's meeting: "All of you guys have work-life balance. It shouldn't be like that. We need act like a startup. You guys need to work really hard. This guy (pointing at me) once worked 10 hours each day, where I worked 16 hours. We really need to move fast."
I'll just leave this words here.13 -
"We're promoting you to be a Team Leader, since you proved your skills to handle tough tasks and bring good solutions, and we're raising your salary by 25%."
That sounded good for me, until I realized that all they need is an interface between them (the boss) and other employees to force their style and monitor every fucking thing that could be different from a dev to another. But since the boss is a sEnIoR with mOrE tHaN 10 years of experience but he does not have any clue about good practices and how to make a code that does not push you to be humiliated by the client, he still thinks that he's the fucking programming God.
That's a shit9 -
*Manager enters the room quickly*
Manager: Coffe2Code, we have a serious problem on the application, (We are working on a chat app).
Me: What? now just few hours before the Demo?, what is it?
Manager: when I send or receive a media message (audio or video) the sound is not playing, the file seems like corrupted !
Me: that's strange, let me debug it and see.
*Me spending an hour and could not even reproduce the bug..*
Me: Boss, I cannot see the bug, can I debug on your device quickly?
Manager: Sure, here it is.
Me: hold the fucking device, press VOLUME UP, IT WAS FUCKING MUTE. THERE WAS NO ISSUE MOTHERFUCKER.
Manager, oups ok good no issue then, thanks16 -
that time when a client wants you to teach a bird how to fly.
but the bird is a penguin
and you are a bear expert
"but it has wings!"7