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.

Slides:



Advertisements
Similar presentations
Programming with Android: Network Operations
Advertisements

the Internet browser of choiceVidor ISD What is Internet Explorer? a Web browser* produced by the Microsoft Corporation *a software application used.
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Cosc 5/4730 Input Keyboard, touch, and Accelerometer.
Cosc 5/4730 Game Design. A short game design primer. A game or animation is built on an animation loop. – Instance variables of “objects” are updated.
A Large-Scale Study of Mobile Web App Security Patrick Mutchler, Adam Doupe, John Mitchell, Chris Kruegel, Giovanni Vigna.
Retrieving compound pages This work is licensed under a Creative Commons Attribution-Noncommercial- Share Alike 3.0 License. Skills: none IT concepts:
Cosc 5/4730 Game Design. A short game design primer. A game or animation is built on an animation loop. – Instance variables of “objects” are updated.
@2010 Mihail L. Sichitiu1 Android Introduction Hello Views Part 2.
Cosc 4755 Blackberry and Android Embedding the browser in your app.
What Is A Web Page? An Introduction to the Internet.
Cosc 4730 Android TabActivity and ListView. TabActivity A TabActivity allows for multiple “tabs”. – Each Tab is it’s own activity and the “root” activity.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 9: Customize! Navigating with a Master/Detail.
 Understanding an activity  Starting an activity  Passing information between activities  Understanding intents  Understanding the activity lifecycle.
JavaScript & jQuery the missing manual Chapter 11
CS378 - Mobile Computing Web - WebView and Web Services.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College
CSCI 6962: Server-side Design and Programming Introduction to AJAX.
Web Page Design I Retest Terms Review. 1. Web pages are created using a language known as ___________. The coding of this language must follow specific.
Cosc 5/4730 Introduction: Threads, Android Activities, and MVC.
Cosc 5/4730 Android Content Providers and Intents.
06/10/2015AJAX 1. 2 Introduction All material from AJAX – what is it? Traditional web pages and operation Examples of AJAX use Creating.
CS378 - Mobile Computing Web - WebView and Web Services.
JavaScript, Fourth Edition
Name: Read this page first. A web browser is software on your computer that lets you visit web pages. The address bar is a box in a web browser displaying.
Tabbed Views UITabBarController. Controller Architecture UITabBarController Controls the first view that the user sees The view controller class (and.
® IBM Software Group © 2006 IBM Corporation JSF Progress Bar This Learning Module shows how to integrate EGL/JSF functionality into a run-time progress.
Networking: Part 1 (Web Content). Networking with Android Android provides A full-featured web browser based on Chromium, the open source browser engine.
Cosc 4730 Android Fragments. Fragments You can think of a fragment as a modular section of an activity, which has its own lifecycle, receives its own.
AJAX Compiled from “AJAX Programming” [Sang Shin] (Asynchronous JavaScript and XML)
Web Development 101 Presented by John Valance
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,
1 3 Computing System Fundamentals 3.4 Networked Computer Systems.
CIS Intro to JAVA Lecture Notes Set July-05 GUI Programming – Home and reload buttons for the webbrowser, Applets.
The Module Road Map Assignment 1 Road Map We will look at… Internet / World Wide Web Aspects of their operation The role of clients and servers ASPX.
Web Design and Development. World Wide Web  World Wide Web (WWW or W3), collection of globally distributed text and multimedia documents and files 
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
Google App Engine Sessions and Cookies ae-09-session
How the Web Works Jenny Burson Courtesy of About Internet for Beginners Learn the Web
MIS 3200 – Unit 3.2 Page_Load method AutoPostBack property of controls IsPostBack method of the Page object Understanding web page life cycle.
Web Application in Android Ajay Babar. Contents 1.Introduction to Web Content 2. WebView widget I.What is webview. II. Properties(Methods) of Webview.
The Web Browser Button Game Click to play Click to play.
CSCI-235 Micro-Computers in Science The Internet and World Wide Web.
Web APIs By Behrooz and Corey mins... Punch It!! We will give a brief overview of the following topics: WebView WebSettings WebViewClient WebChromeClient.
Browser. What parts does the browser consist of? Title bar Menu bar Toolbar Address box Links.
AJAX – Asynchronous JavaScript And XML By Kranthi Kiran Nuthi CIS 764 Kansas State University.
Intro Web Applications Andrew Benson – ScottyLabs – CrashCourse F14.
© 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/4735 YouTube API. YouTube The YouTube Android Player API enables you to incorporate video playback functionality into your Android applications.
COSC 2328 – Web Programming.  PHP is a server scripting language  It’s widely-used and free  It’s an alternative to Microsoft’s ASP and Ruby  PHP.
JavaScript, Third Edition 1 SELECTION LIST Demo. JavaScript, Third Edition 2 Description This web page will edit the slection to ensure an option was.
WebViews UIWebView. Controller Architecture UITabBarController Controls the first view that the user sees The view controller class (and xib) that manages.
Cosc 5/4730 Support design library. Support Design library Adds (API 9+) back support to a number of 5.0 lollipop widgets and material design pieces –
Page Redirection When you click a URL to reach to a page X but internally you are directed to another page Y that simply happens because of page re- direction.
WebView and JavaScript
Google VR (gvr) CardBoard and DayDream With OpenGL
Android Programming - Features
Android Application Web 1.
Not a Language but a series of techniques
Data Virtualization Tutorial… CORS and CIS
WebView and Web Services
Android Programming Lecture 9
Directions for creating a PowerPoint
Left Click to view the next slide.
Browser Engine How it works…..
Your computer is the client
Introduction to JavaScript
CIS 136 Building Mobile Apps
An Introduction to the Internet
Presentation transcript:

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 your “Company Name” on it – The company web server can now serve all the contain needed. Almost never have to update the app with new stuff. But the company web server, must serve the data that is in the “size of the screen”.

Browser object Android webkit – android.webkit WebView, a simple but very powerful widget

Android webkit In the simplest form – Put a WebView Widget in the layout – If you want javascript enabled mWebView. getSettings().setJavaScriptEnabled(true); – Now load a page mWebView.loadUrl(" In androidManifest.xml, you need to request permission to use the internet. – Add this

Android webkit (2) How to handle everything else. – In the previous slide, if a use clicks on a link, the android browser will now open and you app is paused. To better control the browser you extend the WebViewClient class – Then add that to the WebView mWebView.setWebViewClient(new myWebViewClient());

WebViewClient This controls the functions and gives you app’s notifications about what is going on. – boolean shouldOverrideUrlLoading(WebView view, String url) Give the host application a chance to take over the control when a new url is about to be loaded in the current WebView. – return true, if handled, otherwise false. – onReceivedError(WebView view, int errorCode, String description, String failingUrl) Report an error to the host application. – Other that maybe useful onPageStarted, onPageFinished, onReceivedSslError, shouldOverrideKeyEvent, onUnhandledKeyEvent

WebViewClient Example private class CallBack extends WebViewClient { public boolean shouldOverrideUrlLoading(WebView view, String url) { browser.loadUrl(url); return true; } I’ve only overriding one method, since I wanted to prevent the web browser from launching.

WebView methods reload(), which refreshes the page goBack(), which goes back one step in the browser history – canGoBack() returns true if there is at least one step back in the history goForward(), which goes forward one step in the browser history – canGoForward(), returns true if you can. ZoomIn(), ZoomOut(), stopLoading(), clearcache() and clearHistory() just to name a few.

WebViewClient example 2 //continuing the example, we add a keylistener to handle the back public boolean onKeyDown(int keyCode, KeyEvent event) { if ((keyCode == KeyEvent.KEYCODE_BACK) && mWebView.canGoBack()) { mWebView.goBack(); return true; } return super.onKeyDown(keyCode, event); } We can also create buttons, for refresh, forward, and back. – Even a progress bar using the getProgress() method in WebView.

The Rest Cache – CacheManager and CacheManger.CacheResult gives you access in the browser cache system Cookies – CookieManager and CookieSyncManger gives you access to the cookies WebSettings – Gives you access to dozens of settings, including – To enable the built-in zoom, set WebSettings.setBuiltInZoomControls(boolean) – Change the UserAgentString – This is also where the javascript settings are as well. – Can use mWebView.getSettings() which returns a WebSettings object which can be used to control the settings.

Q A &