, 15 2017 . 11:26
+
. , , , , -.
- Wi-Fi Direct (Wi-Fi Peer-to-Peer Wi-Fi Direct).
Wi-Fi Direct?
: ? :
- Bluetooth
- Wi-Fi Hotspot
- Wi-Fi Direct Wi-Fi Peer-to-Peer
Bluetooth
. , 10 .
Wi-Fi Hotspot
, Wi-Fi . , , , .
Wi-Fi Hotspot (
Portal,
SHAREit).
Wi-Fi Direct Wi-Fi Peer-to-Peer
:
- - ( , )
-
- Wi-Fi
- API 14 (Android 4.0)
, Wi-Fi Peer-to-Peer, , , . - .
Wi-Fi Aware
, .. , . Wi-Fi Aware .
,
by developer.android.com . . ,
sample by Google.
, Google , . , , .
, , Wi-Fi Direct . ChatActivity.
: Wi-Fi Direct , - . Chat-.
. .
:
- ( )
-
-
- ( , , ( broadcast))
-:
, , .
-. , .
Serializer/Deserializer . :
, .. . , . , . , . . , .
- WifiDirectManager ; , , ,
- WifiP2pDeviceObservable Observable; Wi-Fi Direct
- WifiDirectBroadcastReceiver Wi-Fi Direct (: ), Wi-Fi ( )
- MessageShaper / ; android.os.Message (obj , what (: ), arg1 ( , , broadcast))
- Serializer /
- Status ,
- ChatNeedle , ; input/output ; ChatNeedle , - -
- Member , ( ), ; ChatNeedle
- MemberList , , ; ,
- GroupOwnerSocketHandler - ,
- ClientSocketHandler
(> 2 ), - . ( Wi-Fi Peer-to-Peer), . ( , ) , .
Wi-Fi Direct Wi-Fi , , .
, , , . , config'a, , .
config, :
- ,
- wps.setup , :
- groupOwnerIntent (!), , ; , 0 15 (0 , 15 ); -1,
final WifiP2pConfig config = new WifiP2pConfig();
config.deviceAddress = deviceAddress;
config.wps.setup = WpsInfo.PBC;
config.groupOwnerIntent = status.getIntent();
mWifiP2pManager.connect(mWifiP2pManagerChannel, config, null);
Status' (enum) , GroupOwner, Client.
. , , , , . , .
, .
. .
, - , Wi-Fi Peer-to-Peer . Wi-Fi Direct, .
, . .
->
GitHub
( wifidirect -)
https://habrahabr.ru/post/333388/
:
author chelsenok
android
android os
android development
wi-fi direct
library
wi-fi
wi-fi peer-to-peer
bicycle