Developing for Chromecast Cast Companion Library & Custom Receiver Application.

Slides:



Advertisements
Similar presentations
Bruce Scharlau, University of Aberdeen, 2010 Android UI, and Networking Mobile Computing Based on android-sdk_2.2 Unless otherwise stated, images are from.
Advertisements

Sun-a, Kim Yoon kyoung, Kim. Samsung Smart TV SDK supports device convergence by allowing a client application running on an external device to communicate.
Samsung Smart TV is a web-based application running on an application engine installed on digital TVs connected to the Internet.
1. What is Essex Scheduler? 2. Why Android? 3. Software design 4. Application graphics 5. Releasing to Google Play 6. Application maintenance Essex Scheduler.
Social Channels Cat Lee Program Manager, Developer Relations facebook.com/cat Driving traffic to your app.
Web Toolkit Julie George & Ronald Lopez 1. Requirements  Java SDK version 1.5 or later  Apache Ant is also necessary to run command line arguments 
A really fairly simple guide to: mobile browser-based application development (part 1) Chris Greenhalgh G54UBI / Chris Greenhalgh
CS378 - Mobile Computing Maps. Using Google Maps Like other web services requires an API key from Google ons/google-apis/mapkey.html.
Google Android as a mobile development platform T Internet Technologies for Mobile Computing Olli Mäkinen.
SE-2840 Dr. Mark L. Hornick1 Java Servlet-based web apps Servlet Architecture.
Forms, Validation Week 7 INFM 603. Announcements Try placing today’s example in htdocs (XAMPP). This will allow you to execute examples that rely on PHP.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College Lecture 8: WebForms — Web-based.
Presented by…. Group 2 1. Programming language 2Introduction.
Project Rickshaw SEARCH - FIND - GO. Project Rickshaw TEAM MEMBERS KEVIN AUGUSTINO – MATT FOX – DAVID MOORE SPONSORS KARASU TECHNOLOGIES - ERIK PAUL -
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
User Interface Design using jQuery Mobile CIS 136 Building Mobile Apps 1.
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
Java Mobile Apps with GWT & PhoneGap Josh Marinacci, webOS Developer Advocate.
Google Cloud Messaging for Android (GCM) is a free service that helps developers send data from servers to their Android.
Copyright© Jeffrey Jongko, Ateneo de Manila University Android.
(1) Real Time Web. (2) Request – Response How would you create: A stock price ticker? A sports game cast app? A server status app? 1. Polling 2. Long.
Tutorial 10 Programming with JavaScript
Cross Site Integration “mashups” cross site scripting.
WHO WILL BENEFIT FROM THIS TALK TOPICS WHAT YOU’LL LEAVE WITH Developers Interested in HTML5 Games Interested in Windows Azure Interested in Game Development.
Phonegap Bridge – File System CIS 136 Building Mobile Apps 1.
Server - Client Communication Getting data from server.
Chat Room App Logan Linn Network Application Design Fall 2010.
SYST Web Technologies SYST Web Technologies AJAX.
FCM Workflow using GCM.
ICM – API Server & Forms Gary Ratcliffe.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
Introduction to JavaScript MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/2/2016.
Craig Pelkie Copyright © 2015, Craig Pelkie ALL RIGHTS RESERVED Use RPG to Mobilize your IBM i.
Lecture 8 the Preference Menu. Settings... Sudoku settings s Music Play background music Hints Show hints during play We add some strings to the strings.xml.
Secure Mobile Development with NetIQ Access Manager
Paragon The Platform and Message Broker. Paragon: The Platform Stack -Window Management -Messaging -App Lifecycle Management -App Store -Workspaces -Storage.
Google Web Toolkit for Mobile Applications Development INGENUITY AT ITS BEST……………….
Chapter 6 Google Play Services GOALS & OBJECTIVES Google Play Services give you features to attract users using Google features such as Google Maps, Google+,
APP DESIGN AND DEVELOPMENT WITH THE IONIC FRAMEWORK Chuck Leone
X2R Spec 1. Change log DateVersionPeopleNote 2013/11/01V0.0.1Chien-Wei Yu, Anderson Ou First draft, add X2R files spec. 2013/12/16V0.0.2Anderson Ou, Doc.
Esri UC 2014 | Technical Workshop | Administering ArcGIS for Server with Python Jon Bodamer.
AJAX. Objectives Understand and apply AJAX Using AJAX in DOJO library.
Phonegap Bridge – Storage CIS 136 Building Mobile Apps 1.
RE-ENGINEERING FLEX APP TO JAVASCRIPT APP By Imtiaz Syed.
Submitted By: Tarun Tyagi Website- - Enable USB Debugging.
Mobile App Development Using:
Video Streaming vs Video Casting
A little more App Inventor and Mind the GAP!
PhoneGap, Processing.
REST APIs and Android Presented by: James Simshaw
WWU Hackathon May 6 & 7.
Tutorial 10 Programming with JavaScript
Android Runtime – Dalvik VM
Data Virtualization Tutorial… CORS and CIS
Tracking and Booking Taxi
Getting web pages First we need to get the webpage by issuing a HTTP request. The best option for this is the requests library that comes with Anaconda:
Customizing your device experience with assigned access
Google Chromecast.
Social Media And Global Computing Introduction to Visual Studio
jQuery form submission
Web Socket Protocol.
Lecture 14: JSON and Web SERVICES
Client-Server Model: Requesting a Web Page
TN19-TCI: Integration and API management using TIBCO Cloud™ Integration
WCF Data Services and Silverlight
THE ANDROID TEXTBOOK APP
© 2017, Mike Murach & Associates, Inc.
Presentation transcript:

Developing for Chromecast Cast Companion Library & Custom Receiver Application

Kurt / peirr.com

What is Chromecast?

How does it work?

Sender application Two components Applications running on a mobile device or laptop Receiver application (HTML, JavaScript, CSS) app running on a Chromecast or other cast compatible device.

Sender application Two components Applications running on a mobile device or laptop Receiver application (HTML, JavaScript, CSS) app running on a Chromecast or other cast compatible device.

Receiver application

Custom Media Receiver 3 Types of receivers Requires application id, DRM Content, Data centric apps Styled Media Receiver Can be styled with CSS files, requires application id Default Media Receiver Does not require application id, can use CastMediaControlIntent.DEFAULT_MEDIA_RECEIVER_APPLICATION_ID in your sender if using CCL

Custom Receiver

Receiver API

Simple Custom Receiver LocalCast

//[3] handle the payload from the sender function process(json){ console.log('received: ' + json.url); document.getElementById("image").src= json.url; } //[1] get a handle to the receiver manager window.castReceiverManager = cast.receiver.CastReceiverManager.getInstance(); castReceiverManager.onSenderDisconnected = function(event) { console.log('disconnected: ' + event.data); if (window.castReceiverManager.getSenders().length == 0) { //close the app if we have no more connected devices window.close(); } }; //[2] create a CastMessageBus to handle messages for a custom namespace window.messageBus = window.castReceiverManager.getCastMessageBus('urn:x-cast:com.peirr.localcast'); window.messageBus.onMessage = function(event) { var json = JSON.parse(event['data']); //decode the request from sender app window.sender = event.senderId; process(json); } //[4]start the listener window.castReceiverManager.start();

Publishing Receiver Application

Development Publish to any server & add endpoint to cast console Debug Production Server has to be secure ( ) Google Cast SDK Developer Console Publishing

Development Publish to any server & add endpoint to cast console Debug Production Server has to be secure ( ) Google Cast SDK Developer Console Publishing

Development Publish to any server & add endpoint to cast console Debug Production Server has to be secure ( ) Google Cast SDK Developer Console Publishing

Sender Application

Android development options

compile "com.android.support:mediarouter-v7:23.3.0" compile 'com.google.android.gms:play-services-cast:8.4.0'

compile "com.android.support:mediarouter-v7:23.3.0" compile 'com.google.android.gms:play-services-cast:8.4.0' compile 'com.google.android.libraries.cast.companionlibrary:ccl:2.8.3'

Cast Companion Library

Example: LocalCast

Initialize CastConfiguration options =new CastConfiguration.Builder("84B70D9D").enableAutoReconnect().enableDebug().build(); DataCastManager.initialize(this,options);

Cast Button <item app:actionProviderClass="android.support.v7.app.MediaRouteActionProvider" public boolean onCreateOptionsMenu(Menu menu){ super.onCreateOptionsMenu(menu); getMenuInflater().inflate(R.menu.menu,menu); DataCastManager.getInstance().addMediaRouterButton(menu,R.id.action_cast); return true; }

Send data to Receiver Application JSONObject obj = new JSONObject(); String url = " info.ip + ":" + info.port + "/" + item.getFile().getAbsolutePath(); Log.d(TAG, "casting: " + url); try { obj.put("url",url); DataCastManager.getInstance().sendDataMessage(obj.toString(),"urn:x- cast:com.peirr.localcast"); } catch (JSONException|IOException e) { e.printStackTrace(); }

Questions