Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Nearby Notifications – annoy your friends!

Nearby Notifications – annoy your friends!

Radek Piekarz

December 08, 2016
Tweet

More Decks by Radek Piekarz

Other Decks in Programming

Transcript

  1. Nearby Notifications – annoy your friends! +RadoslawPiekarz @radzio

  2. None
  3. None
  4. None
  5. Agenda History iBeacon Eddystone Using Beacons before 2016 Using Beacons

    now Nearby notifications Physical Web @lukaszbyjos
  6. Beacons

  7. 2011 2012 2013 Apple launches iBeacon technology Android 4.3 supports

    Bluetooth 4.0 2014 2015 2016 iPhone 4S First smartphone with Bluetooth 4.0 Google launches Eddystone specifications Physical Web support on Google Chrome v. 49 for Android Nearby Notifications
  8. None
  9. 7.12.2016

  10. More than 371 million Bluetooth enabled beacons are projected to

    ship by 2020 research by ABI Research
  11. iBeacon • iBeacon protocol supports both iOS and Android •

    Beacon manufacturer need to be vetted by Apple to be iBeacon compliance • iBeacon transmits simple data fields like UUID, Major ID, and Minor ID.
  12. Eddystone • Eddystone supported beacons can emit three different frame

    type signals • All three frame types are supported by both Android and iOS • Open standard / open source (github.com/google/eddystone)
  13. Eddystone-UID • Similar to iBeacon, the beacon which supports Eddystone

    UID needs an app to receive designated UID for the app to recognize • Eddystone’s UID have 16 digit strings to identify a beacon uniquely, 10 character Namespace to identify an entity / organization and a 6 character Instance to identify individual beacons • Eddystone-EID
  14. Eddystone-URL • Eddystone URL supported beacons does not require an

    app to catch the data transmitted from it but it requires a beacon supported browser installed. • Eddystone URL broadcasts a URL, which can link to any site. • This is basically for the “Physical Web”, where developer can put content which everyone can access it. (http://google.github.io/physical- web/)
  15. Eddystone-TLM • These beacons send Eddystone UID, Eddystone URL and

    beacons health status like battery life, diagnostic data etc. • These are mainly intended for beacons fleet management and they transmits data less frequently compared to other two.
  16. Beacons and Android before 2016

  17. Scanning for beacons BluetoothAdapter BluetoothAdapter.LeScanCallback mLeScanCallback = new BluetoothAdapter.LeScanCallback(){ @Override

    public void onLeScan(final BluetoothDevice device, int rssi, byte[] scanRecord){ } }; device - Identifies the remote device rssi - The RSSI value for the remote device as reported by the Bluetooth hardware. scanRecord - The content of the advertisement record offered by the remote device.
  18. Scanning for beacons BluetoothAdapter BluetoothAdapter.LeScanCallback mLeScanCallback = new BluetoothAdapter.LeScanCallback(){ @Override

    public void onLeScan(final BluetoothDevice device, int rssi, byte[] scanRecord){ } }; device - Identifies the remote device rssi - The RSSI value for the remote device as reported by the Bluetooth hardware. scanRecord - The content of the advertisement record offered by the remote device.
  19. Battery? = My Super App Shopping App Public Transport App

    Beacon scanning background service Beacon scanning background service Beacon scanning background service
  20. Battery? = Beacon Scanning Service My Super App Shopping App

    Public Transport App BroadcastReceiver BroadcastReceiver BroadcastReceiver Google Play Services
  21. Nearby API googleApiClient = new GoogleApiClient.Builder(fragmentActivity) .addApi(Nearby.MESSAGES_API) .addConnectionCallbacks(this) .enableAutoManage(fragmentActivity, this)

    .build(); googleApiClient.connect();
  22. Nearby API SubscribeOptions options = new SubscribeOptions.Builder() .setStrategy(Strategy.BLE_ONLY) .build(); Nearby.Messages.subscribe(googleApiClient,

    getPendingIntent(), options) .setResultCallback(new MyResultCallbacks())
  23. Nearby API private PendingIntent getPendingIntent() { Intent intent = new

    Intent(context, BeaconMessageReceiver.class); return PendingIntent.getBroadcast(context, REQUEST_CODE, intent, PendingIntent.FLAG_UPDATE_CURRENT); }
  24. Nearby API public class BeaconMessageReceiver extends BroadcastReceiver { @Override public

    void onReceive(Context context, Intent intent) { Nearby.Messages.handleIntent(intent, new MessageListener() { @Override public void onFound(Message message) { } @Override public void onLost(Message message){ } }); }
  25. Nearby API • We don’t have to deal with bluetooth

    runtime permissions • But we need to ask user to allow Nearby
  26. Nearby API – beacons dashboard

  27. None
  28. Nearby notifications?

  29. Nearby notifications • Get a beacon (or make one!)

  30. Nearby notifications • Get a beacon (or make one!) •

    Register it in Google Beacon Dashboard
  31. Nearby notifications • Get a beacon (or make one!) •

    Register it in Google Beacon Dashboard • Configure notifications
  32. None
  33. Nearby notifications ( Kraków & JakDojade.pl)

  34. Nearby notifications

  35. Takeaways #1 • Only https:// addresses are supported • Scan

    is performed only when screen is turning on • App intents are currently available only for Google Partners
  36. Takeaways #1 • Only https:// addresses are supported • Scan

    is performed only when screen is turning on • App intents are currently available only for Google Partners • App intent are available for anyone!
  37. Physical Web

  38. Physical Web • Open standard that everyone can use •

    No proactive notifications • Open Source • BLE energy efficient & widespread • Built on web and urls • Can use mDNS too • Context is the king • Connect digital and real world • Use Eddystone URL beacons • Supported by Chrome for Android, Opera for Android
  39. Physical Web

  40. Takeaways #2 • With great power comes great resposibility •

    Nearby API is easy and energy efficient • Nearby Notifications are the most easy way to start using Beacons on Android
  41. Q&A +RadoslawPiekarz @radzio http://bit.ly/nearby_feedback