Terry Ryan | EvangelistBuilding ColdFusion Powered Mobile ApplicationsDeveloper Week	June 20 – June 24, 2011
AssumptionsYou know a little ColdFusionYou know a little FlexYou know what AIR isYou’ve heard about AIR on Mobile Devices2
What is this about?“Building ColdFusion Powered Mobile Applications”More specificallyColdFusion support for data in mobile apps.3
Review4
ColdFusion - Do you know what a CFC is?ColdFusion ComponentCollection of FunctionsFunctionsHave “Scope” remote, public, package, and privateRemote means accessible to the world remotely through a webserviceRemote AccessPlain TextWDDXJSONAMF or Flash Remoting5
Flex – Do you know what a remote object is?RemoteObjectRemote Server callUses AMFAMFClient requests dataServer converts from server objects to ActionScript objects Server transmits binary objects to requesting client 6
Mobile Apps = AIR7
AIR for Devicesapp.barapp.apkapp.ipa
AIR and SQLiteAIR uses SQLite for offline data accessSQLite is tiny footprint databaseUsed in Native IOSNative Android9
Application We are buildingStaff information for my immediate team1 tablePerson information10
Demo – Backend Code11
Approaches to Mobile DataMobile only (Not Covered)Network OnlyRead only cacheSync-able  cache12
Network OnlyBackend Server has databaseUser requests dataMobile App requests dataMobile App presents it directly to user13
Network Only14RemoteObjectService
Demo – Network Only15
Network OnlyProsEasy to writeSimple AppsConsGood ForDemo appsProof of Concepts Stale data worse then no data Have to be connected to networkNo interactivityTake awayYou just turned your app in to a dumbed down browser
Read Only CacheBackend Server has databaseMobile App has databaseUser requests dataMobile app presents data from its databaseMobile App requests dataMobile App overwrites all its data. 17
Read Only Cache18DAOServiceRemoteObject
Demo – Read Only Cache19
Read only CacheProsModerately easy  to writeAllows offline accessConsGood ForConsumption appsStop gap appNo interactivity Take awaysBetter then network onlyStill limitedMight be right for your users
Synch-able CacheBackend Server has databaseMobile App has databaseUser requests/alters dataMobile app presents/alters data from/for its databaseMobile App synchs all its data. Mobile app and server manage conflicts21
CF AIR Synch ColdFusion 9 Introduced AIR Offline supportYou write a sychmanager that matched ISynchmanager interfaceYou include cfair.swc in your Flex22
Synch-able Cache23MainSynchManagerService
Demo – Synch-able Cache24
Synch-able CacheProsThis is a real appMuch easier then writing all of that codeConsGood ForReal apps So complex to write, simplified version is still complexCode is obscured Take awaysMight work for youStill might have to roll your own
Tips26
Sometimes you have to manually castDAOCFAIR Synch27
Watch out for circular referencesORM with relationshipsCopy ColdFusion ORM and remove relationships28
App should only present localAll app data should be displayed from localApp should only synch to server29
Prepare databasesShip apps with prepopulated databases30
Use Asynchronous Database callsLittle harder then you are used toBut allows for responsive apps.31
32Download		adobe.com/go/try_flashbuilderadobe.com/go/coldfusionLearn	adobe.com/devnet/flexadobe.com/devnet/coldfusion
33Codehttp://bitly.com/bundles/tpryan/2
Mobile Apps with ColdFusion

Mobile Apps with ColdFusion

Editor's Notes

  • #9 You develop with AIR but it creates an apk file that is distributable on any market. It requires the AIR runtime, but makes it easy for someone to get if they need it.