This project is a proof of concept on establishing a P2P connection between two or more android-devices, and make them communicate using Multicast (UDP). This is accomplished by utilizing the WiFi P2P API, also known as WiFi Direct.
If you encounter problems, see "troubleshooting" section further down.
- Install Java Development Kit
- Install Android Studio Bundle
- Set up Android SDK with Android Support Library
- Install Git
- Check out the project from GitHub repository
- Import project in Android Studio
- All devices you want to connect to each other have to search for each other simultaneously. This is because each device will not advertise itself to other devices until the discovery process is started.
- If you disconnect from a WiFi Direct network, you have to run the discovery process again before trying to reconnect. If you don't, you will get a "Busy"-error, and you may have to turn WiFi on your phone off and on again.
- Android Studio cannot find git.exe (Create process error=2)
- Android Studio cannot find JDK
- Android Virtual Devices does not support WiFi, so testing the app on a physical device is recommended.
- WiFi Direct on devices with older Android-versions than 4.2 Jelly Bean has several bugs. Issue tracker
- "Message not multicasted" when trying to send messages
- Minimum SDK version: 16
- Target SDK version: 21