2

Attempting to do DIAL discovery and launch on Sony Bravia TV (Android). NOTE: Not trying to do Google Cast... but trying to use DIAL to discover and launch an installed app. The UDP discovery SEARCH gives me this.

HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1800
DATE: Mon, 15 Aug 2016 19:09:52 GMT
EXT:
LOCATION: http: // 10.180.12.183:8008 /ssdp/device-desc.xml
OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
01-NLS: 4185dfde-1dd2-11b2-845e-c7225b044ee1
SERVER: Linux/3.10.27, UPnP/1.0, Portable SDK for UPnP devices/1.6.18
X-User-Agent: redsonic
ST: urn:dial-multiscreen-org:service:dial:1
USN: uuid:25664941-9d79-be82-aab6-39c4cdda7052::urn:dial-multiscreen-org:service:dial:1
BOOTID.UPNP.ORG: 0
CONFIGID.UPNP.ORG: 1869286273

Retrieving the LOCATION http: // 10.180.12.183:8008 /ssdp/device-desc.xml gives me this header:

Application-Url: http: // 10.180.12.183:8008 /apps/
Content-Length: 1081
Content-Type: application/xml

The content of that response is this:

<?xml version="1.0"?>
<root xmlns="urn:schemas-upnp-org:device-1-0">
  <specVersion>
    <major>1</major>
    <minor>0</minor>
  </specVersion>
  <URLBase>http: // 10.180.12.183:8008 </URLBase>
  <device>
    <deviceType>urn:dial-multiscreen-org:device:dial:1</deviceType>
    <friendlyName>MySonyTv</friendlyName>
    <manufacturer>Sony</manufacturer>
    <modelName>BRAVIA 4K 2015</modelName>
    <UDN>uuid:25664941-9d79-be82-aab6-39c4cdda7052</UDN>
    <iconList>
      <icon>
        <mimetype>image/png</mimetype>
        <width>98</width>
        <height>55</height>
        <depth>32</depth>
        <url>/setup/icon.png</url>
      </icon>
    </iconList>
    <serviceList>
      <service>
        <serviceType>urn:dial-multiscreen-org:service:dial:1</serviceType>
        <serviceId>urn:dial-multiscreen-org:serviceId:dial</serviceId>
        <controlURL>/ssdp/notfound</controlURL>
        <eventSubURL>/ssdp/notfound</eventSubURL>
        <SCPDURL>http: // www .google.com/ cast</SCPDURL>
      </service>
    </serviceList>
  </device>
</root>

Per DIAL protocol rules for DIAL REST services, I should GET info about my app using this:

http: // 10.180.12.183:8008 /apps/MyAppName

But I get a "404: Not found" and an empty text response. If I put "YouTube" or "Netflix" for the suffix instead of MyAppName, I get a meaningful XML response.

Once I get a good response to the standard DIAL REST GET query, I'm hoping to do a DIAL REST POST to the same URL to launch my app -- just as I've been able to do with other devices that support DIAL.

My questions (hopefully for Sony peronnel or Sony dev experts familiar with DIAL on Sony Android-based TV. I don't need a general DIAL tutorial on client side discovery/launch and know how to write a DIAL server if that's what I decide to do):

  1. Do the Sony Android-based TV's actualy support DIAL (not just Google Cast V2 or V3)? If so, what property within my Android app on the TV represents the app name I should use in the DIAL REST suffix?

  2. Do I need some additional entry in my TV app's AndroidManifest.xml, or perhaps also an additional resource (similar to Amazon Fire TV requiring the xml/whisperplay.xml resource which contains an xml entry "dial/application/dialid" which is used by Fire DIAL server for discovery/launch)?

  3. Anything else you can tell me about unique aspects of Sony Android-based TV implementation of the DIAL server?

NOTE: Remember... not interested in Google Cast -- I need to launch an app, not just cast standard video. Also, happy to use a proprietary discovery/launch mechanism Sony may offer... but then I'll need to know how that mechanism works, so would appreciate a link if that's the solution.

Zebra
  • 21
  • 5

1 Answers1

3

I have a 2015 Bravia, here's how I formatted my url:

http://192.168.1.100/DIAL/apps/com.sony.dtv.com.alexvas.dvr.pro.com.alexvas.dvr.activity.TvMainActivity

I dont know why the com.sony.dtv is required, but the rest of the url is made up of the app id (in this case com.alexvas.dvr.pro) followed by the activity within the app which you want to launch (com.alexvas.dvr.activity.TvMainActivity)

POSTing to that URL on port 80 launches my app.

miknik
  • 5,748
  • 1
  • 10
  • 26
  • miknik... within your app project, how did you set the app id to "com.alexvas.dvr.pro" ? – Zebra Dec 05 '16 at 22:45
  • I don't have an app project. In my example above I'm launching TinyCam Pro (an IP cam viewer app) on my TV by calling the URL when someone rings my doorbell. – miknik Dec 11 '16 at 18:59
  • You can find the app id for any app by finding it in the Play Store and then looking at the URL (either on the web, or by hitting the share button in the Google Play app). The app id is at the end of the Play Store URL, Google Maps for example is play.google.com/store/apps/details?id=com.google.android.apps.maps – miknik Dec 11 '16 at 19:03
  • launching the app works fine for me that way, but do you also know how to retrieve the launching paramters from the sony tv side? – user3333128 May 18 '17 at 08:39