Physical Web is an important component for the Smart Cities and for monetizing IoT projects. This talk explain what is it and how to implement it using Eddystone protocol.
9. Confidential and Proprietary9
What is a Beacon ?
Movies are worth a 1000 slides, so…
https://www.youtube.com/watch?v=JrRS8qRYXCQ
https://www.youtube.com/watch?v=3QFrZjvp2E0
https://www.youtube.com/watch?v=mc3KmbfxuUQ
@jeffprestes#physicalwebbr
31. var Beacon = require('./node_modules/eddystone-beacon/lib/beacon');
beacon = new Beacon();
var options = {
txPowerLevel: -22, //override TX Power Level, default value is -21
tlmCount: 2, // 2 TLM frames
tlmPeriod: 10 // every 10 advertisements
};
beacon.advertiseUrl('http://www.maquinataxi.com', [options]);
@jeffprestes#physicalwebbr
32. Code Source
example to detect URL
Physical Web App
https://play.google.com/store/apps/details?id=physical_web.org.physicalweb
https://itunes.apple.com/us/app/physical-web/id927653608?mt=8
@jeffprestes#physicalwebbr
33. 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#physicalwebbr
34. 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#physicalwebbr
35. 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#physicalwebbr
47. I’d love to hear
your questions.
Thanks.
Jeff Prestes
@jeffprestes
linkedin.com/in/jeffprestes
Slideshare.com/jeffprestes
Github.com/jeffprestes
www.novatrix.com.br
Notas do Editor
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?
An effort to enable frictionless discovery of web content relating to one’s surroundings.
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?
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?
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?
QRCodes & RFID are outdates | Bring context
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?
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
https://ppd.io/jb
https://ppd.io/jy
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
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
https://www.youtube.com/watch?v=mc3KmbfxuUQ
https://www.youtube.com/watch?v=mc3KmbfxuUQ
An effort to enable frictionless discovery of web content relating to one’s surroundings.