So currently i am trying to connect with speakers which works pretty well for the devices below android Pie. But for the particular devices (Samsung Galaxy S10, vivo,Samsung Galaxy A50) with android pie version i am getting null socket which leads to speakers not found for these particular devices.
Also, I came across weird scenario: when I turned on airplane mode, speaker are getting detected. which is not the correct solution for me.