Closed wiiznokes closed 1 year ago
Cool, it's nice to see the adb branch revived🙂. And yes, USB would be very helpful if on public network. I'll take a look today!
Hey, I've tested the update. There's probably bug on the C# adb server side. The desktop app shows connected even if the phone is not trying to connect.
And if you look at other 2 streamers, I usually TestClient
first before receiving data from a client. It is a trivial thing, but I feel like it is a good way to avoid unexpected connection (e.g. a local app randomly connects to pc localhost at the same port).\
Of course, I can implement that after the merge of this PR, in case you would like to work on something else🙂
Edit: Never mind, I just found that the Android app is the server here. So no need of TestClient
Hey, yes I know, I tried to solve this by getting the stream
in Connect
function
stream = mTcpClient.GetStream();
but it connect anyway, idk what to do.
but it connect anyway, idk what to do.
I just took another look into it. The adb
first forwards port from pc to android device.\
So here connect
from pc is connecting to the local port on localhost. Once adb
has started port forwarding, the connection from pc app may always be successful. But the Android device is not necessarily listening on the other side.
I think a better approach is to let PC acting as a server, and do adb reverse
, the opposite of port forwarding to allow Android connect talk to PC as a client.
SharpAdbClient: adb reverse
Ok good then, I'm not sure to fully understand this approach so you can implement it if you want. I also implemented a way to choose port in Android side but idk if it's useful, I'm too lazy to do it on Windows side lol.
Haha sounds good! Let me know when you have finished so I'll merge and apply the changes.
It's good, you can merge it👍
Hey, I've updated to use adb reverse
. Should be working well now.\
Btw the streamer is in essence TCP connection, so the implementation is very similar to the WifiStreamer
😂
I just tested, it work really well, tanks👍
I implemented the communication via USB adb thanks to the other branch. I needed usb because I'm on a public network so it's perfect. Not as fast as wifi but faster than bluetooth.
We need to first click the connect button with Android and then Windows.