From the Google documentation about adding a Cast button, https://developers.google.com/cast/docs/android_sender#adding-the-cast-button , it seems like the option they provide is for us to add a static button to the Action Bar. That said, what would I do if I wanted to add a Cast Button to my application only if there's a device on the network dynamically? Also, what are some ways you would create a custom button that mimic the functionality of a MediaRouter Button.
Any input would be appreciated!
Based on your response in the comments, it seems like you want the normal behavior of a cast button, provided by, say, the MediaRouteActionProvider except that you don't want the cast discovery to include "guest mode". Is that a fair rephrasing of your question? If that is the case, then you can simply use the MediaRouteActionProvider and when you add your app in the developer console, you can uncheck the box that says "Supports Google Cast Guest Mode". Then guest mode (i.e. discovery of your app when not on wifi) is disabled for app and only devices that are on the same wifi network as your phone will be discoverable for your app.