Integrating CasaTunes and other Android Apps

Contents

IntroductionCasaTunes Custom URI schemeExample

Introduction

The CasaTunes Android App for Tablet and Phones enables launching the App from another "calling" Android App and to return control back to the calling App without requiring users to manually switch between applications.

This seamless integration is a great advantage to homeowners and integrators, as it allows them to pick and choose the best home automation and whole house music control solutions available.

This integration is made possible by Android App developers who support using an Implicit Intent to launch another Android App, like the CasaTunes App. As part of the Implicit Intent, the calling App sends along a custom URI that optionally tells the CasaTunes App which room to show and what volume, source and power settings to use for that room. Once the CasaTunes App is opened in this way, the user can easily return to the calling App by touching the Android Back button. The calling App simply creates an ACTION_VIEW Intent with the CasaTunes custom URI scheme,  described below.

CasaTunes Custom URI scheme

The CasaTunes custom URI scheme is defined as follows (and is the same as the CasaTunes iOS URL scheme):

com.CasaTunes.Tablet?key1=value1&key2=value2&key3=value3

Notes:
The “?” goes before the first key/value parameter and “&” before each additional key/value parameter
The Key/Value parameters are optional, so if you simply specified “com.CasaTunes.Tablet” with no parameters it would launch the CasaTunes App. If you supply any parameters it is a good idea to also supply the room parameter. Otherwise, the CasaTunes app will open to whichever room the user may have been controlling before, and inadvertently change the settings in that room.

The following optional parameters can be specified:

Key
Value
Room
Specifies the room name or ID of the room you want to display
Source
Specifies the name or ID of the source to set for the selected room
Playlist
Specifies the name of a CasaTunes playlist to play in the selected room
Volume
Specifies the volume level for the selected room
Power
Specifies whether the power for the selected room should be “off” or “on”

Example

com.CasaTunes.Tablet?power=on&room=office&source=1&volume=40

Start the CasaTunes App and select the Office, power on the room, switch the source to the second source (zero based), and set the volume level to 40.