5
AlgoRythm
75d

Simplified about as good as I can get it.

Any Android devs with critique?

Comments
  • 1
    I see you found volley 😋
  • 1
    is that sposed to be some programming language

    it's just a bunch of signs and gibberish

    fuck it man, can't you learn like a real language
  • 1
    @SortOfTested Volley was actually the first thing I found. I went through a very long journey of implementing a bunch of different approaches and finally implemented this:

    Base Volley Request ->

    Generic Gson Volley Request ->

    Login Volley Request

    Setting post params is a fucking bitch in Volley. That's why I implemented a custom login request class. This halved the network logic required in the activity class, which made me happy.
  • 0
    @AlgoRythm
    Yeah, all this is why I'm not crazy about android or mobile dev in general. The whole, "applications are secondary to call" lifecycle design is inconvenient to say the least.

    It would be cool if there were a phone that had a dual OS that made calls on one side with a dedicated CPU, and ran apps in an entirely different env.
  • 0
    @SortOfTested It sure is annoying, and I wouldn't really wanna do this sort of thing professionally, but as a side project I'm sort of enjoying the challenge and constraints. Learning a lot of techniques.
  • 2
    I like dogs.
  • 1
    Use retrofit and kotlin
  • 2
    Damn i forgot how bad android was lmao.

    @zemaitis shut the fuck up
  • 2
    @yellow-dog no you shut the fuck up. Android dev is easy when you actually pull your head out of your ass and learn new things that make your life easier instead of whining.
  • 4
    @zemaitis yes because using var and an arrow function instead of override make this so fucking simple and intuitive. You blurt out crap when somebody obviously doesnt want to use your miscarriage of scala and someones conception of js from 2002.
  • 0
    More no u please.
  • 1
    @zemaitis Looking at the example code (Everything in Android docs is written in both Java and Kotlin), it wouldn't help a ton in this example. It would eliminate maybe four or five lines. And to make the move to a different language for that is silly in my opinion.

    Plus, I actually like Java, so it's not like I'm trying to escape it. I'm open to further improvements of my existing design - I think I did well, and I was looking for even more insight.
  • 1
    Did you know you can enable Java 8 in Android Studio, with lambda support?
  • 3
    For my part, I wouldn't really want the login to be side effecting to the event queue and creating toasts. Lots of work for one method.

    The login handler should be a Function that returns from a builder that defines all of its strategy. Build/curry in the handler methods, view, supplier delegates to resolve the user/pass values, etc; the resulting method becomes compositional. The toasts should be provided by a service that is called by an event stream handler that is able to read a login pass/fail event, the move to the other side of the processing chain. Bc java, null checking with optionals. Sucks java has no tuples.

    Just my prefs though.
  • 0
    @sbiewald really? I thought android was still stuck on java6, when did they update?
  • 0
    @sbiewald good to know.
  • 0
    @SortOfTested I am not necessarily new to this sort of thing. But I still only know maybe two of those concepts.
  • 1
  • 0
    @SortOfTested A goodiebag of links!
  • 0
    Ternary ops?
  • 0
    @AlgoRythm 2020 and you are still clinging to java in android development? Good luck is all I can say to you
  • 0
    @yellow-dog you obviously are not working on android professionally, thats the only reason to deny using kotlin. I mean either your codebases are not worth the shift of you are just ignorant. It was already approved by google itself as the preferred language 1 fucking year ago.
  • 1
    @zemaitis uh oh someone doesn't like the thing that I like what will I doooooo
  • 1
    @AlgoRythm You will not have a job as android dev thats obvious. Unless its some legacy application which u will have to maintain and thats never pretty. Next time let us know that this is you playing around with your e-dick and no one will think twice when they see you using shittiest networking library and boilerplated language.
  • 2
    @zemaitis oh gosh he uses mean words too, I need to avert my eyes :((

    I said earlier I have no interest in doing Android dev professionally. In the same comment that you probably didn't read or are ignoring just so you can argue with me, I also said I was learning a lot of techniques.

    Kotlin isn't what I'm looking for at the moment but thanks for the attempt at helping. Sorry about your reading impairment though
  • 1
    @zemaitis nigga, no sane person wants to do android professionally. Even if i did, i would just use react native and save myself the headache. I have done it professionally, both in java and kotlin, and both were crap, the difference is that kotlin compiles to a jarbled mess. But again, how is any of that relevant to someones pet project?

    Also, google+ was approved by google, yet here you are on an other platform, curious...
  • 0
    @yellow-dog Doesn't seen to be "real" Java 8 to me, but rather a byte code transpiler for me - but it works for third party libraries and Kotlin as well.

    AFAIK only Android versions with OpenJDK have "native" Java 8.
  • 4
    I love how he asked for feedback on his code, but in return he mostly got shit about using Java...
  • 0
Add Comment