4. To be more fun…
first install
Physical Web clients
@jeffprestes#physicalweb
iOS – Physical Web
https://itunes.apple.com/ca/app/physical-web/id927653608?mt=8
Android – Physical Web
https://play.google.com/store/apps/details?id=physical_web.org.physicalweb
23. MainActivity.java
protected void onResume() {
super.onResume();
BluetoothManager btManager = (BluetoothManager) getSystemService(BLUETOOTH_SERVICE);
BluetoothAdapter btAdapter = btManager != null ? btManager.getAdapter() : null;
if (btAdapter == null) {
finish();
return;
}
if (checkIfUserHasOptedIn()) {
ensureBluetoothIsEnabled(btAdapter);
showNearbyBeaconsFragment();
} else {
// Show the oob activity
// Webview to: https://google.github.io/physical-web/mobile/android/getting-started.html
Intent intent = new Intent(this, OobActivity.class);
startActivity(intent);
}
}
@jeffprestes#physicalweb
24. NearbyBeaconsFragment.java
public void onResume() {
super.onResume();
getActivity().getActionBar().setTitle(R.string.title_nearby_beacons);
getActivity().getActionBar().setDisplayHomeAsUpEnabled(false);
getListView().setVisibility(View.INVISIBLE);
mDiscoveryServiceConnection.connect(true);
}
public synchronized void connect(boolean requestCachedPwos) {
if (mDiscoveryService != null) {
return;
}
mRequestCachedPwos = requestCachedPwos;
Intent intent = new Intent(getActivity(), PwoDiscoveryService.class);
getActivity().startService(intent);
getActivity().bindService(intent, this, Context.BIND_AUTO_CREATE);
}
@jeffprestes#physicalweb
25. PwoDiscoveryService.java
/**
* This is a service that scans for nearby Physical Web Objects.
* It is created by MainActivity.
* It finds nearby ble beacons, and stores a count of them.
* It also listens for screen on/off events
* and start/stops the scanning accordingly.
* It also silently issues a notification informing the user of nearby beacons.
* As beacons are found and lost, the notification is updated to reflect
* the current number of nearby beacons.
*/
public class PwoDiscoveryService extends Service
private void initialize() {
mNotificationManager = NotificationManagerCompat.from(this);
mPwoDiscoverers = new ArrayList<>();
mPwoDiscoverers.add(new BlePwoDiscoverer(this));
for (PwoDiscoverer pwoDiscoverer : mPwoDiscoverers) {
pwoDiscoverer.setCallback(this);
}
...
}
@jeffprestes#physicalweb
Open Protocol Designed by Google
You can have a specific device like Estimote Beacons, or you can use a Rfduino, or BLE module for Arduino, or a Bluetooth 4.0 dongle on a Raspberry Pi, or use a computer that has Bluetooth 4.0 module to advertise data. You can create your own implementation in Node, Python, Java, etc…
What data should I advertise?
https://ppd.io/jb
https://ppd.io/jy
https://github.com/don/node-eddystone-beacon
https://github.com/sandeepmistry/bleno#running-on-linux
It supports inform his temperature
It supports inform a counter that informs the number of time it has emitted data frames. Useful to control performance.
The main reason
Old UriBeacon
Secure: the important information is in your website not into the device
It’s a backbone for Physical Web
https://ppd.io/jb
https://ppd.io/jy
https://github.com/don/node-eddystone-beacon
https://github.com/sandeepmistry/bleno#running-on-linux
It supports inform his temperature
It supports inform a counter that informs the number of time it has emitted data frames. Useful to control performance.
The main reason
Old UriBeacon
Secure: the important information is in your website not into the device
It’s a backbone for Physical Web
The main reason
Old UriBeacon
Secure: the important information is in your website not into the device
It’s a backbone for Physical Web
The main reason
Old UriBeacon
Secure: the important information is in your website not into the device
It’s a backbone for Physical Web
The main reason
Old UriBeacon
Secure: the important information is in your website not into the device
It’s a backbone for Physical Web
It has 3 data format specification.
Like the Eddystone-UID and Eddystone-URL frame types, Eddystone-TLM is broadcast in the clear, without message integrity validation. You should design your application to be tolerant of the open nature of such a broadcast.
Eddystone beacons may transmit data about their own operation to clients. This data is called telemetry and is useful for monitoring the health and operation of a fleet of beacons.
Most known format: give an ID to your device to your mobile application be able to have a context inside of buildings where GPS signal isn’t available.
You can advertise an URL that contains data about related to something (a device, a place, or a person)
Max 17 caracters
The main reason
Old UriBeacon
Secure: the important information is in your website not into the device
It’s a backbone for Physical Web
The main reason
Old UriBeacon
Secure: the important information is in your website not into the device
It’s a backbone for Physical Web
An effort to enable frictionless discovery of web content relating to one’s surroundings.
An effort to enable frictionless discovery of web content relating to one’s surroundings.
The main reason
Old UriBeacon
Secure: the important information is in your website not into the device
It’s a backbone for Physical Web
The main reason
Old UriBeacon
Secure: the important information is in your website not into the device
It’s a backbone for Physical Web
The main reason
Old UriBeacon
Secure: the important information is in your website not into the device
It’s a backbone for Physical Web
The main reason
Old UriBeacon
Secure: the important information is in your website not into the device
It’s a backbone for Physical Web
The main reason
Old UriBeacon
Secure: the important information is in your website not into the device
It’s a backbone for Physical Web
The main reason
Old UriBeacon
Secure: the important information is in your website not into the device
It’s a backbone for Physical Web
The main reason
Old UriBeacon
Secure: the important information is in your website not into the device
It’s a backbone for Physical Web
The main reason
Old UriBeacon
Secure: the important information is in your website not into the device
It’s a backbone for Physical Web
The main reason
Old UriBeacon
Secure: the important information is in your website not into the device
It’s a backbone for Physical Web