IPhone/Android & MySQL Hongsheng Lu CSE40333/60333 2011 Spring University of Notre Dame.

Slides:



Advertisements
Similar presentations
Programming with Android: Network Operations
Advertisements

1 Euro-VO Technology Forum, 23 September 2009, Annotations at the CDS Web 2.0: annotations at the CDS Brice GASSMANN Sébastien DERRIERE Thomas BOCH.
WEB SERVICES. FIRST AND FOREMOST - LINKS Tomcat AXIS2 -
AHRT: The Automated Human Resources Tool BY Roi Ceren Muthukumaran Chandrasekaran.
Prepared by: Prepared by: Jameela Rabaya Jameela Rabaya Fatima Darawsha Fatima Darawsha.
Web API for Mobile JaxARCSIG April About Me David Fekke L.L.C. Mobile apps for iOS Regular presenter at JaxDUG, JSSUG and JaxFusion Writing Web.
雲端計算 Cloud Computing Lab - EyeOS. Agenda Installation Programming.
What is it? –Large Web sites that support commercial use cannot be written by hand What you’re going to learn –How a Web server and a database can be used.
Creating WordPress Websites. Creating a site on your computer Local server Local WordPress installation Setting Up Dreamweaver.
INTRODUCTION The Group WEB BROWSER FOR RELATION Goals.
Multiple Tiers in Action
Android App to control an IRC Bot. Background What is IRC and what does an IRC Bot do? IRC is Internet Relay Chat. It is a place that you can connect.
A complete web app using flex. You can use the flex builder to generate the php (server side) code for a flex-php application. As before, Php connects.
06 | Implementing Web APIs Jon Galloway | Tech Evangelist Christopher Harrison | Head Geek.
Client-server interactions in Mobile Applications.
It’s World Wide! I NTRODUCTION TO T HE WEB 1 Photo courtesy:
Lecture 3 – Data Storage with XML+AJAX and MySQL+socket.io
PHOTOSWAP Albert Park & Brandon Ochs. What is PhotoSwap?  Social networking platform for iOS  Users share images with each other  Extract sensor data.
CNIT 132 Intermediate HTML and CSS Course Overview.
REST.  REST is an acronym standing for Representational State Transfer  A software architecture style for building scalable web services  Typically,
Introduction.  What does this course mean to VGP?  Creating persistent worlds  Offline multiplayer games  Save/retrieve data from the Web  What does.
CSCI 6962: Server-side Design and Programming Web Services.
MySQL and PHP Internet and WWW. Computer Basics A Single Computer.
JavaScript – Quiz #9 Lecture Code:
前置工作 1. 安裝 TomCat 2. 下載及安裝 AppServ exe 內含 Appache 2.2/Php5/MySQL 3. 修改相關參數檔 Appache 2.2/conf/ httpd.conf, workers.properties TomCat/conf/server.xml.
PHP and MySQL CS How Web Site Architectures Work  User’s browser sends HTTP request.  The request may be a form where the action is to call PHP.
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.
Implement An Online Management System for PBX Presented by: Bui Phuong Nhung Advisor: Dr. Wei, Chao-Huang.
1 Welcome to CSC 301 Web Programming Charles Frank.
MAKANI ANDROID APPLICATION Prepared by: Asma’ Hamayel Alaa Shaheen.
“ Mobile Internet Development ” Prasert Jaipet (aekram43) MCTS,MCPD,Microsoft Insider Technology Team Manager Digital Beyond Company
The Web and Web Services Jim Graham NR 621 Spring 2009.
JSON and A Comparison of Scripts. JSON: JavaScript Object Notation Based on a subset of the JavaScript Programming Language provides a standardized data.
Security Considerations Steve Perry
Server - Client Communication Getting data from server.
Web application architecture1 Based on Jim Conallen: Web Applications with UML.
JSON Android Club 2015.
The Internet of Things with Live Data Cloud by Open Automation Software.
S O A P ‘the protocol formerly known as Simple Object Access Protocol’ Team Pluto Bonnie, Brandon, George, Hojun.
Web Technologies Lecture 1 The Internet and HTTP.
Quiz 1 Review (Week 10) Sam Green ’17 (646)
Windows 7 WampServer 2.1 MySQL PHP 5.3 Script Apache Server User Record or Select Media Upload to Internet Return URL Forward URL Create.
AJAX and REST. Slide 2 What is AJAX? It’s an acronym for Asynchronous JavaScript and XML Although requests need not be asynchronous It’s not really a.
How Web Database Architectures Work CPS181s April 8, 2003.
JavaScript and Ajax (Internet Background) Week 1 Web site:
It’s World Wide! I NTRODUCTION TO T HE WEB 1 Photo courtesy:
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.
Tools of the trade J SON, M AVEN, A PACHE COMMON Photo from
Web Application with AJAX CS 526 advanced interned and Web system Presenters Faris Kateb Mohammed AbdulAziz Omar Alzahrani.
Web Development. Agenda Web History Network Architecture Types of Server The languages of the web Protocols API 2.
Android Application Web 1.
Section 6.3 Server-side Scripting
Brice Copy, Mirjam Labrenz
The Client-Server Model
Web Concepts Lesson 2 ITBS2203 E-Commerce for IT.
JavaScript and Ajax (Internet Background)
Cosc 5/4730 REST services.
AJAX and REST.
HTTP Parameters and Arrays
WyoExchange Zhongshan Lu Jacob Grife
Lesson 11: Web Services & API's
SQL Server 2016 JSON Support FOR Data Warehousing
WEB API.
Offline Database Synchronization with SOAP and MySQL
Web Systems Development (CSC-215)
Web Browser server client 3-Tier Architecture Apache web server PHP
Ajax and JSON (jQuery part 2)
Client-Server Model: Requesting a Web Page
Presentation transcript:

IPhone/Android & MySQL Hongsheng Lu CSE40333/ Spring University of Notre Dame

Background The need to communicate with a remote database Create a web service which iphone/android can talk to. The web service communicates with the database. Write your own database client protocol. 2

Setting in the lab 3 Server Spike.cse.nd.edu Apache MySQL 1. iPhone/Android posts a request to spike using HTTP 2. Apache connects to MySQL database 3. Apache returns data to iPhone/Android 4. iPhone/Andorid processes the data

Demo basic MySQL operations Create, read, drop tables; Insert, delete rows; Web service step up; push data; pull data; Sample code 4 <?php mysql_connect("host","username","password" ); mysql_select_db("PeopleData"); $q=mysql_query("SELECT * FROM people WHERE birthyear>'".$_REQUEST['year']."'"); while($e=mysql_fetch_assoc($q)) $output[]=$e; print(json_encode($output)); mysql_close(); ?>

Smart phone side 5 JSON: JavaScript Object Notation. format is often used for serializing and transmitting structured data over a network connection. It is primarily used to transmit data between a server and web application, serving as an alternative to XML //http post HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(" BornAfter.php"); httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); HttpResponse response = httpclient.execute(httppost); HttpEntity entity = response.getEntity(); InputStream is = entity.getContent();InputStream //convert response to string //parse json data JSONArray jArray = new JSONArray(result); for(int i=0;i<jArray.length();i++){ JSONObject json_data = jArray.getJSONObject(i); Log.i("log_tag","id: "+json_data.getInt("id")+ ", name: "+json_data.getString("name")+ ", sex: "+json_data.getInt("sex")+ ", birthyear: "+json_data.getInt("birthyear")

Smart phone side JSON-framework for iphone. Tutorial will be given. 6

Links JSON-framework – Download: – Tutorial: iphone-part-2.htmlhttp://iphonedevelopertips.com/cocoa/json-framework-for- iphone-part-2.html – Tutorial: iphone/ iphone/ MySQL – Download : – Tutorial: Android – Tutorial: – Tutorial: in-android/ in-android/ 7