Making an Authorized Request to the E*TRADE API with OkHttp

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.

Reading a YAML Configuration File in Kotlin

During the heyday of Ruby development 10 years ago the YAML format was all the rage. But as developers moved towards Javascript-powered frameworks like node the preferred format for configuration files moved with them to JSON. It was the Java community, which had been enthrall to XML for the better part of a decade, that began to roll out better support for YAML.

Reading from the Command-Line in Kotlin

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.

Creating a Command-Line Application in Kotlin

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.

Connecting to the E*TRADE API

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.

Start of a Journey

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.

Search