CSC 581: Mobile App Development

Slides:



Advertisements
Similar presentations
1 FrontPage 2000 Online Tutorial The following tutorial aims to help you get started with FrontPage 2000 for the creation of basic web pages. The different.
Advertisements

1 Mobile Computing Mobile First (formerly Worklight) Copyright 2015 by Janson Industries.
1 Agenda Overview Review Roles Lists Libraries Columns.
Android 4: Creating Contents Kirk Scott 1. Outline 4.1 Planning Contents 4.2 GIMP and Free Sound Recorder 4.3 Using FlashCardMaker to Create an XML File.
Creation of hybrid portlet application for file download using IBM Worklight and IBM Rational Application Developer v9 Gaurav Bhattacharjee Lakshmi Priya.
 jQuery Mobile An Introduction. What is jQuery Mobile  A framework built on top of jQuery, used for creating mobile web applications  Designed to make.
Social Media Apps Programming Min-Yuh Day, Ph.D. Assistant Professor Department of Information Management Tamkang University
HTML 5 New Standardization of HTML. I NTRODUCTION HTML5 is The New HTML Standard, New Elements New Attributes Full CSS3 Support Video and Audio 2D/3D.
Making an HTML Document Notepad Group Bo Kim Dan Carter Han Chong Justin Weaver Kris Lamont.
ULI101 – XHTML Basics (Part II) What is Markup Language? XHTML vs. HTML General XHTML Rules Block Level XHTML Tags XHTML Validation.
DUE Hello World on the Android Platform.
PACS - 09/19/15 1 favicon A ‘Favorite icon’ is a file containing one or more small icons associated with a particular website or web page. Web browsers.
HTML5 for Mobile Andrew Kinai. HTML vs HTML5 HTML:A language that describes documents' formatting and content, which is basically composed of static text.
Mobile web Sebastian Lopienski IT Technical Forum 29 June 2012.
Trunica Inc. 500 East Kennedy Blvd #300 Tampa, FL Cross Platform Mobile Apps With Cordova and Visual Studio 2015 © Copyright 2015.
Perfecto Mobile Automation
Paragon The Platform and Message Broker. Paragon: The Platform Stack -Window Management -Messaging -App Lifecycle Management -App Store -Workspaces -Storage.
丁建文 國立高雄應用科大資管系副教授 兼任計網中心軟體發展組組長 跨平台行動應用軟體開發技術 : HTML5 & Mobile JavaScript Framework 暨南大學.
COMP 143 Web Development with Adobe Dreamweaver CC.
© ExplorNet’s Centers for Quality Teaching and Learning 1 Describe applications and services. Objective Course Weight 5%
CHAPTER 7 Operating System Copyright © Cengage Learning. All rights reserved.
How to Enable Account Key Sign Instead Of Password In Yahoo? For more details:
Basic concepts of web design
DISCOVERING COMPUTERS 2018 Digital Technology, Data, and Devices
Software OCR Cambridge Nationals in ICT Level 1/2 © Hodder & Stoughton 2013.
HTML5 Basics.
Development Environment
Web Concepts Lesson 2 ITBS2203 E-Commerce for IT.
Make your website (a bit) offline
The world’s most advanced mobile platform
Browsers and Web Platforms
With Microsoft FrontPage 2000
Computing.
HTML 5 By Michael Hurley.
Eform Generator.
EBSCO eBooks.
Apache Cordova Overview
Tutorial 6 Topic: jQuery and jQuery Mobile Li Xu
Directions: GO THROUGH THE FOLLWING SLIDES. Make sure you have quizlet cards for all the vocabulary. Study the terms.
TOLL FREE The Firefox Developer Edition Tech Support Toll Free.
Introduction With TimeCard users can tag SharePoint events with information that converts them into time sheets. This way they can report.
How to register and use the app for Law Enforcement users?
Chapter: 2 Diving into Mobile: App or Website?
How to register and use ODMAP for Fire/EMS and other partners
Microsoft Build /19/2018 7:06 PM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY,
RR RR Problems Along With Solutions For iPhone And iPad Toll Free ( )
Myth Busting: Hosted Web Apps
Testing REST IPA using POSTMAN
Playing Audio (Part 1).
intro to notifications in iOS 10
Directions: GO THROUGH THE FOLLWING SLIDES. Make sure you have quizlet cards for all the vocabulary. Study the terms GCFLearnFree website “Computer Basics”:
Myth Busting: Top 5 Web App Myths
Introduction to Web Page Design
Using K2 applications How can users interact with K2 applications?
Lesson 9: GUI HTML Editors and Mobile Web Sites
Teaching slides Chapter 6.
How to Improve Releasing Efficiency via i18N/L10n Test Automation.
SEEM4570 Tutorial 5: jQuery + jQuery Mobile
Download from Zotero Home Page
Introduction to Web Application Design
RESTful Web Services.
Scripts In Matlab.
Digital Literacy 1.00 Computer Basics
Introduction to Programming and JavaScript
CSC 581: Mobile App Development
Carthage ios 8 onwards Dependency manager that streamlines the process of integrating the libraries into the project.
Escaping tabs with progressive web apps
Report from the trenches of an HTML5 game provider
Chloe Riley | Research Commons Librarian |
Presentation transcript:

CSC 581: Mobile App Development Spring 2019 Progressive Web Apps saving Web pages to iOS home screen icon manifest file service worker PWA vs. native tradeoffs

Web vs. App development developing a Web page is generally much simpler than a native app does not require development tools – can create using a simple text editor HTML/CSS/JavaScript are easy to pick up (and lots of online support) PWAs can run on all platforms (so no need for separate iOS & Android apps) the user does not have to download an app, no app store required <!doctype html> <html> <head> <title>Executive Decision Maker</title> <script> function showAnswer() { var responses = ["YES", "NO", "MAYBE"]; var index = Math.floor(Math.random()*responses.length); document.getElementById("outputDiv").innerHTML = responses[index]; } </script> </head> <body> <h1>Executive Decision Maker</h1> <p>Enter your question: <input type="text" size=40></p> <p><input type=button value="Get Answer" onclick="showAnswer()"></p> <div id="outputDiv" style="color:red"></div> </body> </html> simple Web page for an executive decision maker

Pseudo-apps however, a Web page in a browser is not as convenient as an app e.g., an app has an icon on the home screen, so easier to find and access iOS does allow you to save a Web page on the home screen essentially, creates a pseudo-app that looks like other apps (but is actually the Web page in a browser window) load the page in Safari (or Chrome) click on the Share icon and select "Add to Home Screen" this puts a pseudo-app on the screen its icon is a screen shot of the Web page when you click on the icon, it opens the page in a browser window since pseudo-apps are just Web pages viewed in the browser they can't access any of the native phone features (sensors, GPS, photos, …) they can't work when offline or save their state if closed or interrupted

Progressive Web App a PWA is a Web page with supporting files that allows it to specify its icon image provide information as to how the page is to be displayed (manifest file) provide code so that it works offline and can save app data (service worker) can also access device sensors, native features, push notices, … recall: PWAs were the 3rd-party dev. model initially envisioned by Apple 3rd-party native apps & the App Store were added with Phone OS 2 as of 2018, all major mobile Web browsers support PWAs PWAs are not enthusiastically supported by Apple Apple wants to control app quality/security through the App Store approval process PWAs do not need to be downloaded through the App Store – can link directly to a Web site and download the PWA without Apple intervention many PWA developers will still post them to the App Store for visibility

Executive Decision Maker PWA we can transform our simple Web page to a PWA by adding resources (here, organized in a PWAsupport folder) <!doctype html> <html> <head> <title>Executive Decision Maker</title> <link rel="apple-touch-icon" sizes="1024x1024" href="PWAsupport/icon-1024.png"> <link rel="manifest" href="PWAsupport/manifest.json"> <script src="PWAsupport/app.js"></script> <script> function showAnswer() { var responses = ["YES", "NO", "MAYBE"]; var index = Math.floor(Math.random()*responses.length); document.getElementById("outputDiv").innerHTML = responses[index]; } </script> </head> <body> <h1>Executive Decision Maker</h1> <p>Enter your question: <input type="text" size=40></p> <p><input type=button value="Get Answer" onclick="showAnswer()"></p> <div id="outputDiv" style="color:red"></div> </body> </html>

Manifest file the manifest file (usually a .json file), contains info about the app may include PWA name, title, author, default style settings, icons, … used by the browser to make the PWA look like an actual app for this example, manifest.json: { "name": "Executive Decision Maker", "short_name": "Decider", "start_url": "../DeciderPWA.html", "display": "standalone", "orientation": "portrait", "lang": "en-US" }

Service worker a service worker acts a proxy for the Web server if it is unavailable e.g., if the phone is offline, the service worker can restore the PWA to its last saved state and run from that can also allow access to push notifications and some native APIs // serviceWorker.js ////////////////////////////////////////////////////////////////////////////////////////// var cacheName ='version: 1.0.0'; var cacheFiles = [ '../DeciderPWA.html', './app.js', './serviceWorker.js', './manifest.json', './icon-1024.png' ] self.addEventListener('install', function(e) { console.log('[Service Worker] Installed'); e.waitUntil( caches.open(cacheName).then(function(cache) { console.log('[Service Worker] Caching cacheFiles'); return cache.addAll(cacheFiles); }) ); }); self.addEventListener('activate', function(e) { console.log('[Service Worker] Activated'); e.waitUntil(caches.keys().then(function(cacheNames){ return Promise.all(cacheNames.map(function(thisCacheName){ if(thisCacheName != cacheName){ console.log('[Service Worker] Removing Cached Files from Cache- ', thisCacheName); return caches.delete(thisCacheName); } })) }) ); }) self.addEventListener('fetch', function(e) { console.log('[ServiceWorker] Fetch', e.request.url); e.respondWith( . . .

Registering a service worker a service worker must be registered with the browser this is done the first time the PWA is loaded, again every 24 hours to keep current for our PWA, the app.js script is run by the page to register serviceWorker.js // app.js //////////////////////////////////////////////////////////// if ('serviceWorker' in navigator) { navigator.serviceWorker .register('serviceWorker.js') .then(function(registration) { console.log("[Service Worker] Registered"); }) .catch(function(err) { console.log("[Service Worker] Failed to Register", err); }

Downloading a PWA the PWA page and supporting resources must be stored together when you load the page into your mobile browser and Add to Home Screen, it downloads the supporting resources along with the page will use the specified image for the PWA icon will display the page using the style settings in manifest.json will register the service worker via the app.js script will provide the proxy and API services of serviceWorker.js since PWAs are running through the browser, they are platform independent the same PWA can run on an Android device or an iOS device HUGE ADVANTAGE OVER NATIVE DEVELOPMENT! tradeoff: PWAs do not have the full range of native features may not have same look & feel, or be as responsive as native apps

Popular PWAs

Questions Describe in what ways a Progressive Web App is similar to a Web page. Describe how it is different. Describe in what ways a Progressive Web App is similar to a mobile app. Describe how it is different. What role does the manifest file play in a Progressive Web App? What role does the service worker play? After reading about PWAs and their advantages and disadvantages, do you believe that PWAs will grow in popularity, replacing native apps for many tasks? Explain your answer.