Android Application Web 1.

Slides:



Advertisements
Similar presentations
Introduction to MVC Adding a View Page NTPCUG Tom Perkins, Ph.D.
Advertisements

Explore the Dreamweaver Workspace View a Web page and use Help Plan and Define a Web site Add a Folder and Pages, and set the Home page Create and View.
Cosc 4755 Blackberry and Android Embedding the browser in your app.
1 of 6 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
-Uday Dhokale.  What is it ??? Prototype is a JavaScript Framework that aims to ease development of dynamic web applications.  Features a unique, easy-to-use.
CHAPTER 3&4 ZHONGWEI LI TouchDevelop Book. What are we covering Review of Chapter 1-2 TouchDevelop as a scripting language: actions, events, table and.
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.
CS378 - Mobile Computing Web - WebView and Web Services.
Lesson 1: Web Pages Web Browsers. Linear media & Hypermedia Books are presented in a linear format. Pages and chapters comprise a book. You can create.
CS378 - Mobile Computing Web - WebView and Web Services.
1 Tradedoubler & Mobile Mobile web & app tracking technical overview.
Adobe Certified Associate Objectives 6 Evaluating and Maintaining a site.
A Basic Web Page. Chapter 2 Objectives HTML tags and elements Create a simple Web Page XHTML Line breaks and Paragraph divisions Basic HTML elements.
Enabling High-Quality Printing in Web Applications
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Networking: Part 1 (Web Content). Networking with Android Android provides A full-featured web browser based on Chromium, the open source browser engine.
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,
CPT 499 Internet Skills for Educators Session Three Class Notes.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
Web Design and Development. World Wide Web  World Wide Web (WWW or W3), collection of globally distributed text and multimedia documents and files 
WStore Programmer Guide Offering management integration.
ICM – API Server & Forms Gary Ratcliffe.
Getting Started. Package Overview (GradeQuick)‏ Web-based grade book –Access Anywhere –Always Current Paper grade book “look and feel” Flexible grading.
Users are moving towards web applications Content on the web is more personal & meaningful Development on the web is easier than the OS.
© 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.
COMP 143 Web Development with Adobe Dreamweaver CC.
WStore Programmer Guide Resources management integration.
WebViews UIWebView. Controller Architecture UITabBarController Controls the first view that the user sees The view controller class (and xib) that manages.
Lesson 11: Web Services and API's
REDCap Mobile Application
Progress Apama Fundamentals
Amazon Web Services (aws)
IS1500: Introduction to Web Development
The Client-Server Model
CISC103 Web Development Basics: Web site:
Section 13 - Integrating with Third Party Tools
Kodak - Social On Demand
Cosc 5/4730 REST services.
WebView and Web Services
EBSCO eBooks.
DCR ARB Presentation Team 5: Tour Conductor.
Lesson 11: Web Services & API's
Task Management System (TMS)
PHP / MySQL Introduction
Persistence - Web Based Storage
SharePoint-Hosted Apps and JavaScript
Yahoo! Social APIs Sophie Major Nagesh Susarla
Testing REST IPA using POSTMAN
Windows Internet Explorer 7-Illustrated Essentials
(Advanced) Web Application Development
Browser Engine How it works…..
Office 365 Development.
Tutorial Using the App help.ebsco.com.
Agenda OAuth Concepts Programming OAuth.
CS323 Android Topics Network Basics for an Android App
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
Lesson 11: Web Services and API's
Steps in accessing E-books (Ebrary, Taylor & Francis)
Use an Internet Browser
Adding , Editing, and Assigning Full Text Finder Links
Bryan Burlingame 24 April 2019
Slides prepared by Sarah Benis Scheier-Dolberg
Client-Server Model: Requesting a Web Page
The Web Wizard’s Guide To JavaScript
CIS 136 Building Mobile Apps
Retrieving compound pages
Murach's JavaScript and jQuery (3rd Ed.)
Presentation transcript:

Android Application Web 1

Using Built In Browser To simply use the built in browser create an Intent and start the Activity

WebView A View that display web pages Uses WebKit rendering engine basis for creating your own web browser OR just display some online content inside of your Activity Uses WebKit rendering engine http://www.webkit.org/

WebView Built in functions: display page navigate forward and backwards through a history zoom in and out perform searches and more. some examples: capture images of page, search page for string, deal with cookies on a per application basis,

WebView Scenarios for using WebView in app instead of built in browser: provide info the app might need to update such as end user agreement or user guide (instead of doing app update) display documents hosted online OR application provides data that ALWAYS requires internet connect to retrieve data as opposed to performing network request and parsing data to display in Android layout http://developer.android.com/guide/webapps/webview.html

WebView Example Simple app to view and navigate web pages - demo WebView class res/layout/main.xml

WebView Activity override onCreate go to mobile site cuhk.edu.hk

WebView Example Must add permission for app to use Internet Also change style so no title bar

Current Result Clicking link actually leads to the default Android browser

Handling URL Requests in webview When the user clicks a link in your WebView, the default behavior is for Android browser to handles URLs. However, you can override this behavior for your WebView, so links open within your WebView.  You can then allow the user to navigate backward and forward through webview page history.

Navigating Use goBack() and goForward() to navigate page history

Web Services "Web services are a means of exposing an API over a technology-neutral network endpoint. They are a means to call a remote method or operation that's not tied to a specific platform or vendor and get a result." Android in Action 3rd edition

Web Services Sources http://www.programmableweb.com/apis/directory/1?sort=mashups

Webservice-WeatherBug API

WeatherView App - Current

WeatherView App - Five Day

Use of API many API's require registration and a key value key used in requests

WeatherBug Web Services Three classes deal with making requests via the WeatherBug API in WeatherView ReadLocationTask based on zip code get location information ReadForecastTask read current forecast for given zip code ReadFiveDayForecastTask get forecast for next five days for given zip

ReadLocationTask Creates URL using zip code and key fro API

Results For ReadLocationTask http://i.wxbug.net/REST/Direct/GetLocation.ashx?zip=78681&api_key=xxxxx where xxxxx is your API key Result: {"location":{"city":"Round Rock","cityCode":null,"country":"United States","dma":"635","isUs":true, "lat":30.5123,"lon":-97.7117, "state":"TX","zipCode":"78681"}}

JSON JavaScript Object Notation a way to represent JavaScript objects as Strings alternative to XML for passing data between servers and clients design for data interchange format that humans can also read and write

JSON Examples value: array: object "Round Rock" ["Round Rock", "Dallas", "Houston"] object {"height":70,"weight":165}

Parsing JSON JsonReader class in Android API Read JSON encoded values as a stream of tokens In example used by ReadLocationTask to parse the JSON returned by the web request Pulls out city, state, and country string to display in View

Creating JsonReader and checking it is a location

Reading Location Data https://developer.android.com/reference/android/util/JsonReader.html

ReadForecastTask Similar in nature to ReadLocationTask, but different url for different data {"forecastHourlyList": [{"chancePrecip":"10","dateTime":1332882000000, "desc":"PartlyCloudy","dewPoint":64,"feelsLike":73, "feelsLikeLabel":"Heat Index","humidity":"74", "icon":"cond002","skyCover":null, "temperature":73,"windDir":null,"windSpeed":10}, {"chancePrecip":"10","dateTime":1332885600000, "desc":"Partly Cloudy","dewPoint":64,"feelsLike":70, "feelsLikeLabel":"Heat Index","humidity":"81", "icon":"cond002","skyCover":null, "temperature":70,"windDir":null,"windSpeed":11}, and on for another 158 hours

ReadForecastTask Also downloads image for current condition

Icons Obtained From WeatherBug

ReadFiveDayForecastTask {"dateTime":1332892800000, "dayDesc":"Partly Cloudy","dayIcon":"cond003", "dayPred":"Cloudy in the morning...becoming partly cloudy. Patchy fog in the morning. Highs 61 to 66. Light winds becoming west 15 mph with gusts to 25 mph in the afternoon.", "dayTitle":"Wednesday","hasDay":true, "hasNight":true,"high":"66","hourly":null,"low":"54","nightDesc":"Drizzle","nightIcon":"cond162", "nightPred":"Partly cloudy in the evening...becoming cloudy. Patchy fog and patchy drizzle overnight. Lows 49 to 55. Areas of winds northwest 15 to 20 mph with gusts to 25 mph in the evening becoming light.", "nightTitle":"WednesdayNight","title":"Wednesday"},

Displaying Data App does not try and display all data, just chooses "most important" icon day of week day prediction high temp low temp