When it comes to building an app for several different mobile platforms, you typically have two options, native or cross-platform. Native apps are reckoned to run faster, but take greater developer resources to produce. Typically a different development team is needed for each OS, codebases are entirely separate, and development, test and release cycles are independent.
To simplify things, cross-platform frameworks can be leveraged to minimize development resources. Teams then work with a single SDK which automatically generates apps for a range of platforms. Historically, this has tended to mean reduced performance, especially where some kind of run-time wrapper or virtual machine is required. However, by producing native code for each platform, a new generation of cross-platform frameworks like Flutter promises single codebase development without the performance hit.
In this article, we’ll take a closer look at cross-platform development and give an overview of the top five frameworks. We’ve also teamed up with Wolters Kluwer, a leading provider of software services, for some key insights into getting the best results with your cross-platform development.
The importance of cross-platform mobile development
More than ever, customers today expect to be able to use the same apps and services across a range of devices, be they smartphones, tablets, desktops or websites. However, developing a consistent user experience for different OSs can be a challenge. Plus, maintaining a development team for each platform is expensive and harder to manage.
Over a decade ago, there were rather more mobile operating systems – Windows, Blackberry, Symbian and a few others as well as Apple iOS and Android. Luckily for devs, most of these have now dropped out leaving only Google and Apple’s offerings. Still, maintaining codebases for both platforms effectively doubles developer resource requirements. On top of that, customers usually expect a consistently-functioning web app.
Cross-platform frameworks have existed for some time. Titanium SDK and Apache Cordova (formerly PhoneGap) were early players in the market. Such frameworks made it quick and relatively easy to code simple apps for a range of platforms. But while useful for proof-of-concept or MVP (Minimal Viable Product) demonstrations, many producers found them too limited in specific functionality and somewhat slow in performance.
In recent years, however, these frameworks have improved a great deal and are now capable of generating consistent and high-performance mobile and web apps. In fact, the web aspect is key here, because frameworks like Flutter now allow developers to code generic codebases as Progressive Web Apps (PWAs).
Native apps vs PWAs
Offline features, background data syncing, push notifications and much greater speed and stability are now reasonable expectations for a web app. In fact, native apps might still be more suitable compared to PWAs when there’s the need to work off-line or in areas without satellite or WiFi coverage. However, PWAs provide an excellent entry point for cross-platform development. So how do they compare with native apps in other areas?
- Developer resources. Perhaps the most obvious benefit of cross-platform PWAs is their efficiency in terms of developer resources. Developers need only one codebase, saving time and effort. They also reduce the effort needed to learn new languages and frameworks for each platform.
- Performance. Frameworks like Flutter automatically translate and compile code to native architectures, meaning there is typically little difference in terms of performance.
- Features. As we’ve seen above, contemporary web technologies allow browser-based apps to match many of the features of native apps like syncing and push notifications. That also means that web-oriented codebases can easily transition to mobile architectures.
- Hardware integration. PWAs now allow interaction with many hardware sensors on mobile devices, offering a more intuitive user experience. There are, however, some limitations, not least because of the specificity of individual OSs.
- Web indexing. PWAs are not ideal for some more traditional websites. Document-based may be better served by more standard web frameworks or static pages since search engine indexing typically doesn’t cover PWA content.
Top mobile frameworks for your cross-platform projects
There are now several suitable frameworks available. Let’s take a look at some top contenders.
Xamarin is Microsoft’s entry in the cross-platform marketplace. It is based on .NET and C# and is streamlined for developing apps across desktop and mobile devices running Android, iOS or Windows. Unlike some cross-platform frameworks, however, it does not use web technologies so is not suited to browser-based app development.
Ionic is an open-source SDK that makes extensive use of web technologies. That makes it ideal for cross-platform development with a web priority. Originally built on top of AngularJS and Apache Cordova, Ionic is now based on web components, making it a good fit for PWA-driven development. It uses Cordova plugins to access specific features of mobile hardware.
Like Xamarin, RAD Studio is aimed at cross-platform development for different mobile and desktop operating systems. That means it’s not suitable for web development. However, unlike most competitors in the field, it does include support for often underserved Linux platforms. It has code support for both Delphi and C++.
Best practices for cross-platform development
Finally, it’s worth considering some cross-platform best practices, drawn from experts in the field, Wolters Kluwer, when working with Flutter.
- Manage integration. If your organization is adopting cross-platform development for the first time, it’s important to give enough time for integration. Be aware that not all native components will work directly, so some design or functionality changes may be required.
- Maintain UI/UX standards. Cross-platform development promises streamlined UI development. However, each OS has a different look and feel, so it’s important to make sure that interface designs work to specification on all your supported platforms.
- Manage release schedules. If you manage multiple platforms, you’ll be aware that they don’t necessarily release OS upgrades at the same time. You may need to run a less frequent release schedule to maintain consistency.
- Use library components. With cross-platform development, there are several common challenges with pre-existing solutions. Many complex features can be addressed with pre-built components such as stateless widgets. This was the approach taken by Wolters Kluwer, who chose the GetX library to manage state management, route management and dependencies.
- Test. Your code may be unified, but you still need to conduct user-level testing on each supported platform. Because each has differences, you cannot assume that performance on one platform guarantees success with others.
- Have a strong REST-API backend. This will simplify the mobile side development and, eventually, also the native vs PWA battle! This is key specially for business oriented apps. Good APIs, good data semantic, well defined processes are the key.
Conclusions: Is cross-platform the future in mobile?
Cross-platform development is now easier than ever before and, with native compilation, performance is often barely distinguishable from fully native code. In the future, we can expect further improvements in functionality and hardware integration for mobile platforms.
So, the answer to this hot debate is not black or white, but to be able to choose the right tool for the job after considering the use cases and market needs of every project. However, we can expect that, as web development becomes more app-like and component-based, PWAs look set to become even more and more common as a solution for mobile apps. Of course, the best proof of concept comes from those who have effectively negotiated the challenges of PWA development and used it successfully. You can learn more about cross-platform development with Wolters Kluwer.