SlideShare uma empresa Scribd logo
1 de 16
Google Cast
By:Simranjit Kour
Agenda
1.Google CastIntroduction
2.Design Checklist
3.Requirement Study
4.Developing App using Google Cast
5.Technical Details
6. Limitations
 Google Cast is a technology that enables multi-screen experiences
and lets a user send and control content like video from a small
computing devices like a phone, tablet or laptop to a large display
device liketelevision
 Google Cast allows Android and iOS mobile apps and Chrome web
apps to “cast” content -like video, audio, and screen sharing
(mirroring) - to Cast-ready devices like a Chromecast
 The Google Cast SDK was released on February 3, 2014
4
Google Cast
 Whenevera query isrun
• Directly after a controller action completes, ifno exceptions are thrown
• Directly before a transaction is committed.
Example
def album=Album.get(1)
album.title ="Change It"
def otherAlbums =Album.findAllWhereTitleLike("%Change%")
assert otherAlbums.contains(album)
5
Automatic Session Flushing
1.Cast Base:
Sender and Receiver both connected to same WiFi network.
There are two ways users can start a Cast session:
1. Connect & play: Connect to a Cast receiver before playing content
2. Play & connect: Connect to a Cast receiver while playing content
2.CastButton:
The cast button invokesa menu to connect, control and disconnect from
Cast receivers.
3.Cast Menu:
The devices menu isshown wheneverthe cast button ispressed. The cast
menu lets users connect, control and disconnect from Cast receivers.
6
Design Checklist
4.SenderApp:
When content is casting / playing on a Cast receiver, the user must always
be able to control it from the sender app.
5.Receiver App:
The devices menu isshown wheneverthe cast button ispressed. The cast
menu lets users connect, control and disconnect from Cast receivers.
7
Design Checklist
1.Minimum Android SDK version that the Cast SDK supports is 9
(GingerBread)
2.The Google Play services library need to be referenced inside the
application element.
3.Cast application development involves development of Sender and
Receiver applications.
4.You need to register your application in order to get application ID
(which will be used in both “sender” and “receiver” applications).
https://cast.google.com/publish/
5. Pay the one time $5 registration fee
6. Register your Google Cast device so that it may access your receiver
application before you publish it.
8
Requirements
1.Create empty Android application and add the following libraries as
dependencies:
android-sdkextrasandroidsupportv7appcompat
android-sdkextrasandroidsupportv7mediarouter
android-sdkextrasgooglegoogle_play_serviceslibprojectgoogle-
play-services_lib
2.Meta-data elementis required in manifest:
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
3.Application’s theme:
android:theme="@style/Theme.AppCompat"
9
Developing Sender App
Developing Sender App
1
0
4.Addingthe Cast Button:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" >
<item android:id="@+id/media_route_menu_item"
android:title="@string/media_route_menu_title"
app:actionProviderClass="android.support.v7.app.MediaRouteActionProvider"
app:showAsAction="always"/>
</menu>
5.Classes used:
MediaRouter
MediaRouteSelector
Cast
CastDevice
GoogleApiClient
Sender app starts MediaRouter device discovery: MediaRouter.addCallback
MediaRouter informs user selected: MediaRouter.Callback.onRouteSelected
Sender app retrieves CastDevice instance: CastDevice.getFromBundle
Sender app creates a GoogleApiClient: GoogleApiClient.Builder
Sender app connects the GoogleApiClient: GoogleApiClient.connect
SDK confirms: GoogleApiClient.ConnectionCallbacks.onConnected
Sender app launches the receiver app: Cast.CastApi.launchApplication
SDK confirms: ResultCallback<Cast.ApplicationConnectionResult>
Creates a communication channel:
Cast.CastApi.setMessageReceivedCallbacks
Sender sends a message to the receiver: Cast.CastApi.sendMessage
10
Sender application flow
 “Receiver” application is a special form of Web application that can
run on a Chromecast device
 Functions of Receiver Application:
1.Provides an interface to display the app's content.
2.Handles messages from the sender application to control content on
the receiver device.
3. Handles custom messages from the sender application that
are application-specific
12
Developing Receiver App
1.Styled Media Receiver:
Pre-built receiver application hosted by Google that is designed for streaming
audio and video content
2.Custom Receiver:
Ifapp provides content such as a game or image gallery, requires DRM, or
requires support for media types. Itis an HTML5 app that you host on your own
servers using the JavaScript Receiver API.
3.Default Media Receiver:
Itdoes not require you to register with the Google Cast SDK Developer Console,
but you cannot customize any of the UI.
CastMediaControlIntent.DEFAULT_MEDIA_RECEIVER_APPLICATION_ID
13
Types of Receiver Application
1.Use same WiFi network for both sender and receiver device
2.Supported Image formats :BMP, GIF, JPEG, PNG,WEBP
3.Supported Audioformats: MP3, Vorbis, Wav
4.Streaming protocols: MP4,WebM
5.Media Player Library supported types: PlayReady, Widevine
6.Optimized android apps: Youtube, Netflix, Google Music, Google
Movies
7.Download the Google Cast Extension for Crome browser:
https://chrome.google.com/webstore/detail/google-cast/
14
Technical Details
1.The Cast device is a low-power device with memory, CPU, and GPU
limitations, so the receiver application should be as lightweight as possible
2.Tabs, windows or popups cannot be created in the receiver app, and
there should be nothing on the receiver device screen requiring input. All
interaction with the application must be done through a sender application
3.Only one video element may be active at any time
4.Video compositing, manipulation, transformations, rotations or zooming are
not supported
15
Limitations
Contact us
Our Office
Client
Location
Here’s how TOTHENEW
uses GoogleCast for
MOBILITY!
Click Here To Know More!
Have more queries on
MOBILITY?
Talk To Our Experts

Mais conteúdo relacionado

Destaque

Roles for my group
Roles for my groupRoles for my group
Roles for my groupsathma
 
Corporate Training Programs
Corporate Training ProgramsCorporate Training Programs
Corporate Training Programsfinberry academy
 
Martin Luther King Service Project
Martin Luther King Service ProjectMartin Luther King Service Project
Martin Luther King Service ProjectCindy
 
Unicef
UnicefUnicef
Unicefmerve
 
Four montages
Four montagesFour montages
Four montagessathma
 
Open day presentation
Open day presentation Open day presentation
Open day presentation sallyross
 
User interview wahl_upa
User interview wahl_upaUser interview wahl_upa
User interview wahl_upaKatherine Wahl
 
Production schedule 2011
Production schedule 2011Production schedule 2011
Production schedule 2011sathma
 
Silverpop Connect Dubai - Opening Keynote
Silverpop Connect Dubai - Opening KeynoteSilverpop Connect Dubai - Opening Keynote
Silverpop Connect Dubai - Opening KeynoteJohn Watton
 
Analyzing data
Analyzing dataAnalyzing data
Analyzing datasathma
 
3rd nat. parks
3rd nat. parks3rd nat. parks
3rd nat. parksllsears
 
American Revolutionary War Heroes
American Revolutionary War HeroesAmerican Revolutionary War Heroes
American Revolutionary War HeroesSharon Matney
 
40 plus presentation
40 plus presentation40 plus presentation
40 plus presentationZoe-Ann Lynch
 
Cell block 33 script
Cell block 33 scriptCell block 33 script
Cell block 33 scriptsathma
 
In digital space no one can hear you scream
In digital space no one can hear you screamIn digital space no one can hear you scream
In digital space no one can hear you screamJohn Watton
 
FUKUYAMA BASE Workshop Vol.10 Theme
FUKUYAMA BASE Workshop Vol.10 ThemeFUKUYAMA BASE Workshop Vol.10 Theme
FUKUYAMA BASE Workshop Vol.10 Themenoteproject
 

Destaque (19)

Roles for my group
Roles for my groupRoles for my group
Roles for my group
 
Corporate Training Programs
Corporate Training ProgramsCorporate Training Programs
Corporate Training Programs
 
Martin Luther King Service Project
Martin Luther King Service ProjectMartin Luther King Service Project
Martin Luther King Service Project
 
Unicef
UnicefUnicef
Unicef
 
Four montages
Four montagesFour montages
Four montages
 
Mn powerpoint
Mn powerpointMn powerpoint
Mn powerpoint
 
Open day presentation
Open day presentation Open day presentation
Open day presentation
 
Aleutian Sparrow
Aleutian Sparrow Aleutian Sparrow
Aleutian Sparrow
 
User interview wahl_upa
User interview wahl_upaUser interview wahl_upa
User interview wahl_upa
 
Production schedule 2011
Production schedule 2011Production schedule 2011
Production schedule 2011
 
Silverpop Connect Dubai - Opening Keynote
Silverpop Connect Dubai - Opening KeynoteSilverpop Connect Dubai - Opening Keynote
Silverpop Connect Dubai - Opening Keynote
 
Analyzing data
Analyzing dataAnalyzing data
Analyzing data
 
3rd nat. parks
3rd nat. parks3rd nat. parks
3rd nat. parks
 
American Revolutionary War Heroes
American Revolutionary War HeroesAmerican Revolutionary War Heroes
American Revolutionary War Heroes
 
40 plus presentation
40 plus presentation40 plus presentation
40 plus presentation
 
Cell block 33 script
Cell block 33 scriptCell block 33 script
Cell block 33 script
 
Edisi78
Edisi78Edisi78
Edisi78
 
In digital space no one can hear you scream
In digital space no one can hear you screamIn digital space no one can hear you scream
In digital space no one can hear you scream
 
FUKUYAMA BASE Workshop Vol.10 Theme
FUKUYAMA BASE Workshop Vol.10 ThemeFUKUYAMA BASE Workshop Vol.10 Theme
FUKUYAMA BASE Workshop Vol.10 Theme
 

Mais de TO THE NEW | Technology

10 Best Node.js Practices you Need to Know!
10 Best Node.js Practices you Need to Know!10 Best Node.js Practices you Need to Know!
10 Best Node.js Practices you Need to Know!TO THE NEW | Technology
 
10 Pragmatic UX techniques for building smarter products:
10 Pragmatic UX techniques for building smarter products:10 Pragmatic UX techniques for building smarter products:
10 Pragmatic UX techniques for building smarter products:TO THE NEW | Technology
 
12 Key points which make Swift more effective than Objective C
12 Key points which make Swift more effective than Objective C12 Key points which make Swift more effective than Objective C
12 Key points which make Swift more effective than Objective CTO THE NEW | Technology
 
An introduction to Object Oriented JavaScript
An introduction to Object Oriented JavaScriptAn introduction to Object Oriented JavaScript
An introduction to Object Oriented JavaScriptTO THE NEW | Technology
 
(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software
(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software
(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape SoftwareTO THE NEW | Technology
 
MongoDB using Grails plugin by puneet behl
MongoDB using Grails plugin by puneet behlMongoDB using Grails plugin by puneet behl
MongoDB using Grails plugin by puneet behlTO THE NEW | Technology
 
BigData Search Simplified with ElasticSearch
BigData Search Simplified with ElasticSearchBigData Search Simplified with ElasticSearch
BigData Search Simplified with ElasticSearchTO THE NEW | Technology
 

Mais de TO THE NEW | Technology (20)

10 Best Node.js Practices you Need to Know!
10 Best Node.js Practices you Need to Know!10 Best Node.js Practices you Need to Know!
10 Best Node.js Practices you Need to Know!
 
10 Pragmatic UX techniques for building smarter products:
10 Pragmatic UX techniques for building smarter products:10 Pragmatic UX techniques for building smarter products:
10 Pragmatic UX techniques for building smarter products:
 
12 Key points which make Swift more effective than Objective C
12 Key points which make Swift more effective than Objective C12 Key points which make Swift more effective than Objective C
12 Key points which make Swift more effective than Objective C
 
Gulp - The Streaming Build System
Gulp - The Streaming Build SystemGulp - The Streaming Build System
Gulp - The Streaming Build System
 
Grails Spring Boot
Grails Spring BootGrails Spring Boot
Grails Spring Boot
 
AWS Elastic Beanstalk
AWS Elastic BeanstalkAWS Elastic Beanstalk
AWS Elastic Beanstalk
 
Content migration to AEM
Content migration to AEMContent migration to AEM
Content migration to AEM
 
AWS CodeDeploy
AWS CodeDeployAWS CodeDeploy
AWS CodeDeploy
 
Big Data Expertise
Big Data ExpertiseBig Data Expertise
Big Data Expertise
 
An introduction to Object Oriented JavaScript
An introduction to Object Oriented JavaScriptAn introduction to Object Oriented JavaScript
An introduction to Object Oriented JavaScript
 
Object Oriented JavaScript - II
Object Oriented JavaScript - IIObject Oriented JavaScript - II
Object Oriented JavaScript - II
 
MongoDb and NoSQL
MongoDb and NoSQLMongoDb and NoSQL
MongoDb and NoSQL
 
(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software
(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software
(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software
 
MongoDB using Grails plugin by puneet behl
MongoDB using Grails plugin by puneet behlMongoDB using Grails plugin by puneet behl
MongoDB using Grails plugin by puneet behl
 
Cloud Formation
Cloud FormationCloud Formation
Cloud Formation
 
BigData Search Simplified with ElasticSearch
BigData Search Simplified with ElasticSearchBigData Search Simplified with ElasticSearch
BigData Search Simplified with ElasticSearch
 
JULY IN GRAILS
JULY IN GRAILSJULY IN GRAILS
JULY IN GRAILS
 
Grails Spock Testing
Grails Spock TestingGrails Spock Testing
Grails Spock Testing
 
Getting groovier-with-vertx
Getting groovier-with-vertxGetting groovier-with-vertx
Getting groovier-with-vertx
 
Introduction to Kanban
Introduction to KanbanIntroduction to Kanban
Introduction to Kanban
 

Último

Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 

Último (20)

Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 

Google Cast

  • 1.
  • 3. Agenda 1.Google CastIntroduction 2.Design Checklist 3.Requirement Study 4.Developing App using Google Cast 5.Technical Details 6. Limitations
  • 4.  Google Cast is a technology that enables multi-screen experiences and lets a user send and control content like video from a small computing devices like a phone, tablet or laptop to a large display device liketelevision  Google Cast allows Android and iOS mobile apps and Chrome web apps to “cast” content -like video, audio, and screen sharing (mirroring) - to Cast-ready devices like a Chromecast  The Google Cast SDK was released on February 3, 2014 4 Google Cast
  • 5.  Whenevera query isrun • Directly after a controller action completes, ifno exceptions are thrown • Directly before a transaction is committed. Example def album=Album.get(1) album.title ="Change It" def otherAlbums =Album.findAllWhereTitleLike("%Change%") assert otherAlbums.contains(album) 5 Automatic Session Flushing
  • 6. 1.Cast Base: Sender and Receiver both connected to same WiFi network. There are two ways users can start a Cast session: 1. Connect & play: Connect to a Cast receiver before playing content 2. Play & connect: Connect to a Cast receiver while playing content 2.CastButton: The cast button invokesa menu to connect, control and disconnect from Cast receivers. 3.Cast Menu: The devices menu isshown wheneverthe cast button ispressed. The cast menu lets users connect, control and disconnect from Cast receivers. 6 Design Checklist
  • 7. 4.SenderApp: When content is casting / playing on a Cast receiver, the user must always be able to control it from the sender app. 5.Receiver App: The devices menu isshown wheneverthe cast button ispressed. The cast menu lets users connect, control and disconnect from Cast receivers. 7 Design Checklist
  • 8. 1.Minimum Android SDK version that the Cast SDK supports is 9 (GingerBread) 2.The Google Play services library need to be referenced inside the application element. 3.Cast application development involves development of Sender and Receiver applications. 4.You need to register your application in order to get application ID (which will be used in both “sender” and “receiver” applications). https://cast.google.com/publish/ 5. Pay the one time $5 registration fee 6. Register your Google Cast device so that it may access your receiver application before you publish it. 8 Requirements
  • 9. 1.Create empty Android application and add the following libraries as dependencies: android-sdkextrasandroidsupportv7appcompat android-sdkextrasandroidsupportv7mediarouter android-sdkextrasgooglegoogle_play_serviceslibprojectgoogle- play-services_lib 2.Meta-data elementis required in manifest: <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> 3.Application’s theme: android:theme="@style/Theme.AppCompat" 9 Developing Sender App
  • 10. Developing Sender App 1 0 4.Addingthe Cast Button: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" > <item android:id="@+id/media_route_menu_item" android:title="@string/media_route_menu_title" app:actionProviderClass="android.support.v7.app.MediaRouteActionProvider" app:showAsAction="always"/> </menu> 5.Classes used: MediaRouter MediaRouteSelector Cast CastDevice GoogleApiClient
  • 11. Sender app starts MediaRouter device discovery: MediaRouter.addCallback MediaRouter informs user selected: MediaRouter.Callback.onRouteSelected Sender app retrieves CastDevice instance: CastDevice.getFromBundle Sender app creates a GoogleApiClient: GoogleApiClient.Builder Sender app connects the GoogleApiClient: GoogleApiClient.connect SDK confirms: GoogleApiClient.ConnectionCallbacks.onConnected Sender app launches the receiver app: Cast.CastApi.launchApplication SDK confirms: ResultCallback<Cast.ApplicationConnectionResult> Creates a communication channel: Cast.CastApi.setMessageReceivedCallbacks Sender sends a message to the receiver: Cast.CastApi.sendMessage 10 Sender application flow
  • 12.  “Receiver” application is a special form of Web application that can run on a Chromecast device  Functions of Receiver Application: 1.Provides an interface to display the app's content. 2.Handles messages from the sender application to control content on the receiver device. 3. Handles custom messages from the sender application that are application-specific 12 Developing Receiver App
  • 13. 1.Styled Media Receiver: Pre-built receiver application hosted by Google that is designed for streaming audio and video content 2.Custom Receiver: Ifapp provides content such as a game or image gallery, requires DRM, or requires support for media types. Itis an HTML5 app that you host on your own servers using the JavaScript Receiver API. 3.Default Media Receiver: Itdoes not require you to register with the Google Cast SDK Developer Console, but you cannot customize any of the UI. CastMediaControlIntent.DEFAULT_MEDIA_RECEIVER_APPLICATION_ID 13 Types of Receiver Application
  • 14. 1.Use same WiFi network for both sender and receiver device 2.Supported Image formats :BMP, GIF, JPEG, PNG,WEBP 3.Supported Audioformats: MP3, Vorbis, Wav 4.Streaming protocols: MP4,WebM 5.Media Player Library supported types: PlayReady, Widevine 6.Optimized android apps: Youtube, Netflix, Google Music, Google Movies 7.Download the Google Cast Extension for Crome browser: https://chrome.google.com/webstore/detail/google-cast/ 14 Technical Details
  • 15. 1.The Cast device is a low-power device with memory, CPU, and GPU limitations, so the receiver application should be as lightweight as possible 2.Tabs, windows or popups cannot be created in the receiver app, and there should be nothing on the receiver device screen requiring input. All interaction with the application must be done through a sender application 3.Only one video element may be active at any time 4.Video compositing, manipulation, transformations, rotations or zooming are not supported 15 Limitations
  • 16. Contact us Our Office Client Location Here’s how TOTHENEW uses GoogleCast for MOBILITY! Click Here To Know More! Have more queries on MOBILITY? Talk To Our Experts