Mobile Dev Strategy: Cross-Platform Part 1
Posted by Binary Excursions on Friday, July 08, 2022
with
No comments
To continue the mobile development strategy series of this blog - this will be a two part post which will address the mobile development strategy that is possibly the most divisive and often has the strongest of contradicting opinions and preferences:
We're talking about mobile cross-platform development...
Mobile cross-platform in particular, mostly due to its strongly contested and very impassioned opinions both for and against it from engineering as well as business teams alike, tends to bring up some very difficult choices for business decision makers.
Leaders must optimize their investment in mobile development dollars - certainly in today's hyper mobile reliant technical landscape. Today, due to the cost of mobile talent and mobile solutions ever increasing complexities - mobile cost are likely to take up a significantly larger portion of your organization's development budget than even just a few years ago. So, is mobile cross-platform the money saver your organization needs? Maybe. Maybe not...
When faced with the mobile cross-platform decision challenge, who should leadership go to for help? This gets quite tricky when equally qualified professionals offer up equally well qualified contradictions of each other.
However, before allowing frustrations to break you down into passing this critical business decision off to your engineers to determine the best business and financial route of the organization's mobile solution - I highly encourage you as a business leader/investor to continue reading...
Cross-Platform Overview:
There are two aspects which need to be looked at when fully discussing mobile cross-platform solutions:
- The first part we'll look at in this post is the overall details which make up a general cross-platform solution. This is to offer the business leaders a foundational understanding
- The next point - which will be in part-2, is a look at the technical details used to evaluate a mobile cross-platform solution for business leaders to be able to decide how, when, and if to move forward with a mobile cross-platform solution.
Let's first get a common, overall understanding of cross-platform development in general. This will be important when evaluating cross-platform for your mobile strategy.
One point I'd like to throw out there early on, as many may be thinking this is an old topic already exhaustively evaluated.
As we are globally progressing into a new era of IoT, fog computing, 5G and edge computing, Web3, the MetaVerse, increasing AR & VR performance demands, a hyper aggressive world of wearables, and decentralized security concerns - today's mobile cross-platform considerations for a business leader are not the same as that of 5 years ago. That said, neither is the quality of the cross-platform offerings today - many of which are absolutely phenomenal today!
OK, back to our regularly scheduled program...
The cross-platform concept is nothing new (mobile or otherwise) and is a "promise" we in the industry have heard for decades. Has the cross-platform promise come to fruition - including mobile? I think the technical answer is "eh..."
First, the reason for "eh..." is because cross-platform today is still usually achieved via platform specific virtual machines - the one you've most likely heard of is the JVM (Java Virtual Machine) and since it's likely the most familiar, we'll use JAVA as our example cross-platform use case to come to common ground.
Essentially, the JVM is a piece of middle-ware software that knows how to take the JAVA byte-code, "turn it into" machine instructions, which can then be run on various and differing systems.
FYI:
- JAVA code (what your developers write) is compiled into JAVA byte code
- JAVA byte code is read by the JVM and converted/compiled into machine code
- Yes, there's a JRE factor in there, but it isn't really needed for this conversation
- "Machine code/instruction set" is what's run by the system
- We could go into O/S and HW specifics regarding this, but instead, we'll just refer to the system rather than diving into O/S and HW specifics.
Essentially know the JVMs allow us to seemingly write an application once and have it run on multiple machines running different systems. Sounds like the differences between iOS and Android.
So if the same principal applies, then mobile cross-platform development sounds great! Write my mobile app once and using a single baseline, have it run exactly the same on every mobile platform. Sign me up!!!!
What more is there to discuss? Well, as it turns out - a lot! ie: A two part blog...
So, does the need for a JVM intermediary to run a JAVA app qualify JAVA as fulfilling the cross-platform promise? I'd say "eh..."
The issues:
The first issue to note - if you intend on running your JAVA app on a system which does not have a JVM, JAVA's cross-platform'ness won't help you at all. Granted, there is a way to compile JAVA natively but that kind'a defeats the cross-platform purpose and we won't go into this here.
The point to take away here is that the JVM is what JAVA apps/byte-code run through. However, know that the JVM itself is not at all developed using a cross-platform code base. The JVM itself is a piece of software very much written for the native platform and has many code bases - and most likely a lot of "special-cased" code.
ie: The Windows JVM code base is different (probably very much so) than the Linux or Mac or Chromebook JVM...
Special case:
Since I will be using the term a lot when discussing mobile cross-platform development, and in keeping with this blog's theme as a blog for business leaders - I want to briefly describe the term "special case" regarding code. Below is a simplified code snippet which might be used to print out the user's home directory. However, getting the home directory is "special cased" depending on the O/S the user is running:
var UserHomeDirectory:string = ""
if(O/S == WINDOWS)
UserHomeDirectory = "c:\\username\\"
else if(O/S == MAC)
UserHomeDirectory = "/Users/username"
else if(O/S == Linux)
UserHomeDirectory = "/username"
print(UserHomeDirectory)
OK, now with everyone on common ground, we now enter into mobile cross-platform environments.
What is mobile cross-platform:
From a business leader/decision maker's perspective, when we talk about cross-platform for mobile, we're usually discussing frameworks and full development environments rather VMs for apps to run on.
So:
- Don't think about a mobile cross-platform solution as a byte-code app running on an installed VM
- Instead picture a mobile cross-platform development environment which produces multiple natively executable mobile applications - one for each of the respective platforms
- These native apps are then pushed to the respective app store using that same development environment's tools - either via your DevOps Pipeline or a tech lead pushing that app(s) up to the store(s)
This may seem simply a conceptual point, but it's important and will make your life as a business leader easier to think of mobile cross-platform in these terms.
To sum this part up:
- JAVA cross-platform compiles to an intermediary language - byte code, which uses a platform specific intermediary app (the JVM) to run your JAVA solution on multiple platforms
- Mobile cross-platform is a native app built for multiple mobile platforms from within a single development environment/IDE
Why think in these terms? Because each platform uses a different paradigm how each specifically compiles and runs apps on the respective mobile O/S. These are details you as a business leader don't really need to worry about - your engineers do. Further more, these specific technical details rarely, if ever, play a part in financial and business considerations.
As a note, because I know some developers will freak if I don't mention this - yes, Android uses a JVM internally as its "native" apps are developed using JAVA/Kotlin - both of which get compiled to byte code. Regardless, as a business leader this might be a nice to know, but it's an incidental detail and you shouldn't be worrying about. This level of detail doesn't change the fact that a mobile cross-platform solution is about building, testing and deploying your mobiles apps, not worrying about system layer details how the app is loaded by the mobile O/S.
Now that we have the gist of what mobile cross-platform is, let's jump into some of the common terms you'll often hear when this topic comes up.
Mobile Cross-Platform environments:
As mentioned, JAVA is generally considered a cross-platform language, but when we discuss mobile cross-platform development, we refer to environments/frameworks/etc...
The reason for this is that mobile cross-platform takes place in a much larger ecosystem - more so than what a programming language in isolation could provide. The frameworks provide a full spectrum of features specific to mobile development and other features needed specifically for development, deployment, and testing.
NOTE: There are technical reasons to refer to these environments as either an environment, framework, IDE, etc... For simplicity, I will simply refer to everything as a framework. I look forward to the comments on that one.
The important take away for business leaders here is - mobile cross-platform frameworks are a layer of abstraction so your mobile developers can leverage a single language and development environment to produce native mobile apps on multiple platforms from a single'ish code base.
Single'ish - remember that special case term from earlier? This will be a very interesting component in the second part of this post
When you hear discussion around these frameworks, each framework implements a language of their choosing which may play a factor into which platform your organization chooses.
Examples include:
- Xamarin (framework): C# (Language)
- Flutter (framework): Dart (Language)
- React Native (framework): HTML/CSS/JS (Language)
- Cordova (framework): HTML/CSS/JS (Language)
All of this will get tied together for further clarity in the second part of this post when we dive into various mobile cross-platform technical details and the impact various capabilities can have on your mobile development strategy.
0 Comments:
Post a Comment