AgregoreWeb / agregore-mobile

Mobile version of the Agregore browser for Android, based on Chromium and Bromite
MIT License
31 stars 6 forks source link

Add Wifi P2P #13

Closed RangerMauve closed 2 years ago

RangerMauve commented 2 years ago
RangerMauve commented 2 years ago

Useful resources:

RangerMauve commented 2 years ago

The big eureka moment for getting stuff working was to use multicastSocket.setNetworkInterface(p2pInterface) in addition to specifying the interface for joinGroup.

Huge thanks to this Stack Overflow post: https://stackoverflow.com/a/62418119

RangerMauve commented 2 years ago

Initial demo app seeing if any of this is even possible is here: https://github.com/RangerMauve/WifiP2P-MDNS-Test/blob/default/app/src/main/java/com/example/wifip2p_mdns_test/WifiP2PActivity.java

RangerMauve commented 2 years ago

Got the initial WifiAutoConnect library published: https://github.com/RangerMauve/WifiAutoConnect-Android

Next steps will be to integrate it with Agregore Mobile with a button somewhere.

RangerMauve commented 2 years ago

Had to start using Trichrome in order to set the min SDK to 29 and work with the WifiP2p APIs.

As a result, the build will now output AAB files instead of APKs which we will need to turn into APKs with bundletool

I'll try adding a script to use the universal APK for ease of installation.

RangerMauve commented 2 years ago

Initial integration is done! We no have a button to auto-connect devices over wifi (requires Android 10)