Mobile Development
by Alan Uthoff
an Overview
Who is Alan
Uthoff?
• Works as Lead Developer at GameSalad Inc.
• Professional game developer for 8+ years.
• Has been doing mobile development for 3 years.
• Enjoys working in Linux or Mac
The Mobile Landscape
Source comScore Reports November 2014 U.S.
Smartphone Subscriber Market Share
iOS Android Other
iOS Android
Windows Phone Other
Android Captured Record 85 Percent Share
of Global Smartphone Shipments in Q2 2014
OS That These Platforms are
Really Running
• iOS is based on
Darwin (a flavor of
Unix)
• Android is built on top
of the Linux kernel
• Blackberry 10 is
based on QNX (Unix-
like POSIX compliant)
Mobile Development
Problems
• Native APIs in different languages
• Constrained resources (Memory, CPU/GPU, and
Battery)
• App store and their rules
• Multiple screen resolutions
• Multiple screen orientations
Mobile Development
Problems cont.
• User base using different API level and OS versions
• Creating rendering contexts is different on all
platforms and requires calling in to the native API
• OS is not forgiving on excessive resource usage and
may take away resource if needed elsewhere
• Native APIs are deprecated and removed with each
new OS release
• App store limits the size your app can be
iOS Things to Know
• Requires an Apple developer account
($99/Year)
• iOS store has submission guidelines
• Apple will and has changed iOS app
store submission guidelines without
notice
• Every year Apple updates the OS and
API (deprecating and removing old
ones)
• Requires a Mac to submit an app to
the iOS store
• All libraries have to be statically linked
iOS Things to Know cont.
• Many restraints on scripting
run time engines
• No generated code is
allowed.
• JIT (Just in Time Compiling )
is not allowed
• App file size can be 2GB with
binary being less than 60MB
• Downloads over cell
networks is limited to 100MB
iOS Version Distribution
Source Apple, as of Feb 16 2015
Android Things to Know
• Multiple app stores with some
requiring a fee (Google Play
$25 one time)
• Tool chain can be difficult to
work with (especially C++ and
NDK) and is very unpolished
• Apps have very little control
over resource usage and the
OS may take away resources
at any time
• Debugging can be very
difficult, especially C++ code
Android Things to Know
cont.
• Max app file size depends on
store
✤ Google Play
★ Main app has to be
under 50MB with
optional expansion file
up to 4GB
✤ Amazon
★ No limit but
recommends less then
100MB
• OS version fragmentation
Android Fragmentation
Source Google January 27 - February 2 2015 device using google play
What to do
• Make app that looks and feel good on each
platform
• One code base and easy to maintain
What the Pros Do
• Code base per platform
• Abstract the platform layer to share as much
code as posable
Multiple Code Bases
• Pro
• Short term faster development
• Very native look and feel
• Cons
• Adding new platforms is very costly
• Long term new features take a long time to add
• Hard to release new features across all platforms at the same
time
Multiple Code Bases
• In the long term the
maintenance and new
platform cost will out weigh
all of the pros.
Abstraction and Core Code
• Pro
• Sharing code brings down maintenance cost and scales
with new platforms
• Long term easy to add features across all platforms
• Easy to add new platforms
• Cons
• UI may not look and feel native
• Short term is slow to develop first platform
• The core should be
cross platform and
easy to maintain
• The platform
abstraction layer
needs to be easy to
port to new
platforms
Structure of an App
Platform Abstaction Level
Core Code
OS API
Mobile Native API Language
Platform
Native API
Language
Other Options
iOS Objective-C/Swift C/C++
Android Java C/C++
BlackBerry C/C++ and QML
Java, HTML5, and
Adobe AIR
Windows Phone 7 C# None
Windows Phone 8 C# C++, HTML5
What Language Should the
Core Be In
• JavaScript
• C#
• C++
Javascript
• Pros:
• Easy to develop in and easy to find developers
• Will run on most platforms
• Can use same language for core and abstraction layer
• Cons
• Does not perform well on the mobile devices
• Garbage Collector can impact performance
C#
• Pros
• Easy to develop in and easy to find developers
• Can use same language for core and abstraction layer
• Cons
• Reliant on one company.
• Code may not be portable to platforms out side the ecosystem
• Garbage Collector may impact performance
• Overhead of the .net framework
C++
• Pro
• Very fast
• Very portable and will run on almost any platform
• Can interface with all native platform layers
• Cons
• Can be hard to find developer or train current ones
• Can be slower to develop in than higher level languages
Abstraction Layer
• Core in C#
• Xamarin (Mono Touch)
• Core in Javascript
• Titanium
• Cordova (Phone Gap)
• Roll Your own
• Core in C++
• Marmalade
• QT
• Roll Your own
3rd Party Framework
• Pro
• Will take less development time to produce a product
• Can choose the programming language
• Cons
• Can not control performance
• Most of the time will not have native UI look and feel
• Usually have no control over the SDK code base
Roll your own
• Pros
• Control the code base
• Performance
• Can get perfect native look and feel
• Cons
• Slower to develop
• Keep up and integrate with native APIs
• Limited programming language options
Roll Your Own
• Write a cross platform
framework in C++
• Most mobile platforms
support C++ and allow
calling to native API in
some fashion
• Write as small a platform
layer as possible to keep
code portable
Tips
• Stay away from Java, Objective-C and Swift. They are not
portable on mobile devices.
• Remember to program within the constraints of the
device.
• Games
• Write the core in C++ or C++ and a scripting
language like Lua
• If the scripting language has a Garbage Collector
make sure you have full control of it
Conclusion
• Android still has the market share
• Try to avoid multiple code bases
• Use an abstraction platform layer to interact with the OS
API
• Use a third party framework for quicker development
• Roll your own framework if you need more control and
customization of your code base
• Don’t use a language that will lock you into a platform
Alan Uthoff
Mobile Development
an Overview
Q&A

Mobile Development

  • 1.
    Mobile Development by AlanUthoff an Overview
  • 2.
    Who is Alan Uthoff? •Works as Lead Developer at GameSalad Inc. • Professional game developer for 8+ years. • Has been doing mobile development for 3 years. • Enjoys working in Linux or Mac
  • 3.
    The Mobile Landscape SourcecomScore Reports November 2014 U.S. Smartphone Subscriber Market Share iOS Android Other iOS Android Windows Phone Other Android Captured Record 85 Percent Share of Global Smartphone Shipments in Q2 2014
  • 4.
    OS That ThesePlatforms are Really Running • iOS is based on Darwin (a flavor of Unix) • Android is built on top of the Linux kernel • Blackberry 10 is based on QNX (Unix- like POSIX compliant)
  • 5.
    Mobile Development Problems • NativeAPIs in different languages • Constrained resources (Memory, CPU/GPU, and Battery) • App store and their rules • Multiple screen resolutions • Multiple screen orientations
  • 6.
    Mobile Development Problems cont. •User base using different API level and OS versions • Creating rendering contexts is different on all platforms and requires calling in to the native API • OS is not forgiving on excessive resource usage and may take away resource if needed elsewhere • Native APIs are deprecated and removed with each new OS release • App store limits the size your app can be
  • 7.
    iOS Things toKnow • Requires an Apple developer account ($99/Year) • iOS store has submission guidelines • Apple will and has changed iOS app store submission guidelines without notice • Every year Apple updates the OS and API (deprecating and removing old ones) • Requires a Mac to submit an app to the iOS store • All libraries have to be statically linked
  • 8.
    iOS Things toKnow cont. • Many restraints on scripting run time engines • No generated code is allowed. • JIT (Just in Time Compiling ) is not allowed • App file size can be 2GB with binary being less than 60MB • Downloads over cell networks is limited to 100MB
  • 9.
    iOS Version Distribution SourceApple, as of Feb 16 2015
  • 10.
    Android Things toKnow • Multiple app stores with some requiring a fee (Google Play $25 one time) • Tool chain can be difficult to work with (especially C++ and NDK) and is very unpolished • Apps have very little control over resource usage and the OS may take away resources at any time • Debugging can be very difficult, especially C++ code
  • 11.
    Android Things toKnow cont. • Max app file size depends on store ✤ Google Play ★ Main app has to be under 50MB with optional expansion file up to 4GB ✤ Amazon ★ No limit but recommends less then 100MB • OS version fragmentation
  • 12.
    Android Fragmentation Source GoogleJanuary 27 - February 2 2015 device using google play
  • 13.
    What to do •Make app that looks and feel good on each platform • One code base and easy to maintain
  • 14.
    What the ProsDo • Code base per platform • Abstract the platform layer to share as much code as posable
  • 15.
    Multiple Code Bases •Pro • Short term faster development • Very native look and feel • Cons • Adding new platforms is very costly • Long term new features take a long time to add • Hard to release new features across all platforms at the same time
  • 16.
    Multiple Code Bases •In the long term the maintenance and new platform cost will out weigh all of the pros.
  • 17.
    Abstraction and CoreCode • Pro • Sharing code brings down maintenance cost and scales with new platforms • Long term easy to add features across all platforms • Easy to add new platforms • Cons • UI may not look and feel native • Short term is slow to develop first platform
  • 18.
    • The coreshould be cross platform and easy to maintain • The platform abstraction layer needs to be easy to port to new platforms Structure of an App Platform Abstaction Level Core Code OS API
  • 19.
    Mobile Native APILanguage Platform Native API Language Other Options iOS Objective-C/Swift C/C++ Android Java C/C++ BlackBerry C/C++ and QML Java, HTML5, and Adobe AIR Windows Phone 7 C# None Windows Phone 8 C# C++, HTML5
  • 20.
    What Language Shouldthe Core Be In • JavaScript • C# • C++
  • 21.
    Javascript • Pros: • Easyto develop in and easy to find developers • Will run on most platforms • Can use same language for core and abstraction layer • Cons • Does not perform well on the mobile devices • Garbage Collector can impact performance
  • 22.
    C# • Pros • Easyto develop in and easy to find developers • Can use same language for core and abstraction layer • Cons • Reliant on one company. • Code may not be portable to platforms out side the ecosystem • Garbage Collector may impact performance • Overhead of the .net framework
  • 23.
    C++ • Pro • Veryfast • Very portable and will run on almost any platform • Can interface with all native platform layers • Cons • Can be hard to find developer or train current ones • Can be slower to develop in than higher level languages
  • 24.
    Abstraction Layer • Corein C# • Xamarin (Mono Touch) • Core in Javascript • Titanium • Cordova (Phone Gap) • Roll Your own • Core in C++ • Marmalade • QT • Roll Your own
  • 25.
    3rd Party Framework •Pro • Will take less development time to produce a product • Can choose the programming language • Cons • Can not control performance • Most of the time will not have native UI look and feel • Usually have no control over the SDK code base
  • 26.
    Roll your own •Pros • Control the code base • Performance • Can get perfect native look and feel • Cons • Slower to develop • Keep up and integrate with native APIs • Limited programming language options
  • 27.
    Roll Your Own •Write a cross platform framework in C++ • Most mobile platforms support C++ and allow calling to native API in some fashion • Write as small a platform layer as possible to keep code portable
  • 28.
    Tips • Stay awayfrom Java, Objective-C and Swift. They are not portable on mobile devices. • Remember to program within the constraints of the device. • Games • Write the core in C++ or C++ and a scripting language like Lua • If the scripting language has a Garbage Collector make sure you have full control of it
  • 29.
    Conclusion • Android stillhas the market share • Try to avoid multiple code bases • Use an abstraction platform layer to interact with the OS API • Use a third party framework for quicker development • Roll your own framework if you need more control and customization of your code base • Don’t use a language that will lock you into a platform
  • 30.