• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Dion Almaer

Software, Development, Products

  • @dalmaer
  • LinkedIn
  • Medium
  • RSS
  • Show Search
Hide Search

Cross Platform

The Principles of Cross Platform Development

September 21, 2015 Leave a Comment

The mobile phone evolution

When you said “hybrid” a couple years back, most engineers would assume you were talking about “using a WebView in your native mobile app, maybe with PhoneGap”.

Fast forward to today and you see attention on a whole swath of solutions that try to deal with the fact that our customers want to use our experiences on a variety of platforms, and this is only exploding. Gone are the days where Windows, or The Web Browser, were near-monopoly’s. Now we not only have multiple operating systems, these operating systems come to us from very different types of computing platforms and interfaces: hand held, laptop, desktop, tv, watch, anything-that-talks-to-a-network. That bar for software quality has also been raised, especially on the user experience side, but we have finite resources for product development; hence the desire to get leverage from engineering (as well as design and other areas).

You can quickly start a religious war on the topic, with the two extremes being “everything must be native!” on the one side, and “leverage all the codez!” on the other. In practice there is a huge spectrum of leverage, and you can try to get it in a large variety of ways (e.g. “I will write everything in JavaScript and have it magically run anywhere!”)

I have seen people make choices based too much on bias and looking at the wrong level of abstraction to make the decision, so I have tried to define the principles of cross platform development.

Always Understand The Platforms

There are a legion of Web developers, many of whom would love to keep hacking on Web technology and ignore that iOS and Android stuff. There are managers who see their legions and want to choose solutions that can use them productively. It is smart to get people engaged and productive, but it is wrong to ignore the platform affordances, which will lead you to a destiny of a poor product for your users.

If you are developing a product for iOS, the team should have a deep understanding of the platform and its capabilities. Once you understand the platform, your users, and your products you can marry them all together for the best experience possible.

Don’t build the same experience for mobile and desktop

It isn’t enough to make your desktop web site “responsive”, throw some display:none on your Web app, and walk away for a beer. The mobile experience may be very different than your desktop one. When building out the mobile applications for Walmart we focused much more on the in-store use cases. No one walks into the store with their laptop after all. This meant that the mobile applications were vastly different to the mobile website, which was more focused on eCommerce. This doesn’t mean we weren’t able to get leverage, we were (some parts of the mobile app, the eCommerce parts, mirror nicely!)

The User Experience has to be responsive

If a WebView isn’t up to snuff then I don’t care how many web developers you have, you shouldn’t be using the WebView for the main UI of the application. This normally means that the view layer should render natively, as that is what gives you the right level of responsiveness. This doesn’t mean that you can’t power the view tier in a leveraged manner though. You could have certain logic in JavaScript that powers a native UI. React Native does this very well in the React world, but there are many more ways to do this too.

Your architecture should be flexible and future proof

Where is the escape hatch? What if that one piece of the UI isn’t fast enough, is there a way to get closer to the metal? How hard is it to drop down to that level to make it happen? Putting a native component into a WebView isn’t easy for example.

If iOS X comes out and has some crazy new functionality can you easily incorporate that into your application? Is there a nice abstraction to be able to do this? E.g. <MyComponent> does the right thing, but a very different thing on iOS, Android, and Web.

Be able to test as much as you can

When talking to an ex-Facebooker recently he claimed that the reason why Facebook took off to the races was deltoid, their multi-varient testing platform. This enabled a huge number of experiments to be run concurrently, which has huge changes throughout the product and organization. You can go from hypothesis to data and back again quickly. Rather than argue forever about a feature, just get it out there and see. The Web platform is fantastic at allowing these tests, so what is your strategy for running them on mobile? The app that you ship in the app store is a platform to run your experiences. That platform should have a configuration system, A/B testing system, and a great analytics system that all work together as a three legged stool.

Pragmatic Productivity

Who will be building and maintaining this application?

You can’t blindly do an analysis without looking at the staff, and potential staff, who will be working on the applications. Even if the current shape of the team isn’t the right balance (e.g. a ton of Web talent but less mobile talent) that doesn’t mean that you should fully discount a set of solutions though. You need a plan, which can include outside talent, training, and pairing up resources.

Chances are you will have some people who deeply know the domain at hand, and others that deeply know a platform. If you can get them working well together you can set yourself up for a great future. You don’t want a fantastic native experience that offers a ridiculous subset of features, and you don’t want every feature served up without a thought of the platform.

This also shows that a small team of top notch developers working on a rather small problem may correctly choose a very different engineering approach compared to a hugely complex service with a very large team. There is a good chance that the large team could use a platform that supports multiple ways to integrate with the main app (if there is one).

Tooling: React and RoboVM

Along with the people, you have the tooling and entire development process to look at. Recently I have been looking at two interesting choices to get some leverage. React Native has finally shown up with Android support (still early I know) and a lot of excitement. It is a great choice that trades off Web knowledge with view tier performance. You still need to know how iOS handles layout, and the services and capabilities available to you (as with Android), and that is a good thing! React is also being used as a general view on top of various bindings (such as Quip’s approach on top of shared C++).

RoboVM offers something very differently, but also gives you great leverage without giving up on the platform capabilities. Although you write your code using Java, the view code is split up for iOS and Android. On Android you are just writing a Plain Old Android App, and on iOS you are going through RoboVM. This means that your [Objective kindaRemindsYouOf:C] is Java-like instead (again: you need to know how iOS works!). Some will poo poo this: “I don’t like Java!”, or “Ugh if I am doing iOS I just want to write in Objective-C or Swift!” Well, you can actually do that. You can share the Java business logic code and call into it from your iOS application, so you can choose how far you want to go (escape hatch++). If you have a fantastic Android developer, they can jump and be up to speed pretty quickly (aside from learning iOS which isn’t trivial) and then they can have one IDE open that is working across the entire codebase of both apps and shared code.

Google Inbox uses another strategy where Java offers shared code, using GWT to get to the Web and j2objc to get to iOS. Everyone is hybridizing in different ways in an effort to get some code leverage!

There are trade offs everywhere you look. If you feel like you are getting away with a solution that has no trade offs maybe take another peak. The good news is, just as there isn’t a silver bullet, there also isn’t One True Way. Some times you need to make a decision and charge ahead.

What are the core principles that you look for?

Primary Sidebar

Twitter

My Tweets

Recent Posts

  • I have scissors all over my house
  • GenAI: Lessons working with LLMs
  • Generative AI: It’s Time to Get Into First Gear
  • Developer Docs + GenAI = ❤️
  • We keep confusing efficacy for effectiveness

Follow

  • LinkedIn
  • Medium
  • RSS
  • Twitter

Tags

3d Touch 2016 Active Recall Adaptive Design Agile Amazon Echo Android Android Development Apple Application Apps Artificial Intelligence Autocorrect blog Bots Brain Calendar Career Advice Cloud Computing Coding Cognitive Bias Commerce Communication Companies Conference Consciousness Cooking Cricket Cross Platform Deadline Delivery Design Desktop Developer Advocacy Developer Experience Developer Platform Developer Productivity Developer Relations Developers Developer Tools Development Distributed Teams Documentation DX Ecosystem Education Energy Engineering Engineering Mangement Entrepreneurship Exercise Family Fitness Founders Future GenAI Gender Equality Google Google Developer Google IO Habits Health HR Integrations JavaScript Jobs Jquery Kids Stories Kotlin Language Leadership Learning Lottery Machine Learning Management Messaging Metrics Micro Learning Microservices Microsoft Mobile Mobile App Development Mobile Apps Mobile Web Moving On NPM Open Source Organization Organization Design Pair Programming Paren Parenting Path Performance Platform Platform Thinking Politics Product Design Product Development Productivity Product Management Product Metrics Programming Progress Progressive Enhancement Progressive Web App Project Management Psychology Push Notifications pwa QA Rails React Reactive Remix Remote Working Resilience Ruby on Rails Screentime Self Improvement Service Worker Sharing Economy Shipping Shopify Short Story Silicon Valley Slack Software Software Development Spaced Repetition Speaking Startup Steve Jobs Study Teaching Team Building Tech Tech Ecosystems Technical Writing Technology Tools Transportation TV Series Twitter Typescript Uber UI Unknown User Experience User Testing UX vitals Voice Walmart Web Web Components Web Development Web Extensions Web Frameworks Web Performance Web Platform WWDC Yarn

Subscribe via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Archives

  • February 2023
  • January 2023
  • September 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • November 2021
  • August 2021
  • July 2021
  • February 2021
  • January 2021
  • May 2020
  • April 2020
  • October 2019
  • August 2019
  • July 2019
  • June 2019
  • April 2019
  • March 2019
  • January 2019
  • October 2018
  • August 2018
  • July 2018
  • May 2018
  • February 2018
  • December 2017
  • November 2017
  • September 2017
  • August 2017
  • July 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • June 2015
  • May 2015
  • April 2015
  • March 2015
  • February 2015
  • January 2015
  • December 2014
  • November 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • May 2014
  • April 2014
  • March 2014
  • February 2014
  • December 2013
  • November 2013
  • October 2013
  • September 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • April 2013
  • March 2013
  • February 2013
  • December 2012
  • November 2012
  • October 2012
  • September 2012
  • August 2012

Search

Subscribe

RSS feed RSS - Posts

The right thing to do, is the right thing to do.

The right thing to do, is the right thing to do.

Dion Almaer

Copyright © 2023 · Log in

 

Loading Comments...