...The service assumes that if Wi-Fi data transfer rate is less than 64KiB per minute for 15 minutes in a row then there's no application that actively uses Wi-Fi.
Also this app can turn Wi-Fi off if there's no signal for 1 minute.
Google Play page:
https://play.google.com/store/apps/details?id=net.alkatrazstudio.wifiidletimeout
WiFi Direct File Transfer is a experimental app that will allow sharing of data between Android devices running Android 4.0 or higher using a WiFi direct connection without the use of a WiFi access point. This will enable data transfer between devices without relying on any existing network infrastructure
Logical Neighborhoods is a a high-level programming abstraction for wireless sensor networks that simplifies the development of fully distributed, embedded networked applications.