Affiliate links on Android Authority may earn us a commission. Learn more.
Cross-platform mobile development — challenges, options, and why you should consider it
So, you have a great idea for a game or an app that you think could be a massive hit, perhaps make an impact on the industry, and possibly make you rich.
You have the coding skills and you have the team and resources. Now all that’s left is to choose the platform you want to target. While we don’t really talk about it, Android isn’t the only operating system in the world!
If it’s a mobile app you’re making, then the big decision will likely come down to whether you wish to develop for iOS or Android. Each has advantages and disadvantages for developers; while Android has a larger user base, iOS users actually tend to spend more on their apps (both to download the app itself and when making in-app purchases).
But beyond that you might also choose to create an app for a Windows device. Perhaps you want to target Surface users through the Windows store? Or if it’s a game, you might be considering releasing it on Steam and GoG as an indie title – or even on home consoles! There are plenty of games like Limbo and Downwell that have been big hits on multiple platforms including Android.
The ideal scenario? To target every platform that might provide you with an audience, thereby maximizing your impact and your sales. So is that possible? How does cross-platform development differ from developing solely for Android? And what’s the easiest way to go about it?
Challenges faced during cross-platform development
If you were to set out to make a purely Android-focused app, then chances are that you would use Android Studio to code your app in Java using the Android SDK.
Now, if you were creating an app for iOS, you would do so using the Xcode IDE and likely choose Swift as the programming language, using the iOS SDK.
If you then subsequently decide that you want to “port” your app from one platform to the other, then you’ll need to rewrite all of that code. Depending on the nature of your app, this might be a small job or it might be a huge job. You’d then need to set up the project in the new IDE and rearrange all the layouts, add all the images etc.
But at least you’d be able to use the same design specifications and graphics, right? Well… not exactly. Unfortunately, the design language used in iOS is rather different from the design language of Android. Android is well-known for its Material Design approach, whereas iOS has a completely different look and feel. The hardware that runs iOS and Android will vary too. Android developers might be used to dealing with fragmentation and multiple different screen sizes and resolutions, but now you need to consider the lack of back button and the way that users are accustomed to interacting with their apps too.
If you’re adding your app to the Windows Store, or Windows 10 Mobile (sure, why not?), then you’ll need to consider even more factors.
In other words? It’s a headache. So the answer is ideally to set out to build something cross platform from the start.
Choosing a cross platform IDE
Fortunately, this frustration hasn’t gone unnoticed and there are many IDEs created specifically to target the problem of cross-platform mobile development. An IDE (Integrated Development Environment) lets you organize your project, run your code, and more. Android Studio and Xcode IDE are examples of IDEs.
There are many IDEs created specifically to target the problem of cross-platform mobile development
But there are other IDEs out there that use different programming languages, have different features, and target different devices. Several have been developed specifically to solve the issue of cross-platform development.
Here are some of the best for any type of app:
Xamarin
Xamarin is perhaps the most popular choice for cross-platform development outside of games and has a large community, lots of support, and many useful features. Xamarin comes bundled with Visual Studio (Microsoft’s IDE), and lets you code with C#, which some developers may prefer to Java.
You do lose a little of Google’s support and advanced integration. Accessing libraries written in Java will also involve a couple more steps than it previously would have. But other than that, there is little you can do in Android Studio that you can’t do in Xamarin and it’s a fairly painless process to get set up. Of course the real highlight is the cross-platform nature of Xamarin, and you can even test your app on different platforms using the Xamarin Test Cloud.
Flutter
Flutter is a recent project from Google that looks to streamline cross platform development and provide a single codebase for your UI. Flutter will integrate with Java, Objective C and Swift, meaning that you don’t need to completely reinvent your app, and comes with useful features such as ‘hot reload’ for rapid testing. It does mean learning Dart though, which is yet another programming language to get your head around. Fortunately, Android Studio has dedicated Flutter and Dart plugins, so it’s very easy to get started. And it just came out of beta!
B4A
I’ve made no secret of my love for B4A from Anywhere Software. This is what got me started in Android Development. I still use it to this day when I want to get something up and running as quickly as possible. B4A allows you to develop Android Apps using a language called BASIC (hence the B), which is particularly simple to read and write. It also has a number of features designed to help speed up the process of creating your apps.
B4A itself is not cross platform. However, Anywhere Software also offers a similar tool called B4i and that does exactly what you might expect (it’s Basic for iOS, in case you missed it). This is the only development tool that allows you to create native iOS apps without a Mac computer, which is a great claim to fame. What’s more, because the programming language is the same, you’ll find it’s much quicker to port from one platform to the other. Many of the same libraries will even work! For those who would also like to develop for desktop computers, the B4J (Basic for Java) has you covered.
It’s not perfect, however. For starters it isn’t free. Secondly, it’s a little harder to create an app that will have the complete modern Material Design feel. Many libraries will need tweaking to get running and of course, you lose that crucial Google support again. But this is certainly still a good option for those that find more complex IDEs daunting.
PhoneGap
Both Xamarin and B4A will allow developers to create native apps. That means they will run just as though they had been built using the official IDEs and will have access to all the hardware and software features of the devices they’re running on.
PhoneGap is an example of a different approach. This is a tool for building apps using HTML, CSS, and JavaScript – languages typically used in web development. In other words, apps can run as though they were webpages, meaning they will work with pretty much any modern device. This isn’t “native” development though, and you’ll lose a fair amount of functionality as a result. You certainly wouldn’t want to go this route for building a game, unless it was noughts and crosses or hangman. That said, you can still access many phone features such as the camera, the compass, media etc. and if your vision is for something fairly basic, then this should suffice. For example, if you were looking to build a business app with minimal financial investment, then you could create a static app with some information and a map this way.
Unity
If you’re making a game, then cross-platform development is significantly easier. In fact, most of the tools you would use to create a game already have cross-platform support built in, and this makes publishing to different operating systems as simple as ticking the right box.
Unity is the game engine and IDE behind the greatest proportion of games in the Play Store. It really is a very simple and powerful tool that makes development easy for beginners, yet still gives you all the flexibility to create whatever you can imagine. You have the option to develop using C# or Java, and it’s possible to make something impressive with relatively minimal coding required. There’s a large community and plenty of support available should you get stuck, as well as a large selection of assets created by other users for you to add to your own games.
Unity actually offers support for a huge range of platforms, including all the major mobile platforms, Windows, Mac, Linux, home consoles, and even VR. And if you wanted, there is nothing to stop you from making cross platform apps that aren’t games this way.
Read Next: Build your first basic Android game in just 7 minutes (with Unity)
Unreal
Unreal offers a similar proposition to Unity, providing a fully functioning 3D game engine and user-friendly IDE. The main difference is in performance and flexibility. Unity is a little better suited to making 2D games with more in-built support, which is possibly what makes it slightly more popular for mobile development. What Unreal has going for it instead is greater graphical performance, which makes it slightly superior for developers that want the most detail and highest framerates on PC. This likely won’t be an issue for mobile development but if your plan is to build for PC first and support mobile later on with a pared-down version, then you might consider Unreal instead.
Read Next: Which is better? Unity vs Unreal Engine for Android game development
GameMaker Studio
GameMaker Studio is an even more user-friendly alternative to Unity or Unreal. Development is kept streamlined and super easy, and lots of resources are provided to save you time and effort. There is still deeper control available for those that would rather dig a little under the hood though. Successful games like Hyper Light Drifter have been built this way. Of course you’ll get less power and flexibility than you would with either Unity or Unreal though.
Successful games like Hyper Light Drifter have been built using GameMaker Studio
Whatever you choose, using one of these platforms for game development will save you a huge amount of time and likely result in a better end product. It’s just a fantastic bonus that you’ll get ready-made cross-platform support by default as well.
And many more…
There are plenty more options out there for getting started with cross-platform mobile development. Popular choices include Cordova, Ionic, Corona, Appcelerator, and Sencha Touch. Do some research and see which one appeals to you.
If you want my advice though, then you should stick to Xamarin for utilities and either Unity or Unreal for games. If you’re put off by lots of code and set up, then you might try GameMaker Studio, or perhaps B4A. Those with zero interest in coding might consider using an app builder like PhoneGap, though in that case you could always just outsource development.
Some tips
The good news for game developers is that going cross platform involves significantly fewer hurdles than building a productivity tool. The UI in a game doesn’t have to conform to the design principles of the rest of the operating system and nor is it likely to require things like intents to launch other apps, or even access to unique hardware features.
The only considerations you need to make in terms of designing your app is what the best monetization system is for that platform and who the target audience will be. You’ll find more “hardcore gamers” on a PC or console for instance, while iOS users are happier to pay more for apps upfront. Does this change the way you present and package your app?
But for utilities and other non-games, things get a little more complicated. Tools like Xamarin make it relatively easy to support multiple platforms but don’t let this make you complacent. You still need to consider the different design sensibilities that will thrive on each platform. It’s a mistake to keep the different versions of your app identical and you might even struggle to get your app published on iOS if you don’t adhere to some of the guidelines.
And keep in mind that you’ll likely need multiple machines (you’ll need a Mac to develop for iOS in most cases, as well as an iOS device), lots of SDKs and lots of testers if you’re going to go cross-platform. It’s still slightly more challenging than targeting a single platform then, so make certain you know precisely who you’re targeting before you start out! Once you have a concrete plan of action in place, you can go about selecting the right IDE and outline the differences between your separate versions.