kunal
kunal

Reputation: 328

screencasting in android using HDMI wifi dongle

I have been searching a lot for implementing screen cast(miracast) in android and got more confused. I have a HDMI wifi dongle. Now as i plug the dongle and open my app need to search for available devices and as user selects devices the mirroring should start and my screen need to reflect to the device which has plug the device. For now From settings we need to go to display and turn wireless display on and connect to them. As of now i tryed to do this by WifiP2pManager class and got a list of device and connected to my device. But it is not showing as connected on settings wireless display which need to be connected for screen casting. Now my question is can i start that casting from my app and how ?

Upvotes: 2

Views: 1678

Answers (2)

ph0b
ph0b

Reputation: 14473

there is no public API that allows you to manipulate directly the connection, but you can integrate an action that should do what you want, through the MediaRouteActionProvider

MediaRoute Button

Using this, you can display a button inside your action bar. When the user will click on it, it will show the list of paired devices and do a quick scan. From there, the user will be able to directly initiate the connection to an available device.

It's working on most devices, simply not returning the action on those that don't have any paired devices or don't support Miracast (+some Samsung's that don't use the MediaRoute system for Miracast connection).

Upvotes: 2

CommonsWare
CommonsWare

Reputation: 1006944

I need to have have a button that simply starts miracast(mirroring)

That's not possible through the Android SDK, sorry. Whether there is a way for an app running with superuser privileges on a rooted device to do it, I cannot say.

Upvotes: 1

Related Questions