I want to develop an AP to share (SOURCE) screen to another (SINK) device by using WiFi direct connection.
I successfully connect two devices via Wifi direct API but getPresentationDisplay()
returns null. It seems SOURCE device does not find any additional display service exported by SINK device. Does API level 4.2.2 support it? Or is any API that I can register the display service to SOURCE?
//Get Media router service
mMediaRouter = (MediaRouter) getSystemService(Context.MEDIA_ROUTER_SERVICE);
MediaRouter.RouteInfo route = mMediaRouter.getSelectedRoute(MediaRouter.ROUTE_TYPE_LIVE_VIDEO);
if (route != null) {
Display presentationDisplay = route.getPresentationDisplay();
if (presentationDisplay != null) {
Presentation presentation = new DemoPresentation(this, presentationDisplay);
Log.i("tracer", "presentation.show();");
presentation.show();
}
}