-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathREADME
36 lines (33 loc) · 950 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#P2P4Android
## Peer to peer messaging framework for Android.
```java
P2PBluetooth p2p = new P2PBluetooth();
p2p.startBluetoothServer(this, new NetworkServiceCallback() {
@Override
public void onSuccess(NetworkService networkService) {
getOkeyApplication().setNetworkService(networkService);
networkService.registerNetworkListener(ActivityServer.this);
runOnUiThread(new Runnable() {
@Override
public void run() {
progressDialog.dismiss();
makeToast(ActivityServer.this, getString(R.string.bt_server_ready));
Button button = (Button) findViewById(R.id.start_bt_game_button);
button.setEnabled(true);
}
});
}
@Override
public void onFailure(int reason) {
runOnUiThread(new Runnable() {
@Override
public void run() {
progressDialog.dismiss();
makeToast(ActivityServer.this, getString(R.string.bt_failed_to_start_server));
//ActivityDashboard'a geri don.
finish();
}
});
}
});
```