Server - Client Communication 8.4.2013. Getting data from server.

Slides:



Advertisements
Similar presentations
1Proprietary and Confidential AirVantage API – Getting started David SCIAMMA – June 13th 2014.
Advertisements

Introduction to Computing Using Python CSC Winter 2013 Week 8: WWW and Search  World Wide Web  Python Modules for WWW  Web Crawling  Thursday:
4.01 How Web Pages Work.
Prepared by: Prepared by: Jameela Rabaya Jameela Rabaya Fatima Darawsha Fatima Darawsha.
IPhone/Android & MySQL Hongsheng Lu CSE40333/ Spring University of Notre Dame.
Retrieving compound pages This work is licensed under a Creative Commons Attribution-Noncommercial- Share Alike 3.0 License. Skills: none IT concepts:
A CHAT CLIENT-SERVER MODULE IN JAVA BY MAHTAB M HUSSAIN MAYANK MOHAN ISE 582 FALL 2003 PROJECT.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 17 Introduction to the Application.
IT skills: IT concepts: Web client (browser), Web server, network connection, URL, mobile client, peer-to- peer application This work is licensed under.
1 L52 Networking (1). 2 OBJECTIVES In this chapter you will learn:  To understand Java networking with URLs, sockets and datagrams.  To implement Java.
1 Static Web Pages Websites on Servers (The Big Picture) –Apache Tomcat can support static web pages –Primarily intended to support servlets and JSP –Some.
Apache Tomcat Server Typical html Request/Response cycle
1 Software Testing and Quality Assurance Lecture 32 – SWE 205 Course Objective: Basics of Programming Languages & Software Construction Techniques.
IST 221 Internet Concepts and Applications Internet, WWW and HTML 1.
Topics in this presentation: The Web and how it works Difference between Web pages and web sites Web browsers and Web servers HTML purpose and structure.
Introduction 2: Internet, Intranet, and Extranet J394 – Perancangan Situs Web Program Sudi Manajemen Universitas Bina Nusantara.
Implementing Application Protocols. Overview An application protocol facilitates communication between applications. For example, an client uses.
Client-server interactions in Mobile Applications.
1 Web Servers (IIS and Apache) Outline 9.1 Introduction 9.2 HTTP Request Types 9.3 System Architecture 9.4 Client-Side Scripting versus Server-Side Scripting.
1 CS 131 Wrap Up Fall 2008 What Good is Programming?
COMMUNICATION Team 5 ADIL KHAN. COMMUNICATION Team 5 COMMUNICATION PROVIDER Two Modules Comprise the CommunicationProvider SmilTransporter CloudDataProvider.
INTRODUCTION TO WEB DATABASE PROGRAMMING
1 Homework / Exam Exam 3 –Solutions Posted –Questions? HW8 due next class Final Exam –See posted schedule Websites on UNIX systems Course Evaluations.
Copyright © cs-tutorial.com. Introduction to Web Development In 1990 and 1991,Tim Berners-Lee created the World Wide Web at the European Laboratory for.
CS378 - Mobile Computing Web - WebView and Web Services.
Internet Basics A management-level overview of the Internet, its architecture, capabilities, and protocols. Copyright 2011 SPMI / Online Development.
1 Computer Communication & Networks Lecture 28 Application Layer: HTTP & WWW p Waleed Ejaz
Technology in Action Alan Evans Kendall Martin Mary Anne Poatsy Twelfth Edition.
1 HKU CSIS DB Seminar: HKU CSIS DB Seminar: Web Services Oriented Data Processing and Integration Speaker: Eric Lo.
CSCI 6962: Server-side Design and Programming Web Services.
Chapter 8 Cookies And Security JavaScript, Third Edition.
Web Engineering we define Web Engineering as follows: 1) Web Engineering is the application of systematic and proven approaches (concepts, methods, techniques,
HTTP and Threads. Getting Data from the Web Believe it or not, Android apps are able to pull data from the web. Developers can download bitmaps and text.
Serialization. Serialization is the process of converting an object into an intermediate format that can be stored (e.g. in a file or transmitted across.
IP BROS Presentation by: Amen Ahmed. Mario and Luigi are here to help us find our way through the internet. Mario will act as our browser and Luigi will.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 1 Key Concepts 1.
Integrating Digital Libraries by CORBA, XML and Servlet Integrating Digital Libraries by CORBA, XML and Servlet Wing Hang Cheung, Michael R. Lyu and Kam.
Application Block Diagram III. SOFTWARE PLATFORM Figure above shows a network protocol stack for a computer that connects to an Ethernet network and.
MAKANI ANDROID APPLICATION Prepared by: Asma’ Hamayel Alaa Shaheen.
JSON and A Comparison of Scripts. JSON: JavaScript Object Notation Based on a subset of the JavaScript Programming Language provides a standardized data.
Android networking 1. Network programming with Android If your Android is connected to a WIFI, you can connect to servers using the usual Java API, like.
ECEN “Internet Protocols and Modeling”, Spring 2012 Course Materials: Papers, Reference Texts: Bertsekas/Gallager, Stuber, Stallings, etc Class.
20-Nov-15introServlets.ppt Intro to servlets. 20-Nov-15introServlets.ppt typical web page – source Hello Hello.
Interprocess Communications
Facebook API Kelly Orser. Client Libraries Client libraries will simplify the calls to the platform by reducing the amount of code you have to write.
CS 4244: Internet Programming Network Programming in Java 1.0.
JSON Android Club 2015.
Web Design and Development. World Wide Web  World Wide Web (WWW or W3), collection of globally distributed text and multimedia documents and files 
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
ICM – API Server & Forms Gary Ratcliffe.
©SoftMooreSlide 1 Introduction to HTML: Forms ©SoftMooreSlide 2 Forms Forms provide a simple mechanism for collecting user data and submitting it to.
RESTful Web Services A MIDAS MISSION PRESENTATION APRIL 29, 2015.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
Creating Animations, Working with Graphics, and Accessing Data Lesson 9.
JavaScript and Ajax (Internet Background) Week 1 Web site:
Introduction to the World Wide Web & Internet CIS 101.
Adding network connections. Connecting to the Network To perform the network operations, your application manifest must include the following permissions:
Internet addresses By Toni Grey & Rashida Swan HTTP Stands for HyperText Transfer Protocol Is the underlying stateless protocol used by the World Wide.
Tools of the trade J SON, M AVEN, A PACHE COMMON Photo from
JQuery form submission CIS 136 Building Mobile Apps 1.
XML & JSON. Background XML and JSON are to standard, textual data formats for representing arbitrary data – XML stands for “eXtensible Markup Language”
Free Powerpoint Templates Page 1 Free Powerpoint Templates CHAPTER 1 LAB 1.1 Web Server.
Network Programming. These days almost all devices.
Week-7 (Lecture-1) Internet Protocols: TCP/IP, Client Server: Protocol: Specification in networking and Communications It defines the procedures to be.
6/28/ A global mesh of interconnected networks (internetworks) meets these human communication needs. Some of these interconnected networks are.
USING ANDROID WITH THE INTERNET. Slide 2 Lecture Summary Getting network permissions Working with the HTTP protocol Sending HTTP requests Getting results.
Some from Chapter 11.9 – “Web” 4 th edition and SY306 Web and Databases for Cyber Operations Cookies and.
CASE STUDY -HTML,URLs,HTTP
Lesson 11: Web Services & API's
CS323 Android Topics Network Basics for an Android App
Presentation transcript:

Server - Client Communication

Getting data from server

Required permissions To access the Internet your application requires android.permission.INTERNET To check the network state your application requires android.permission.ACCESS_NETWORK_STATE

Network on Android Network java.net package contains HttpURLConnection class including Apache HttpClient library

A client-side HTTP transport library Purpose – to transmit – receive HTTP messages – server-client communication

Apache HttpClient library User Provide a request object Http Client -send request to the target server -return a corresponding response object -or throw an exception if execution was unsuccessful -one or several HTTP request / HTTP response

Introduction to JSON JavaScript Object Notation Independent data exchange format Limited to text and numeric values Binary values are not supported

JSON An JSON object is a set of key (string) / value (string/numerical) pairs which starts with "{" and ends with "}"

JSON AndroidAndroid includes the json.org libraries Writing JSON is very simple Just create the JSONObject Use the toString() method Work easily with JSON files

Steps Send Request to Server Create JSON array Getting response from server Display Response in String format Request Object from user

JSON array Request Object 1. Send request to server 2. Request Object from user 3. Creat JSON array 4. Getting response from server Flow

Parsing JSON

Result data from server

Display Image from server

Display Image from link Convert string to URI Send Request to server and Receive response HttpEntity, BufferedHttpEntity : Bitmap factory Display Image Link (String)

Display image from link 2. Send Request to server and Receive response 1. Convert string to URI

3. HttpEntity: Get http message in streamed form 4. BufferedHttpEntity: Used to save content of entity 5. Bitmap factory : Creates Bitmap objects from various sources, including files, streams, and byte-arrays Display image from link

.

Result