Transcription

2/25/21MOBILE COMPUTINGCSE 40814/60814Spring 2021Cloud Computing Delivery of computing services servers storage analytics databases networking and much more. Another definition: network-based computing taking placeover the Internet, while hiding complexity of underlyinginfrastructure using simple APIs1

2/25/21Cloud Computing Collection/group of integrated and networked hardware,software, and Internet infrastructure (called a platform) Platforms provide on demand services that are alwayson and accessible anytime and anywhere Advantages: new applications; anytime/anywhereaccess; homogeneity; virtualization; resilient; cost;sharing; collaboration; maintenance; security; Cloud Models2

2/25/21DefinitionsVirtualization: creation of a virtual resource such as aserver, desktop, operating system, file, storage, ornetwork Middleware: software that acts as a bridge between anoperating system or database and applications, especiallyon a network Runtime: software designed to support the execution ofcomputer programs IaaS, PaaS, SaaS Simple example: IaaS: barebones computer PaaS: computer OS (incl. development environment) SaaS: complete solution including application(s)3

2/25/21Cloud Example: S3Amazon Simple Storage Service (S3) Unlimited storage Pay for what you use Cloud Example: EC2 Amazon Elastic Compute Cloud (EC2) Virtual computing environments (“instances”) Pre-configured templates for instances Launch as many virtual servers as needed (“elastic”) Xen and KVM hypervisor4

2/25/21Other ExamplesMobile Apps & Cloud Computing “Information at your fingertips anywhere and anytime” Mobile Cloud Computing (MCC) Infrastructure where both the data storage and dataprocessing happen outside of the mobile device5

2/25/21Mobile Cloud Computing – Why? Limited mobile resources Battery, storage, processing, network, Consider tradeoffs! Permanent storage Backup (reliability), long-term storage, anywhere access(availability) Data sharing Social media, sensor data, collaboration, producer-consumer, Mobile Cloud Computing Mobile cloud applications move the computing power and datastorage away from the mobile devices and into powerful andcentralized computing platforms located in clouds, which arethen accessed over the wireless connection based on a thinnative clientMOBILE CLOUD COMPUTING MOBILE COMPUTING CLOUD COMPUTING6

2/25/21“Backend” No clear definition of backendFrontend – mobile device user interfaceBackend - data, server, programs the user does notinteract with directlyBackend as a Service (Baas)Sometimes MBaaS (M for mobile)Definition of MBaaS Provide web and mobile app developers with a way to connect theirapplications to backend cloud storage and processing while alsoproviding common features such as user management, pushnotifications, social networking integration, and other features thatmobile users demand from their apps these daysSeamless IntegrationRule PlatformBaaS helps reduce time-to-market.Implement with 50% less effortOffline & Server Side rules toestablish standard operatingprocedures as well as ensurecomplianceTechnologyLow Memory footprint basedplatforms to support trulyasynchronous operations withsignificant flexibilityEnhanced SemanticsIdentity federation through Oauth toextract data from external platformsfor augmented informationApp SecuritymBaaS features, ensuresapplication and data securitymBaaSNotificationsMulti Channel notificationsthrough push, SMS, email acrossdevices and 't bedisplayed.Data SynchronizationmBaaS provides End – to – Enddata sync framework, this ensuresuser always has latest dataavailable on mobile ApplicationReady Made AppsKick start your customer mobilityjourney using ready made apps.7

2/25/21MBaaS – Focus on Frontend!Advantages for Developer Efficiency gains: reducing the development cost, developmenttime and maintenance cost Faster Time To Market: reduce obstacles from idea toproduction and operations overhead. Optimized for Mobile and Tablets: optimization of data andnetwork for mobile apps, and lower fragmentation problems acrossmultiple platforms and devices. Secure & Scalable: bundled infrastructure that deals withscalability, security, performance and other operational headaches. Handle App Growth & Maintenance: brings common andessential 3rd party API resources into a single stack, preventingdevelopers from having to go gather them separately.8

2/25/21MBaaS ProvidersExample: back4app (parse.com) Founded in 2011Acquired by Facebook in 2013More than 500,000 apps in 2014Shut down January 2017Made code open-sourceMany replacements, including self-hostedBack4app.com9

2/25/21Back4appwww.back4app.com iOS: http://docs.back4app.com/docs/ios/ Android: http://docs.back4app.com/docs/android/ Cloud Code: http://docs.back4app.com/docs/integrations/ Cloud Code (main.js)Parse.Cloud.define("notify", function (request, response) {Parse.Push.send({channels: request.params.channels,data: {alert: request.params.message}}, {success: function ({response.success('Success! ' request.params.message);},error: function (error) {response.error('Error! ' error.message);},useMasterKey: true,});});10

2/25/21Cloud Code (main.js)Parse.Cloud.define("notify2", function (request, response) {var pushQuery new 'user', request.params.receiver);Parse.Push.send({where: pushQuery,data: {alert: request.params.message}}, {success: function () {response.success('Success! ' request.params.message);},error: function (error) {response.error('Error! ' error.message);},useMasterKey: true,});});iOS Code[PFCloud :@{@"channels": @[username],@"message": message}block: (NSString *success, NSError *error) {if (!error) {NSLog(@”Success (%@)!”, success);} else {NSLog(@”Fail!”);];}}11

2/25/21iOS Code[PFCloud @{@"receiver": someUser.objectId,@"message": message}block: (NSString *success, NSError *error) {if (!error) {NSLog(@”Success (%@)!”, success);} else {NSLog(@”Fail!”);];}}Configure Mobile AppiOS: http://docs.back4app.com/docs/ios/quickstart/ Android: an-android-app-on-back4app/ 12

2/25/21Parse/Back4app DashboardMore Parse/Back4app Includes capability to do local data store Save objects on device, save to cloud later Abstracts away a lot of the details Store/fetch objects in background if possible: Make sure to keep app consistent Provide progress feedback for user Parse objects are meant to be "small” Less than 128Kb Parse files for large pieces of data13

2/25/21Firebase Yet another Backend as a Service (BaaS): Firebase is a real-time cloud data service. Firebase database isstored as JSON and synchronized in real time to every connectedclient. When you build cross-platform apps with our Android, iOS,and JavaScript SDKs, all of your clients share one Firebasedatabase and automatically receive updates with the newestdataDesigned for web and mobile Founded in 2011 Initial product was backend so websites could easily hostchat as part of site Discovered developers were sending non chat data(such as game state) via the tool FirebaseCreate Firebase project in console Just needs name and country 14

2/25/21Firebase After creating project, overview page:Firebase15

2/25/21FirebaseAfter providing package name and SHA-1 fingerprint . Firebase generates a JSON file named googleservices.json specific for this project multiple projects / apps - repeat stepsDownload and add file to project Update gradle file FirebaseDocumentation: https://firebase.google.com/docs/?authuser 0 Capabilities: User authorization Database storage Storage for larger files Cloud messaging Push notifications Analytics Hosting of web content 16

2/25/21Alternatives https://github.com/relatedcode/ParseAlternatives17

2/25/21Choosing a MBaaS Ease of Use (Parse, Back4app)Automated updates (Firebase)Analytics (User data, Crashes)Authentication (including social media integration)App/Database managementPush notificationsCloud code, background jobsSystem emails (password reset, verification)Variety of APIs (iOS, Android, REST)Firebase & Flutterhttps://firebase.flutter.dev/docs/overview/ utterfirebase#0 https://firebase.flutter.dev/docs/firestore/usage/ Cloud Firestore is Firebase's newest database for mobile appdevelopment. It builds on the successes of the RealtimeDatabase with a new, more intuitive data model. CloudFirestore also features richer, faster queries and scales furtherthan the Realtime Database. Realtime Database is Firebase's original database. It's anefficient, low-latency solution for mobile apps that requiresynced states across clients in realtime.18

2/25/2119

Mobile Cloud Computing Mobile cloud applications move the computing power and data storage away from the mobile devices and into powerful and centralized computing platforms located in clouds, which are then accessed over the wireless connection based on a thin native client MOBILE CLOUD COMPUTING MOB