Web APIs By Behrooz and Corey 1. 10 mins... Punch It!! We will give a brief overview of the following topics: WebView WebSettings WebViewClient WebChromeClient.

Slides:



Advertisements
Similar presentations
Google Android Introduction to Mobile Computing. Android is part of the build a better phone process Open Handset Alliance produces Android Comprises.
Advertisements

Programming with Android: Network Operations
Molecular Biomedical Informatics Web Programming 1.
Automated Marking System (AMS) Joseph Heron, Jonathan Gillett, Khalil Fazal, Daniel Smullen.
Developing downloadable mobile apps using HTML5 and PhoneGap Apache Callback Ron Perry, CTO, Worklight Inc.
Java Applets:. How Applets differ from application?: They do not use main method but init(), start() and paint() methods of the applet class They can.
A Blackboard Building Block™ Crash Course for Web Developers
Mobile App Development Using: Presented by Tyler Richey Images from
The Web Warrior Guide to Web Design Technologies
Manifest File, Intents, and Multiple Activities. Manifest File.
Cosc 4755 Blackberry and Android Embedding the browser in your app.
Security of Mobile Applications Vitaly Shmatikov CS 6431.
Hello Vaadin! CS 3130 Summer 2015.
Platform Independent Frameworks Contents Mobile App Developer’s challenges Platform Independent solutions – Mobile Web Based Apps – Cross.
Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department.
IST346:  Web Services. Today’s Agenda  Learn the basics of how the Web works  Understand various web service architectures  Address scaling, security,
The PhoneGap History Doncho Minkov Telerik Academy academy.telerik.com Technical Trainer
Intelligent Tutoring System Mobile Communication Team Drew Boatwright Nakul Dureja Richard Liou.
Chapter 6 DOJO TOOLKITS. Objectives Discuss XML DOM Discuss JSON Discuss Ajax Response in XML, HTML, JSON, and Other Data Type.
Creation of hybrid portlet application for file download using IBM Worklight and IBM Rational Application Developer v9 Gaurav Bhattacharjee Lakshmi Priya.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Forms, Validation Week 7 INFM 603. Announcements Try placing today’s example in htdocs (XAMPP). This will allow you to execute examples that rely on PHP.
Presented by…. Group 2 1. Programming language 2Introduction.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 9: Customize! Navigating with a Master/Detail.
CSCI 323 – Web Development Chapter 1 - Setting the Scene We’re going to move through the first few chapters pretty quick since they are a review for most.
4.1 JavaScript Introduction
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
Lightning Talk Fred Rodriguez Nguyen Do CPSC 473 May 6, 2012.
Title slide to be used at the start of a module. Developing Mobile Apps Roland Guijt
CS378 - Mobile Computing Web - WebView and Web Services.
Introducing NativeScript [Pavel Kolev Software Telerik: a Progress company]
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
CS378 - Mobile Computing Web - WebView and Web Services.
Android for Java Developers Denver Java Users Group Jan 11, Mike
DEV-5: Introduction to WebSpeed ® Stephen Ferguson Sr. Training Program Manager.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Networking: Part 1 (Web Content). Networking with Android Android provides A full-featured web browser based on Chromium, the open source browser engine.
Java Web Development with NetBeans IDE -- Kai Qian Chapter 5 JavaServer Faces (JSF) Technology.
2011/12/20 1 Tongbo Luo, Hao Hao, Wenliang Du, Yifei Wang, and Heng Yin Syracuse University ACSAC 2011.
Mobile web Sebastian Lopienski IT Technical Forum 29 June 2012.
Inclusive Education Planning Tool IEPT3 Technical Brief Presented by: Kim Brockhoff, Paul Redman & Catherine Walker.
Webview and Web services. Web Apps You can make your web content available to users in two ways in a traditional web browser in an Android application,
Apache Cordova Tools in Visual Studio
The way of hybrid mobile development Hybrid Mobile Applications Telerik Software Academy
 Phone Gap is a mobile application development frame work based upon the open source apache cordova project. Developed by Nitobi software Bought by Adobe.
JS (Java Servlets). Internet evolution [1] The internet Internet started of as a static content dispersal and delivery mechanism, where files residing.
Lecy ∙ Data-Driven Management Lecture 12 Building Shiny Apps.
Recap of Part 1 Terminology Windows FormsAndroidMVP FormActivityView? ControlViewView? ?ServiceModel? Activities Views / ViewGroups Intents Services.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
Cosc 5/4730 Embedding the browser in your app. Embedding the browser For many applications, you may not nothing more then the web browser – But you want.
1 Android Workshop Platform Overview. 2 What is Android?  Android is a software stack for mobile devices that includes an operating system, middleware.
Intents and Broadcast Receivers Dr. David Janzen Except as otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution.
跨平台 Hybrid App 開發簡介 - 使用 Visual Studio Tool for Apache Cordova + HTML/JavaScript 陳葵懋 (Ian)
WebView and JavaScript
Mobile App Development Using:
ET-570 Smart Phone Apps.
Android Application -Architecture.
Android Application Web 1.
Ad-blocker circumvention System
Office 365 Development July 2014.
WebView and Web Services
Apache Cordova Overview
CMPE419 Mobile Application Development
The Application Lifecycle
Phonegap Bridge Configuration file
Office 365 Development.
Back end Development CS Programming Languages for Web Applications
CMPE419 Mobile Application Development
Back end Development CS Programming Languages for Web Applications
Presentation transcript:

Web APIs By Behrooz and Corey 1

10 mins... Punch It!! We will give a brief overview of the following topics: WebView WebSettings WebViewClient WebChromeClient Cross Platform Web Apps (if time permits) 2

Do you want a browser?? Sometimes you may want a full blown browser…if so, these aren’t the droids you’re looking for!! Just invoke a browser app with a URL Intent instead: Uri uri = Uri.parse(" Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent); You can return to your app using the back button 3

WebView Basic view for rendering HTML Requires INTERNET permission in manifest file Content source: web, local storage, generated HTML Default WebView does not provide any widgets, JS or error handling. It must be customized to meet your specific need. But, if you do use it for JS or plugins…please handle onPause and onResume as good practice Each app has it's own cache (use clearCache) Always keep security in mind when modifying WebView settings and behavior 4

WebSettings Object encapsulating WebView state/settings Settings object acquired via WebView.getSettings tied to life of referenced WebView Of interest: setSupportZoom setAppCacheEnabled setJavaScriptEnabled setAllowFileAccessFromFileURLs setAllowUniversalAccessFromFileURLs (try to avoid using this) 5

WebViewClient Helper class for WebView rendering control and event handling (like form submissions, URL loading and errors) Defines and provides avenue for responding to all WebView errors (onReceivedError) Allows response to HTTP or SSL errors (onReceived*Error) 6

WebChromeClient Helper class for various browser UI events like progress updates, JS alerts etc... onShowFileChooser tells client to show file chooser to handle HTML forms with file input. Added in Lollipop(21). Previous versions of Android had undocumented hack for file uploads which was removed in Kitkat(19). Between WebView, WebViewClient and WebChromeClient you have a large array of tools for building web responsive apps 7

8 // Display the progress in the activity title bar getWindow().requestFeature(Window.FEATURE_PROGRESS); webview.getSettings().setJavaScriptEnabled(true); final Activity activity = this; webview.setWebChromeClient(new WebChromeClient() { public void onProgressChanged(WebView view, int prog) { // Insert code to update activity progress bar } }); webview.setWebViewClient(new WebViewClient() { public void onReceivedError(WebView view, int errCode, String descr, String faildUrl) { Toast.makeText(activity, "Oh no!" + descr, Toast.LENGTH_SHORT).show(); } }); webview.loadUrl("

Cross platform applications Using the Web APIs it is possible to set up a 2-way bridge between Java and JS Allowing JS to run Java native code and vise versa addJavaScriptInterface and onJsPrompt Allows for building hybrid web apps that are platform independent There are 3rd party frameworks for this like Apache Cordova 9