MobileApplicationsDevelopment
Introduction,overview offrameworks
What aremobilephones?Two typesofmobilephones
• Feature Phone• Send andreceive text messages• Basiccamera• Bluetoothsupportforhands-freecommunication• Canrun basicapplications
• Smartphone(andTablets)• Allows theusertointeract with advanced applications• Highquality cameras(front/back)• Connected:4G,Wifi,Bluetooth• Graphic chipset• Runs complete operatingsystemsoftware• Music,Video• Alotofvarious apps,andmore…
Feature phonevssmartphoneworldwide shipmentsFrom 2008to2020
GlobalMobilevsDesktopInternetusageFrom 2007to2015
Some statistics aboutappsmarket trendsandusagesSources:statista.com
Globalmarket share held byleading smartphone vendorsFrom 4thquarter2009to2ndquarter2016
Globaltablet unitshipments byvendorFrom 3rdquarter2011to2ndquarter2016
Number ofapps available inleading app storesInJune 2016
Number ofapps available inleading app storesInJune 2016
• 100billiontimesapps havebeendownloaded from AppStore• However,23%apps arenotused morethan onceinthefirst6months• Morethan 1000newapps perday onApple’s AppStore
Number of Available AppsintheAppleAppStoreFrom 2008to2015
AppleStore GooglePlay
Smarphone apps popular usagein2016
25%aboutgaming!
Smartphonedevice’s features
• Accelerometer andGyroscope(sports,game,navigation,utilities)
• GPS(navigation,utilities,game)
• Camera(photo&video,entertainment,game)• Augmented reality(AR)apps can read your locationandoverlayimagesontothelivefeedfrom thecamera
• Touchscreen (game)• Detects auserinteraction,such astapping thescreen once,double-tapping,swiping,ordragging abutton orobject
• Bluetooth(health,medical,utilities)• With connected objects
3mainapps businessmodels
• Paid appso Noadd,nor limited featuresJo Peoplewho havepaid aregoodambassadors toconvince newusersJo Moreinnovative apps,cleaner interfaceJo Hardtoget newusersLo Selling is hard,app storesareovercrowdedLo Need tofind therightniche,target …
• Free,with ads revenueo Allow toget users quicklyJo Cancomprisetheapp experience,limit screenLo Notforutilityapps,supposed tohelpusers..L
• In-app purchases,Freemiumo Allow toget users quicklyJo FlexiblemodelJo Donotoffer too many nottoo fewfeaturesL
WorldwideAppdownloads andRevenuebyStore,in2016
Differences between desktopandmobiledevices
Physicaldifferences between desktopsandmobiles
• Mobility• Datastorage• Memory• Energy• Screen size,number ofwindows• Inputmethods• Transfertrates
Physicaldifferences – Mobility
• Ofcourse,mobiledevices• Aremobile;desktopsarenot• Provide anywhere,anytime access• Canrun applicationsbased onGPSorother locationinformation
Ø Alotofnewusagescomparetodesktopapps• Example:amobiledevice applicationcan detect theuser’s locationandrequest weather ortraffic updatesspecific tothat area…
Physicaldifferences – Memory
• Mobiledevices haveamuch lower memorycapacity than desktops• Insufficient memorycan result incrashorvery slowperformance
Ø Development consideration• Reduced memorycapacity means less tolerance formemoryleaks
Physicaldifferences – Power
• Desktopspluginto electrical outletsà they haveunlimited power• Mobiledevices usebatteriesà available poweris limited.
Ø Development considerations• Processor(anddisplay)intensiveapplicationscan drainbattery power• Heavytasks should be avoid onCPUà useGPUorremote server• Users will avoid using applicationsthat usetoo much power
Physicaldifferences – Screen size
• Mobiledevice screens aremuch smaller than desktopmonitors.
• Designconsiderations• Reduce theamount ofitemsorinformationdisplayed atonce• Mustwell define howviews areorganised andworkflowbetween them• Fine-detailed videos,photos,andgraphics may notappear asclearly onamobiledevice screen.
Physicaldifferences – Inputmethods
• Mobiledevices havevery small keyboards,butgainwith multitouch• Many users prefer tousephysical keyboard,mouseortrackball
Ø Designconsiderations• Avoid creating tasks that rely heavily ontheuseofthekeys• Minimize useofthekeysfornavigationà consider using autocomplete,touchesdrag&drop
Physicaldifferences – Datastorage
• Desktopscan storehuge quantities ofdataandapplicationfiles
Ø Development consideration• Usewebservices:get dataon-demand,releaseafter
Physicaldifferences – Transfertrates
• Mobiledevice wireless networkshavemuch slower transfer ratesthan wire connections• Wirelessconnectionsareless reliable than wire connectionsandcanresult inlongerandmorefrequent outages• Users may havelimited dataaccess
Ø Development consideration• Avoid tasks that require immediate orlong,uninterrupted datatransfer.• Download dataasbackgroundtasks
Users differences
• Peopleusemobiledevices differently than they usedesktops• Mobileusers areyounger than desktopusers!• Atdifferent momentoftheday• Example:different objectivewhen browsing
• Mobileusers want immediate,shortandrelevantinformation• Speedoftask completion andinformationretrievalà Donotwait fornothing• Relevanceofinformationandapplication’s goalà Need singleobjectiveapps• Ease ofuseà DesignUIaccordingly
source:Microsoft&FinancialTimes
Aquickoverview ofpopularframeworks
Frameworks – Anhistory
• 1999:Sunlaunched JavaME
• 2003:Androidcompany is funded
• 2005:Googleacquired Android
• 2007:FirstiPhone,multitouch
• 2010:W3CFirstRecommendation onMobileWebApplications
• 2011:Xamarin,anativecross-platformnativeinC#
• 2012& 2014:HTML5standardFirstreleases
• Since:Alotofnewframeworks…
• 2008,March:FirstiPhoneSDKrelease
• 2008,July:Applelaunched AppStore
• 2008,August:GooglelaunchedAndroidMarket
• 2008,October:Firstsmartphoneunder Android(HTCDream)
Frameworks – JavaME (J2ME)
• JavaMicroEdition• Dedicatedtoembeddeddevices(notonlyphones)
• Modularframework• Multilayered:Configuration/Profiles• Midlets (MIDPProfile)• SubsetofJ2SE
• Highfragmentation• JVMnotstandardized,JSRnotcomplete
Frameworks – JavaME (J2ME)
• Firstframework forMobileApps• Introduced thegeneral conceptsforapp deployment (emulators,manifest,…)
• Development tool• Eclipse+SDKSun• Emulators notalways consistentwith devices
• Still alive!• Butnomoreformobilephone
Frameworks – Android
• Firstplatform formobiledevices• AnopensourceOSformobilephones• Adevelopment environment built overtheLinuxkernel
• Worldwidetopused framework formobileapps
• Many Androidversioncoexist• AndroidTV,AndroidAuto,AndroidWear(forwatches)• Also used onnotebooks,game consoles,digitalcameras,andotherelectronics…
Frameworks – Android
• Based onLinuxKernel andJavaVirtualMachine
• Until Android5.0:Runs onDalvik VirtualMachine• JIT:JustInTime,bytecode interpreted atruntime
• From Android5.0:AndroidRunTime (ART)• AOTAhead OfTime,bytecode interpreted atcompilation• Better performance
• Each applicationruns onaseparated VM• Multipleways tocommunicate (IPC,Intents,…)
Frameworks – AndroidMainAppcomponents
• Activities correspondtoasinglescreen• Anapp usually hasmultipleactivities• Inheritates Activity class
• Servicesrun inbackground• Nouserinterface(plays music,download data,…)• Subclass ofService
Ø Thisdesignallow any app tostart another app’s component• Using Intents,subclass ofIntent
• ContentProvidersmanageashared setofapp data• Access(read/write)tofiledata,SQLite database,persistent
objects• Example:get Contactsinformation• Subclass ofContentProvider
• BroadcastReceivers respond tobroadcastannoucements• ie:Eventornotifications• Nouserinterface• Inheritates theBroadcastReceiver class
Frameworks – AndroidAndroidManifest.xml
• Declare every app’s componentandressources
• Identify any userpermissionstheapp requires• ie:Readaccess totheuser’s contacts
• Declare theminimumAPILevel required bytheapp• Which SDKversionis needed?
• Declare hardwareandsoftwarefeatures used orrequired bytheapp• ie:Camera,Bluetooth,multitouch screen
• APIlibraries theapp needs tobe linked against• ie:GoogleMaps Library
Frameworks – AndroidDevelopment tools
• AndroidStudio,launched on2014• Was Eclipse+AndroidSDK• Based onIntelliJ IDE
• FreeandOpensource (ApacheLicense2.0)
• Multiplatform (Windows,MacOS,Linux)
• Many recent improvements:now have« usable »UIeditorandemulators
Frameworks – iOS
• Secondplatform formobiledevices• First(historical)advanced SDKformultitouch devices• MostlucrativeAppStore
• Bestintegration with hardware• Nofragmentation(almost)
• iOSSDKis asubset ofmacOS SDKwith additional frameworks• Also,tvOS andwatchOS• iOSSDKrecently adopted Swiftasmaindevelopment language (was Objective-C)
• Low-level UNIX-like 64-bitskernel• Similar with macOS
• Multilayered architecture• Fordevelopment,usethehighest layer(when possible)• Layers contain asetofpackages(called frameworks..)
• Appsrun ondifferent Threads• Runloop mecanism tomanageinputqueue(forevents,blocks,timers,…)• Themainthreadis responsible forUIupdate• NiceConcurrency programming API:GrandCentralDispatch
Frameworks – iOS
• UIApplication is theapp’s entrypoint• Exactly oneinstance• Handles incoming infofrom theOS(events,memory,…)
• UIApplicationDelegate is theProtocolimplemented byAppDelegate.swift• Allow anapp tointeract with theOS• Where theapp’s lifecycleis implemented
• UIWindow is theuniquewindow oftheapp• Except ifconnected external display…
• ViewControllers managetheviews oftheapp• MVCdesign
Frameworks – iOSMainAppcomponents
• Xcode is thedevelopper tool forMac• CompleteIDEforgeneral development• Naturally integrates macOS andiOSSDK(andmore)• Run only onMac…
• Themost advanced IDEtodesignmobileapplications,inmy opinion :)• Greatview layout editor:Storyboard• EfficientiOSemulators• Many testing tools andnice features
• Connect toAppStoreforeasy app packagingandsubmission• Mustpay tosubmit apps• Freefortesting app deployment
Frameworks – iOSDevelopment tools
iOSvsAndroidcomparison?
• Impossibletocomparefairly!
• Both haveprosandcons;supportersandopponents…
Native,Webapp orHybrid?
• Nativeapps market continuetogrow (exponentially…)• Despite ofnewwebframeworks• Butnewemerging markets
• Webapp still suffers from poor performanceanddevice integration• Butcheaper toproduce andcross-platform
• Hybrid apps seems goodtradeoff• Based onasingle« WebView »,still limited• Better device integration (AppStore,Notifications,Contacts,…)• Notforcomplexapps
Native Hybrid Webapp
Development skills neededSwift,iOSSDK,Java,Android
SDKHTML,CSS,Javascript,MobileDevelopment Framework HTML5,CSS,Javascript
Distribution AppStore/Market AppStore/Market WebDevelopment speed Slow Moderate Fast
Development &Maintenancecost High Moderate Low toModerateAppperformance High Moderate Moderate
Device AccessandfeaturesPushNotifications Yes Yes NoContacts Yes Yes NoOfflineaccess Yes Yes No(*)Geolocation Yes Yes Yes(*)Gyroscope,Accelerometer Yes Yes Yes(*)Camera Yes Yes Yes(*)Microphone Yes Yes Yes(*)Swipe Navigation Yes Yes Yes(*)
BestUsed For*Games oradvanced apps*Highperformance,graphics*Bestuserexperience
*Donotneed bestperformance*Need fulldevice access
*Limitedbudget*Donotneed bestperformance*Dononeed fulldevice access
Native,Webapp orHybrid?
Acrossplatform solution:Xamarin
• Develop iOS,Android,OSXandWindowsapps using C#• Compiletonativeapps!• Sharecodebetween multipleplatforms• Freeforindividual developpers (thanks to..Microsoftrecent purchase)• Need toknowaboutboth C#andtarget APIs(forbestusage)
• Notnecessary up-to-datewith lastSDKfeatures• Mayneed towait forlastAPIintegration• Sometime hardtobind with third-partieslibraries
Conclusions
• Mobileapps development is still achallengefornext decades• Appmarket keeps growing• Changeusagesandapp development processes
• Many mobileapp frameworks• 2popular nativeframeworks:iOSandAndroid• Hybrids app is goodcompromisebutlimited• Nativeapps offers much possibilities
Ø Let’s learn SwiftandiOSframeworks!