Building Freetrade

Q&A: How do we work on mobile?

Alex Curran

April 21, 2021

Alex Curran

What's it like working behind the scenes on the Freetrade app? Here are the most common questions our mobile-first developers get, and the answers to boot.

Here at Freetrade we highly encourage engineers who are more familiar with backend work to work on our mobile apps. This allows us to share knowledge, develop features end-to-end, and get closer to our users.

However mobile development can be daunting, especially some of the design choices that come with it. To make these decisions more obvious, we wrote this handy guide to answer some of the questions we mobile-first developers often get asked. And then we figured โ€“ why not make this visible to everyone?

โ€

You asked, we answered.


Importantly, these questions are also a great insight into how working on mobile is at Freetrade. Like the look of it? Come join the team!

โ€

Why do we expect developers to work across Android and iOS?

โ€

In previous roles I have found that cross-platform development builds a more consistent product and reduces feature disparity. Given we want our product to have the same features on each platform, we believe that we should use Conway's Law to our advantage โ€“ by having teams that own both their features across Android and iOS, they will build a more consistent feature.

Ultimately, iOS and Android are not as different as you may have been led to believe. There are a lot of APIs which are nearly one-for-one equivalent across the platforms, and they are used in a very similar way since we use Kotlin and Swift โ€“ two pretty similar languages.

โ€

Do we develop native apps or use cross-platform technologies?

โ€

Ultimately, because they were developed as native apps first, we develop native apps. ๐Ÿ˜„

But seriously, there are a few advantages:

  • Things like charting are complicated and best suited to native apps.
  • Native allows us to make the most of the platforms without having a translation layer.
  • It means we can take advantage of new tech in the platforms without having to wait for React Native or Flutter to implement them first. For example, our iPad Split View would've been much harder without using native directly.
  • It means we have fewer tech choices to make and maintain โ€“ instead of developers needing to know React Native and native to implement our more complex features.

There are of course disadvantages, one of which being writing the same code twice. Where we can, we try to push logic we would write in each app into HTTP APIs โ€“ this allows us to hotfix issues quicker too.

We're going to investigate using Kotlin Multiplatform in the future as it allows us to keep the native apps, while sharing business logic.

โ€

Why do we use Rx?

โ€

Reactive coding is a common pattern in mobile development and a lot of developers are familiar with it. Reactive coding is also common on the web โ€“ because ultimately a Promise is reactive.

Rx allows us to make data manipulation and business logic clearer as a series of steps (although it definitely has a steep learning curve). It also makes threading easier which is very important in mobile development so the app doesn't freeze.

A key strength of Rx is that it has a (relatively) similar API across all platforms. This means the business logic can be consistent across Android and iOS (and potentially Web in the future).

โ€

Do we use SwiftUI or Compose?

โ€

We don't use either of these tools yet. We can't use SwiftUI yet as we need to support older versions of iOS.

We could use Compose but it has only just entered Beta. We will certainly open up the discussion when it is more stable.

Right now, for iOS we write UI in code using UIKit. For Android, we use XML.

โ€

Why don't we use Android/iOS specific APIs often?

โ€

Ultimately, it is easier for developers less familiar with mobile systems to get used to our platforms when they're two sides of the same coin.

We don't really want our iOS and Android apps to have different behaviour (see above), so making them as similar as possible helps this. This is why we don't use Android-only APIs like Data Binding (in preference for hand-rolling it), or iOS-specific architectures which would then be unfamiliar to Android (like VIPER).

Where we do have differences, they are explicit and for a decent reason:

  • Views in Android are in XML because that is how everyone does it. This means it is easier for engineers to find tutorials or Stack Overflow questions if they're stuck.
  • Dependency Injection is different because Dagger & Hilt avoid some boilerplate for us on Android (although definitely adds some complexity). iOS doesn't really have a DI framework with such strong support as Dagger does.

โ€

What is our approach to automated testing?

โ€

We have our brilliant QA team who build automated tests so we no longer develop UI tests within the projects.

However we have a pretty great set of unit tests across both platforms. You can write your unit tests to be as small or as large as you like โ€“ there are no hard and fast rules here! We rarely test our Android/iOS components because we aim to have as much business logic in our View Models, which are tested.

Sign up for our newsletter

Download the app and start
investing now.