Cross-platform development is fantastic (and here’s why)
As a recent graduate of Computer Science, the first question that popped into my head was: “what do I do now?” If you are a graduate or a budding software developer, you might be thinking this too.
As a software engineer, I think it is important to keep up-to-date on the latest trends in technology. Keeping an eye on what choices companies are making to achieve their goals is an effective way to do this. One such trend we are seeing in the industry is the move towards writing code using cross-platform development frameworks.
You may be wondering what is ‘cross-platform development,’ and why use it? Well, fret not as I shall explain all…
What is cross-platform development?
In terms of software, cross-platform development is the act of developing software for multiple platforms. In the past, this was achieved by having multiple teams writing code for each platform your software supports. Now there are coding frameworks that allow developers to work together on one codebase, but still be able to deploy to multiple devices. In the industry, this is what some people don as “write once, run anywhere”.
Examples of popular cross-platform SDKs for gaming are Unity (Cuphead) and Unreal (Fortnite). If mobile app development is your thing, popular frameworks are React Native (Facebook) or Flutter (Google Ads).
Whatever framework you decide to go with, they will all help you to achieve the same goal.
Why should you use cross-platform development?
1. “Learn once, run anywhere”
In my opinion, this is the main selling point for cross-platform development. For your product, you have one codebase that your team works on, meaning there is one place of truth for your code.
The consequence of this is you start to write code focusing on reusability, leading to better quality code. You can also reuse configurations and test cases for all platforms you support. Except for the odd occasion, you can release at the same time to all the stores you support, thereby providing all users with the same functionality.
Ultimately, you will never write the same code twice again!
2. Naturally create a seamless experience between systems
A natural effect of writing in one codebase is that you can easily create a seamless experience for all the operating systems. Of course, you can still have specialised logic for one operating system, but products built with cross-platform functionality in mind will consider how the product should behave on all platforms.
This means you can be sure that users who recommend your app to people on different devices will have the same experience as they did. More happy users all around!
3. There is an abundance of open-source libraries
Something I noticed when using React Native is that there is a huge amount of support online. This is partly due to the nature of the framework being open-source (thank you Facebook).
The React Native community is highly active with libraries and support groups to help you create your application. There is lots of help online, and with a quick search, you can usually find public issues or help pages that can help you right on your way.
You can always find a library for what you want to do, and if not, why not try to write one yourself? It is a great way to join the open-source community.
With any great solution, there are of course some caveats which you should take into consideration before taking the plunge.
Why you might not want to use cross-platform development?
1. For specialised behaviour, you may have to write native code
As cross-platform development languages are a layer over native code, there of course can be some situations when it does not cover an edge case you want.
For example, in the TomTom AmiGO app, we have a Bluetooth auto-start feature on Android. This feature is triggered when a user connects to a specific Bluetooth device. We needed to write native code for this as no library provided the same functionality.
If you are thinking of starting a project that will have specialised behaviour related to a particular operating-system, then it may not be the route for you.
2. Constrained by the number of operating systems you support
Naturally, if you want to support multiple operating systems you are restricted to using the subset of features that are available on the different platforms.
This means if say Apple added a new feature, but Android did not support it yet, you need to consider if it is worth losing the seamless experience between operating-systems (mentioned above) to add the new feature.
Also, support for new features will naturally come later for cross-platform frameworks as they need to add support too. So be aware you will have to wait for this support.
Finding the balance is crucial here, and a good example of an app that gets it right is TomTom AmiGO.
Case study: TomTom AmiGO
TomTom AmiGO is written in one of the largest open-source cross-platform frameworks namely React Native.
The app supports iOS, Android (both on the Google Play Store and Huawei App Gallery), and has even got Android Auto support (currently in Open Beta, join here).
React Native’s helpful open-source community of libraries coupled with our expertise allowed us to create the perfect driving and navigation app. We even dabbled in writing custom libraries to improve our user’s experience.
The app uses TomTom maps and routing, so you can be sure your ETA is accurate. We also have this handy feature that warns you about hazards and potential incidents on the road. So you can drive with peace of mind.
Not only can we offer our users everything they would get with a native app, having one source of truth for our code means as developers we only need to manage one codebase. We can share configs between operating-systems where possible, and tests cover both platforms. We love it!
If you want to see what a feature-rich app written in React Native looks like, check it out by downloading it here.
Next steps? Time to get coding!
So, what are you waiting for?
Head over to https://reactnative.dev/ to get started. To set up your first project, it is as simple as running:
npx react-native init MyFirstApp
Good luck on your journey, and let me know in the comments below your experiences of using cross-platform development!
Thanks for reading my blog post, and if you enjoyed it consider following me for more! As you made it here, let me introduce myself:
My name is Katie, and I am an Associate Software Engineer at TomTom. I write code for this great navigation app called TomTom AmiGO (you should check it out by clicking here).
📸 Follow my daily life at @katiesaeyo
💼 Find out what I’m working on at https://www.linkedin.com/in/katieisnell/
👩💻 See what I’m coding at https://github.com/katieisnell/
(All illustrations designed and drawn by the wonderful Jessica, go support her @jy.paint)