While the default Java HttpClient is just fine for simple requests, we will be interacting with an OAuth v1 powered endpoint which will require requests to be signed. We shouldn’t have to worry about all those details and for that the OkHttp library fits our needs perfectly.
When it comes to breaking down complex problems into smaller ones Kotlin offers a full range of functional tools and patterns to make your job easier. Building on our previous entry around building a command-line application we will put several techniques to use to build a robust solution to the problem of accepting and validating user input.
Many folks associate Kotlin with Android but its uses extend far beyond programming for mobile. We will be building a “Hello World” command-line application packaged up as a JAR file, a format just about every Java developer should be familiar with. We will also make use of Github, Gradle and JetBrain’s IntelliJ IDEA, the gold standard in Java IDEs.
While there are a number of fantastic APIs available for those looking to build stock market related apps, most cost money for anything beyond the basics. But if you have an existing E*TRADE account and a bit of patience you can get realtime data, including options chains, from one of the top brokers in the market.
It all started at KotlinConf 2019 in Copenhagen. Technically I’d already been using Kotlin for nearly two years by that point having run teams that developed Android apps built with a mix of Java and Kotlin. But I’d left a good portion of the implementation up to the developers themselves, only going into the code to fiddle with Gradle build settings or giving pull requests a once over.