Skip to content

Instantly share code, notes, and snippets.

@eoinkelly
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eoinkelly/2c6426533735baffc72a to your computer and use it in GitHub Desktop.
Save eoinkelly/2c6426533735baffc72a to your computer and use it in GitHub Desktop.
A brief overview of Hybrid apps in 2014

Hybrid apps in 2014

  • What is is like to build hybrid apps in 2014?
  • How does it differ from mobile development in 2014?

The tools:

  • Webviews
    • WebView not necessairly the same as the built-in browser on the device.
  • Apache Cordova
  • Normal mobile web development

What it is

  • Good code and style re-use across platforms
  • Approximately the same level of difficulty as making a mobile site if you stay mostly within what is built-in to browser.

What it is not

  • A promise that you will never see or smell Java/Objective C
  • A promise that you will not install XCode, Eclipse (or Android Studio)

Hard bits

  • Old android is a challenge

    if (android < 4.4) {
      webview = ! chrome;
      webview = old;
      console.log = primitive // strings only, party like its 1999
    }
  • Cordova plugin ecosystem is small, immature

    • To make a plugin you need web, Android, iOS, $other skills
  • Cordova docs are not amazing (but have improved).

It gets better

  • Android 4.4+, iOS 6+ allow you to attach dev tools to the webview
    • Sadly Android 4.0 - 4.3 is still almost 50% of the install base
  • Browser emulation of small screens/mobile devices is very helpful.

Recommendations

  • Same JS framework trade-offs apply as for a mobile website.

  • You need a build step.

    • Minification still matters
    • You will want to target different environments
  • Do as much developement as possible in the browser. Use your build process to stub out the bits of Cordova that your app requires.

  • Become somewhat competent with the Android/iOS dev tools

    • You don't need to know heaps of Java/ObjC but knowing how to drive the IDEs and do basic debugging is helpful
    // Objective C
    NSLog("Reveal thyself: @%", thing);
    // Java
    import android.util.log;
    Log.d("Reveal thyself: ", someThing);
  • Absolutely must test on real devices - emulators are mostly useless.

Alternatives

  • Some things build on top of Cordova e.g. ionic framework
    • Have not used them but presume same trade-offs as vanilla Cordova.
  • Xamarin - uses C# and builds against the operating system native frameworks e.g. Cocoa on iOS

Q & A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment