When watching for example YouTube, a small icon appears on the phone (top right, looks like a box with an arrow). Clicking it sends the video, picture etc to the TV.
This doesn't seem to be 100% correct...
The android app sends the url of some media content to the Chromecast and the Chromecast itself downloads/streams and plays the media.
I didn't realise this before i purchased my Chromecast - i too thought the android app was streaming the content to the Chromecast.
The Chromecast seems to be more of a wireless connected streaming media device which can be controlled by android apps, iOS apps and Chrome desktop browser.
There's android apps which allow you to display media from the android device (pics, music and video) on the Chromecast and i'm guessing that these apps create their own media server and send the Chromecast a url to the media server within the android app.
If i'm right then you won't be able to create an android/b4a application with say a WebView and simply tell the Chromecast to display that WebView.
This is all guesswork at this stage, i'm working my way through some tutorial documents and will post again...
Martin.