How to achieve Wi-Fi display after connecting Wi-Fi directly

I want to make an application to display Wi-Fi on my Android phone (HongMi). My phone version for Android 4.2.2

I modified the WiFiDirectActivity example and tried to combine it with this Miracast-Sample project . I know that I need to connect two devices via Wi-Fi Direct (Wi-Fi P2P) before mirroring the screen to another (Wi-Fi display). I register DisplayListener in onResume () (and unregister in onPause ()). I also register BroadcastReceiver to listen to a P2P Wi-Fi message.

I can get a Wi-Fi P2P message whenever I connect / disconnect via Wi-Fi P2P. But I can not get anything with my DisplayListener after connecting. My DisplayListener doesn't even work.

My problem is that after I connected the two devices, a new second screen may be displayed, or why DisplayListener does not start.

thanks for the help

+5
source share
1 answer

I think this is what you are looking for: https://github.com/textview10/TestH264Player . Explanation in Chinese. Hope this helps.

0
source

Source: https://habr.com/ru/post/1535302/


All Articles