MOBILE APPLICATION DEVELOPMENT

Transcription

MOBILE APPLICATIONDEVELOPMENT“The search for common ground in a dividedmarket”Ben Feigin

IN THE BEGINNING

MOTOROLA DYNATAC 8000X

EARLY SMART PHONESIBM SimonNokia 9000 Series

WHAT IS A “SMARTPHONE” Semi-Smart: Phone that offers features beyondmaking calls E-mailTake picturesPlays mp3 Phone that runs a complete Operating System Offers a standardized platform for developmentAble to execute arbitrary 3rd party applications

QUICK FACTS Today Projected 2012 Cell phones in use today 1.2 billionSmartphones account for 14% 170 MillionCell phones 1.7 billionSmartphones 29% 500 Million300% Smartphone growth in three years

MOBILE DEVELOPMENT

MOBILE DEVELOPMENT SOLUTIONSJava ME Symbian UIQ S60 Android BlackBerry OVI Windows Mobile iPhone LiMo Ångström distribution Adobe Flash Light BREW OpenMoko Palm OS (Garnet OS, Cobalt OS) Palm webOS Mojo

WHY? Different Phones Different Uses Phones for consumer or phone for businessV-Cast vs PalmMoney Hardware made moneyTried to maintain control over content and services.Wanted to charge 3rd party developers for theprivilege of using their platform.Digital signing Distribution mechanisms.

COMMON PROBLEM: ABSTRACTION Interface / GUI How does the developer create an interfaceDifferent interaction techniques Graphical capabilities of the phone Phone Services and Security What resources are available to your programWhat types of boundaries or constraints are put onapplicationsHow can code be considered “safe”

OTHER ISSUES Distribution Centralized repositoryDirect OTIFrom PCDevelopment Language familiarity PortingIDEs?DebuggingEmulation Vs on PhonePerformanceVery limited resources Battery

THREE TIERED SOLUTION Virtual Environment Core Operating System Java MEBREW *SymbianLiMoRich Operating System AndroidiPhone

VIRTUAL ENVIRONMENTS

JAVA PLATFORM

KVM / CLDC Specially designed mobile virtual machineOriginal Ran with 128k Memory footprintPaired down to bare bones Reduced versions of classes Yank out features String, Object, Hashtable, Vector, Math, Simple ErrorsNo long, float, doubleClass LoadersThreadingMulti dimensional arraysBut Each phone implementation can add them backTakes a profile to complete the stack

MOBILE INFORMATIONDEVICE PROFILE Mobile Information Device ProfileAdds libraries specific to Mobile phones IORecord management systemBasic media playback systemLCDUI- 2D drawing library typically used forsprite based 2d games Optional packages SMS controlPIM personal info management (Contact list control)

JAVA MICRO EDITION Almost all phones include a runtime Pluggable ArchitectureAttempted to be ubiquitous language fordevelopment Security Model Relied heavily on digital signingFell short of expectations Phone specific plug-insApplications could be blocked without specificcertificates.Currently paired down version of java 1.3

JAVA MICRO EDITION New Version 3.0 just releasedOffers support for several new features GPSNew Graphics library LWUITScreen orientationOnly available for windowsUpdated CLDC.

BINARY RUNTIME ENVIRONMENT FORWIRELESS (BREW) Developed by QUALCOMMV-CastSimilar to Java ME Start to finish development integration C/C vs JavaSmaller subset of phonesTighter integration then MEHigh barrier to entryNumber of large steps at high costJava ME can be as simple as publish and go

OPERATING SYSTEMSSYMBIAN

SYMBIAN: AT A GLANCEGood Huge Market Share 45%Robust and wellvetted platform Very open Low overhead eventbased programming BadStrange flavor of C Java and others withSDKResourcemanagement iscumbersome Two popular SDK’sthat are incompatible

UIQ VS S60 Rival SDK’s for the Symbian OSUIQ S60 Sony EricssonTouch screen phonesDeveloped and owned by NokiaCurrent industry leaderWill become standard in late 2009Both offer a full development stack

S60 DEVELOPMENT:THE STACK

S60 DEVELOPMENT:IDE Carbide.c Developed by NokiaIDE based on Eclipse platformProvides a set of tools for debuggingSDK independentCarbide.vs Visual studio implementationSimilar feature set

S60 DEVELOPMENT:APPLICATION STRUCTUREAll applications are treated as dll’s and have asingle entry point Main: Application Class Uses MVC style organization M: Document ClassV: Container / ContainerView ClassC: AppUI Class

S60 DEVELOPMENT:CLASSES AND VARIABLESPrefix Category DescriptionTTypeData containerCClassClass modelRResourceManages external stateMMixinInterfaceStaticFactories and utilityPrefix CategoryDescriptionEEnumValues in enumerationKConstantClass modeliMemberVariableNon-static ‘instance’ variableaArgumentFunction argumentAutomaticVariableManaged variable, destroyedwhen out of scope

S60 DEVELOPMENT:ACTIVE OBJECTS

S60 DEVELOPMENT: ERROR HANDLING LEAVE and TRAP vs try/catchTry Catch has large overheadUse TRAP MacroCleanup is an issueVoid Ctest::FooL(){CBar* v1 new (Eleave) Cbar;CleanupStack::PushL(v1);//Do dangerious };Tint error;TRAP(error, fooL());{If(error! KErrNon){// Handel exception}

S60 DEVELOPMENT: SECURITY MODEL Data caging /Resource/Sys/Private/“Anything else”Capabilities Open to allGranted by user at installSymbian SignedOEM

S60 DEVELOPMENT: FUTURE June 24, 2008: Nokia outright purchased the Symbian OSSymbian Foundation FormedGoals “Provide a royalty-free open platform and accelerateinnovation”Combine Symbian OS, S60, UIQMove code base to open source in next two years http://www.youtube.com/watch?v UxGa6kyPOjk&feature player embedded http://www.youtube.com/watch?v gAg MOFNfFc&feature player embedded

OPERATING SYSTEMSiPHONE

NUMBERS SDK Released March 6th 2008Billion apps downloaded as of April 23rd Includes both pay and freeAssuming 10% paid downloadslowest price of .99/app 99 Million17% Market share just in front of BlackberryStill well behind Symbian but growing very fast

iPHONE DEVELOPMENT Objective-C Message based architectureSimilar to SmalltalkNo Java VM or other 3rd party plugins “An Application may not itself install or launchother executable code by any means, includingwithout limitation through the use of a plug-inarchitecture, calling other frameworks, otherAPIs or otherwise. No interpreted code may bedownloaded and used in an Application except forcode that is interpreted and run by Apple’sPublished APIs and built-in interpreter(s).” –iPhone SDK EULA

iPHONE DEVELOPMENT:SDK Four distinctive framework API’s Cocoa Touch LayerMedia LayerCore Services LayerCore OS LayerIDE XcodeInterface BuilderiPhone SimulatorOn phone application development

iPHONE DEVELOPMENT:INTERFACE BUILDER / XCODE Design for graphical,event-drivenapplicationsPallet of GUI widgets touse in your views.Drag and drop widgetsonto viewsLinks between objectscan be createdgraphically MVC pattern designedhereGraphically declarehooks into a programProduces Nib Files

iPHONE DEVELOPMENT:DESIGN PATTERNS Delegation Method calls aremessages Don’t Subclass[Object Message]Both are dynamicManaged Memory Auto release{NSString *string [. Alloc] ;[string release];return string; //?}{NSString *string [. Alloc] ;[string autorelease];return string;}

iPHONE DEVELOPMENT:APPLICATION LIFE CYCLE

iPHONE DEVELOPMENT:SECURITY MODEL Originally all applications ran as rootNot a whole lot better now All apps run as “mobile” userSurvived this year’s Pwn2OwnSecurity based on delivery mechanism All applications must be delivered through theiTunes App StoreRequires apple approval and testing 99 App Store 299 Enterprise Digitally signed by developer

iPHONE DEVELOPMENT:FUTURE iPhone OS 3.0 In app purchasesAccessory APIsPeer to Peer connectivity New Game KitiPod library accessEmbedded mapsCopy & PasteVideo

OPERATING SYSTEMSAndroid

YEAR OF THE ANDROID?Averaged 47% growth/monthover first four months iPhone 88% Currently only on HTCDream(G1) Really cool concept but will itpenetrate the market

WHAT IS ANDROID Full Stack Fully Open Source and IdeologyUser Control OSMiddlewareApplicationsIDECan establish preferred applicationsApplication Modularity Apps provide functionality that can be used by others

ANDROID DEVELOPMENT:THE STACK

ANDROID DEVELOPMENT:JVM Dalvik Register-based Java virtual machineRuns .dex filesSimilar to a JARUsed a cross compiler tool ‘dx’Optimized for multiple instancesWhy not Java ME? Not fully open sourceStill under control of Sun Micro Veto on any proposed changes

ANDROID DEVELOPMENT:APPLICATION OVERVIEW Packaged in one .apk fileEach application lives in its “own phone” Component based architecture Its own Linux processIts own JVMIts own “file system”ActivitiesServicesBroadcast receiversContent providersManifest file provides information aboutcomponents

ANDROID DEVELOPMENT:ACTIVITIESA visual interface for one task a user will attempt Each activity gets a window to draw in. Similar to a controller, takes view objects todisplay in the window Views can nest within each otherApplication can designate one activity as first

ANDROID DEVELOPMENT:SERVICES Background process No UIExample: Media playerCan connect (bind) to a service Currently runningOr by starting itOnce bound can communicate through predefinedinterface Media Player: start, stop.

ANDROID DEVELOPMENT:BROADCAST RECEIVERS / CONTENT PROVIDERS Broadcast Receivers Event listeners No UICan broadcast eventsOn event execute activity or display notificationContent Providers Opens specific part of an applications dataUses Content ResolversNot called directly Returns a cursor object

ANDROID DEVELOPMENT:INTENTSContains the target object, the target method,and a URI of data to act on Activates components Aside from content providersIntent can call startActivity, startService,sendBroadcast

ANDROID DEVELOPMENT:ACTIVITY LIFE CYCLE

ANDROID DEVELOPMENT:DEMO Video: Example integration using android http://www.youtube.com/watch?v 3LkNlTNHZzE&feature PlayList&p 611F8C5DBF49CEC6&index 2

ANDROID DEVELOPMENT:SECURITY Sand Box Without explicit permissioncan’t get outsideEach application cancontrol what gets exposedPermissions are declared atinstall time and can’tchangeApp signing Digitally signed bydeveloper

ANDROID DEVELOPMENT:FUTURE Could have changedeverything True value of “Apps withoutboarders?”Solid development platform iPhone got there firstBuild on a language withmillions of developersWithout limitations of JavaMENet Books? Still far awayAndroid doesn’t support XServerTech demo already complete.

ON THE HORIZON

LiMo“LiMo believes that the growth of the mobileindustry depends on the existence of a broadlyaccepted operating system.” SDKs NativeJavaWebMajor Players: VerizonMotorolaDocomoVodafone

PALM webOS / MOJO Blurs the line between phone and web sources NativeApplicationCloud“Palm has extended the standard webdevelopment environment through a JavaScriptframework that gives standardized UI widgets,and access to selected device hardware andservices.” Video

QUESTIONSCan the development space ever be consolidated? How big a roll does a centralized distributionmechanism play? Does the safety of the App Store warrant having topay 99 to develop something?

REFERENCES iphone vs. Symbian vs. Android vs. Limo vs. Ovi : We cannot compare anecosystem with an operating system Developing Secure Mobile Applications for Android 4/admob-mobile-metricsmarch-09.pdfWhat is Android rary/wi-arch23.htmlAdMob Mobile Metrics Report http://www.isecpartners.com/files/iSEC Securing Android Apps.pdfArchitectural manifesto: How to Choose a mobile platform 8/06/iphone vs symbi at-is-android.htmlOverview of LiMo 90211%20limo%20overview%20v3.pdf

REFERENCES iPhone Application Programming Guide: The Core Application Using Symbian OS: Getting Started ocoa.html?page 3Dalvik PressResource.Foundation second update release FINAL-20080909Obj-C memory arketin-2012/UIQ Symbian oks/books files/pdf/Getting Started final.pdfSmartphone NUmbers //apple on.org/ stefano/linotype/news/110/Android Tech Demo -on-their-way-likely-by-2010/

Developing Secure Mobile Applications for Android droid_Apps.pdf Architectural manifesto: How to Choose a mobile platform