Presentation is loading. Please wait.

Presentation is loading. Please wait.

Social Media Apps Programming Min-Yuh Day, Ph.D. Assistant Professor Department of Information Management Tamkang University

Similar presentations


Presentation on theme: "Social Media Apps Programming Min-Yuh Day, Ph.D. Assistant Professor Department of Information Management Tamkang University"— Presentation transcript:

1 Social Media Apps Programming Min-Yuh Day, Ph.D. Assistant Professor Department of Information Management Tamkang University http://mail.tku.edu.tw/myday Google App Engine and Google Maps API Tamkang University 2014-12-17 1031SMAP11 TLMXM1A (8687) (M2143) (Fall 2014) (MIS MBA) (2 Credits, Elective) [Full English Course] Thu 8,9 (15:10-17:00) V201

2 Course Schedule (1/3) Week Date Subject/Topics 1 2014/09/17 Course Orientation and Introduction to Social Media and Mobile Apps Programming 2 2014/09/24 Introduction to Android / iOS Apps Programming 3 2014/10/01 Developing Android Native Apps with Java (Eclipse) (MIT App Inventor) 4 2014/10/08 Developing iPhone / iPad Native Apps with Swift / Objective-C (XCode) 5 2014/10/15 Mobile Apps Using HTML5/CSS3/JavaScript 6 2014/10/22 jQuery Mobile 2

3 Course Schedule (2/3) Week Date Subject/Topics 7 2014/10/29 Create Hybrid Apps with Phonegap 8 2014/11/05 jQuery Mobile/Phonegap 9 2014/11/12 jQuery Mobile/Phonegap 10 2014/11/19 Midterm Exam Week (Midterm Project Report) 11 2014/11/26 Case Study on Social Media Apps Programming and Marketing in Google Play and App Store 12 2014/12/03 Google Cloud Platform 3

4 Course Schedule (3/3) Week Date Subject/Topics 13 2014/12/10 Invited Talk: Social, Data and Business Model - Let’s see PIXNET [Invited Speaker: Dr. Rick Cheng-Yu Lu, Technical Director, PIXNET] 14 2014/12/17 Google App Engine and Google Maps API 15 2014/12/24 Facebook API (Facebook JavaScript SDK) (Integrate Facebook with iOS/Android Apps) 16 2014/01/31 Twitter API 17 2015/01/07 Final Project Presentation 18 2015/01/14 Final Exam Week (Final Project Report) 4

5 Outline Google App Engine – Google Cloud Platform – Google Cloud Datastore Google Maps API 5

6 6 Source: https://cloud.google.com/products/https://cloud.google.com/products/ Compute Engine App Engine Container Engine Cloud Datastore Cloud SQL Cloud Storage Big Query Big DataStorageComputeServices Cloud Endpoints Translate API Prediction API Google Cloud Platform

7 Mobile Apps Backend on Google App Engine 7 Source: https://cloud.google.com/appengine/docs/java/endpoints/https://cloud.google.com/appengine/docs/java/endpoints/ Cloud Endpoints App Engine Google Cloud Endpoints Architecture

8 Google App Engine, Google Cloud Datastore 8 Source: Datastore Introduction, http://www.youtube.com/watch?v=fQazhzcC-rghttp://www.youtube.com/watch?v=fQazhzcC-rg Datasotre is a database (persistent storage) for App Engine Google App Engine Traditional Web applications Google App Engine (Java, Python, Go) Google App Engine (Java, Python, Go) Datastore RDBMS MySQL PostgreSQL SQL Server Oracle RDBMS MySQL PostgreSQL SQL Server Oracle Perl/CGI PHP Ruby on Rails ASP/JSP Perl/CGI PHP Ruby on Rails ASP/JSP Web application framework (AP) Web application framework (AP) Persistent storage (Database) Persistent storage (Database)

9 9 https://cloud.google.com/docs/ Google Cloud Platform

10 Try Google Cloud Platform for free 10

11 11 Try Google Cloud Platform for free

12 12 https://cloud.google.com/docs/ Google Cloud Platform

13 App Engine "Hello World" starter Start editing a working "Hello World" app right now, in the browser. This gives you a good starting point and a feel for what it's like editing a working App Engine application. 13 https://console.developers.google.com/start/appengine Google App Engine Deploy your first app in five minutes

14 Try Google App Engine Now 1.NAME YOUR PROJECT 2.SELECT YOUR LANGUAGE 3.EXPLORE THE STARTER CODE 4.INSTALL GOOGLE CLOUD SDK 5.RUN YOUR APP LOCALLY 6.CREATE YOUR PROJECT AND DEPLOY 14

15 15 Google App Engine

16 16 Google App Engine

17 17 Google App Engine

18 18 Google App Engine

19 19 Google App Engine

20 20 Google App Engine

21 21 Google App Engine

22 22 Google App Engine

23 Datastore Internals Based on Bigtable – high scalability – High availability synchronous writes on multiple datacenters 23 Source: Datastore Introduction, http://www.youtube.com/watch?v=fQazhzcC-rghttp://www.youtube.com/watch?v=fQazhzcC-rg Datastore Megastore Bigtable query transactions Scalable and reliable storage

24 What is Bigtable? Scalable, distributed, highly-available and structured storage – Bigtable is not database by itself (it doesn’t support query) Google usage – In production since April 2005 – Web Search, YouTube, Earth, Analytics 24 Source: Datastore Introduction, http://www.youtube.com/watch?v=fQazhzcC-rghttp://www.youtube.com/watch?v=fQazhzcC-rg Bigtable Scalable and reliable storage

25 Bigtable Data Model A row has a Key and Columns Sorted by Key – In lexical order – Enables range query by application 25 Source: Datastore Introduction, http://www.youtube.com/watch?v=fQazhzcC-rghttp://www.youtube.com/watch?v=fQazhzcC-rg “ …” “CNN” “CNN.com” “com.cnn.www” “contents:”“anchor:cnnsi.com” “anchor:my.look.ca” “ …” t6t6 t5t5 t3t3 t9t9 t8t8

26 Google Datastore Basic Operation Google Datastore Relational Database Management System (RDBMS) Category of objectKindTable One entry/objectEntityRow Unique identifier of data entry KeyPrimary Key (PK) Individual dataPropertyField 26 Source: Datastore Introduction, http://www.youtube.com/watch?v=fQazhzcC-rghttp://www.youtube.com/watch?v=fQazhzcC-rg Different terms for corresponding concepts

27 Kind, Entity and Key 27 Source: Datastore Introduction, http://www.youtube.com/watch?v=fQazhzcC-rghttp://www.youtube.com/watch?v=fQazhzcC-rg BlogEntry User Key: 1234 name: joe@ex.com message: xxxxx data: 1/1/2012 12:32 Key: joe@ex.com email: joe@ex.com followees: [usr2@ex.com, usr3@ex.com] followers: [] Key: usr2@ex.com email: usr2@ex.com followees: [] followers: [joe@ex.com] Kinds Key Entities

28 Properties and Data Types 28 Source: Datastore Introduction, http://www.youtube.com/watch?v=fQazhzcC-rghttp://www.youtube.com/watch?v=fQazhzcC-rg BlogEntry User Key: 1234 name: joe@ex.com message: xxxxx data: 1/1/2012 12:32 Key: joe@ex.com email: joe@ex.com followees: [usr2@ex.com, usr3@ex.com] followers: [] Key: usr2@ex.com email: usr2@ex.com followees: [] followers: [joe@ex.com] Properties Each entity has one or more named properties Variety of datatypes (int, float, boolean, Sring, Date,…) Can be multi-valued

29 Creating an Entity with Java Low-level API DatastoreService datastore = DatastoreServiceFactory.getDatastoreService(); Entity employee = new Entity(“Employee”); employee.setProperty(“name”, “Antonio Saliery”); employee.setProperty(“hireDate”, new Date()); employee.setProperty(“attendedHrTraining”, true); datastore.put(emploee); 29 Source: Datastore Introduction, http://www.youtube.com/watch?v=fQazhzcC-rghttp://www.youtube.com/watch?v=fQazhzcC-rg

30 Google Maps API 30 https://developers.google.com/maps/

31 31 Google Maps API https://developers.google.com/maps/

32 32 http://www.morethanamap.com/ Google Maps API Demos

33 33 http://www.morethanamap.com/demos Google Maps API Demos

34 34 Google Maps API Demos http://www.morethanamap.com/demos/basemaps/new-york

35 35 Google Maps API Demos http://www.morethanamap.com/demos/routing/cycling

36 Google Maps JavaScript API v3 36 https://developers.google.com/maps/web/

37 Google Maps JavaScript API 37 https://developers.google.com/maps/documentation/javascript/tutorial

38 38 Obtaining an Google Maps API Key https://developers.google.com/maps/documentation/javascript/tutorial

39 Demo: Integrate Google Maps JavaScript API with jQuery Mobile 39

40 Start using the Google APIs console 40 https://code.google.com/apis/console/?noredirect&pli=1 https://code.google.com/apis/console

41 41 Google APIs Console

42 42 Google APIs Console

43 43 Google APIs Console

44 44 Google APIs Console

45 Google Developers Console Google Cloud Platform 45

46 Google Maps API v3 46

47 Credentials: Public API access Get Google Maps API Key 47 API key

48 Google Map JavaScript API Hello, World 48 https://developers.google.com/maps/documentation/javascript/tutorial

49 49 html { height: 100% } body { height: 100%; margin: 0; padding: 0 } #map-canvas { height: 100% } <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=API_KEY&sensor=SET_TO_TRUE_OR_FALSE"> function initialize() { var mapOptions = { center: new google.maps.LatLng(-34.397, 150.644), zoom: 8 }; var map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions); } google.maps.event.addDomListener(window, 'load', initialize); https://developers.google.com/maps/documentation/javascript/tutorial Google Map JavaScript API Hello, World API key

50 Google Maps JavaScript API: Simple Map 50 https://developers.google.com/maps/documentation/javascript/examples/map-simple

51 51 Simple Map html, body, #map-canvas { height: 100%; margin: 0px; padding: 0px } var map; function initialize() { var mapOptions = { zoom: 8, center: new google.maps.LatLng(-34.397, 150.644) }; map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); } google.maps.event.addDomListener(window, 'load', initialize); https://developers.google.com/maps/documentation/javascript/examples/map-simple Google Maps JavaScript API Example JavaScript + HTML

52 52 http://mail.tku.edu.tw/myday/app/map.html

53 53 #map-canvas { height: 100%; margin: 0px; padding: 0px } function initialize() { var mapOptions = { zoom: 15, center: new google.maps.LatLng(25.174738, 121.450381) }; var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); } function loadScript() { var script = document.createElement('script'); script.type = 'text/javascript'; script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=true&callback=initialize'; document.body.appendChild(script); } window.onload = loadScript; Google Maps JavaScript API http://mail.tku.edu.tw/myday/app/map.html

54 54 Google Maps <!-- --> app.initialize(); #map-canvas { height: 100%; margin: 0px; padding: 0px } function initialize() { var mapOptions = { zoom: 15, center: new google.maps.LatLng(25.174738, 121.450381) }; var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); } function loadScript() { var script = document.createElement('script'); script.type = 'text/javascript'; script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=true&callback=initialize'; document.body.appendChild(script); } window.onload = loadScript; Back Google Maps Home Home Research Teaching More About http://mail.tku.edu.tw/myday/app/map.html map.html

55 55 http://mail.tku.edu.tw/myday/app/map.html Google Maps JavaScript API + jQuery Mobile

56 Summary Google App Engine – Google Cloud Platform – Google Cloud Datastore Google Maps API 56

57 References Google Cloud Platform, https://cloud.google.com/ https://cloud.google.com/ Google App Engine, https://cloud.google.com/appengine/ https://cloud.google.com/appengine/ Google Cloud Datastore, https://cloud.google.com/datastore/ https://cloud.google.com/datastore/ Google Cloud Endpoints, https://cloud.google.com/endpoints/ https://cloud.google.com/endpoints/ Google Maps API, https://developers.google.com/maps/ https://developers.google.com/maps/ Google Maps JavaScript API v3 Tutorial, https://developers.google.com/maps/documentation/javascrip t/tutorial https://developers.google.com/maps/documentation/javascrip t/tutorial Google Maps API Tutorial, http://www.w3schools.com/googleAPI/ http://www.w3schools.com/googleAPI/ 57


Download ppt "Social Media Apps Programming Min-Yuh Day, Ph.D. Assistant Professor Department of Information Management Tamkang University"

Similar presentations


Ads by Google