Hack your business android+beacons+big data
-
Upload
tushar-choudhary -
Category
Software
-
view
174 -
download
3
description
Transcript of Hack your business android+beacons+big data
![Page 1: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/1.jpg)
Hack your Business
with android +
beacons + big data
Tushar Choudhary
Mobile consultant, Xebia
![Page 2: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/2.jpg)
Agenda
What, Why & How
Bluetooth versus BLE
Beacons & GPS
Case Study
Android & Beacons
Dummy App
![Page 3: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/3.jpg)
Beacons : What They Are ? How They work ? Why They are Important ?
![Page 4: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/4.jpg)
What are Beacons ?
• Beacons are small piece of hardware devices that can emit and receive BLE signals.
![Page 5: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/5.jpg)
Beacons
![Page 6: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/6.jpg)
Bluetooth Technology ?
• Radio
• Software Stack
![Page 7: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/7.jpg)
Bluetooth LE : What is it ?
A Specification With
A New Radio, New Software stack & New Profile Architecture
• Used to create Bluetooth LE chipsets - e.g. contact chipsets
• Chipsets are embedded in the devices
![Page 8: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/8.jpg)
Bluetooth Classic Vs Bluetooth LE
Voice Data Audio Video State
Bluetooth X Y Y X X
BLE X X X X Y
![Page 9: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/9.jpg)
Bluetooth Classic Vs Bluetooth LE
Bluetooth BLE
Connection Connection Oriented Connectionless
Data Payload 2 Mbps ~ 100 Kbps
Power Consumption
High Low
Transmission File Transmission State Transmission
![Page 10: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/10.jpg)
Currently Supported by devices :
GOOGLE Nexus 4,5,7,10
GPS Cameras
Security Equipments Laptops
![Page 11: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/11.jpg)
90% of devices will be BLE enabledby 2018
![Page 12: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/12.jpg)
Beacons/BLE : How They Work ?
• BLE enabled devices or Beacons can transmits small packets of data.
• This wakes up a “listener/receiver” to let it know that it’s there.
• Which then lets you calculate the proximity to the Beacon and show relevant information to visitors.
![Page 13: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/13.jpg)
Beacon Data Packet
![Page 14: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/14.jpg)
Why are Beacons important ?
Advantage to Developers
Before BLE After BLE
An app would need to be running
in the foreground or background
to communicate with a BLE
device.
An app can be launched into
background if a specific BLE
device is recognized.
![Page 15: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/15.jpg)
Beacons & GPS
• Beacons can be thought as an extension of location technology.
• It’s lot like GPS but uses a lot less battery.
• GPS does not work well once you go inside but Bluetooth LE works.
![Page 16: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/16.jpg)
Beacons & GPS
GPS is a Location Technology
Bluetooth LE is a Proximity Technology.
![Page 17: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/17.jpg)
Beacons : Proximity
![Page 18: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/18.jpg)
Why Proximity Matters ?
We can now deliver the content and experiences to users based on precise proximity to things in physical world
![Page 19: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/19.jpg)
Customer Passes By a Retail Store
![Page 20: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/20.jpg)
Customer Receives Notifications and Offers
![Page 21: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/21.jpg)
Indoor Navigation : Showing the Route
![Page 22: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/22.jpg)
Indoor Navigation : Showing the Route
![Page 23: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/23.jpg)
Indoor Navigation : Showing the Route
![Page 24: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/24.jpg)
Indoor Navigation : Showing the Route
![Page 25: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/25.jpg)
Indoor Navigation : Showing the Route
![Page 26: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/26.jpg)
Presence Detection via Proximity
![Page 27: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/27.jpg)
Navigating Customer
![Page 28: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/28.jpg)
Showing Other Offers
![Page 29: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/29.jpg)
Pushing Notifications
![Page 30: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/30.jpg)
Case Study : Retail Business
• Greet Customers when they arrive.
• Send special offers and coupons at specific locations on store.
• Offer personal pricing.
• Implementing proximity driven ad-screen.
![Page 31: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/31.jpg)
Real-TimeAnalytics & Statistics
![Page 32: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/32.jpg)
Real-TimeAnalytics & Statistics
![Page 33: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/33.jpg)
Statistics & Analytics : Retail Business
• Aggregate and analyze behavior and traces of the customers.
• Analyze interests and shopping decisions of your customers -‐ in your shop but even off location.
• Be able to take action on customers behavior and feedbacks.
![Page 34: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/34.jpg)
• Increase in-store visitor experience.
• Optimize Target Online Marketing.
• Have meaningful dashboards at your fingertips
• Run cross-dataset analysis, do peer comparisons, and generate actionable report
Statistics & Analytics : Retail Business
![Page 35: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/35.jpg)
Android BeaconsSupported on Android API >= 4.2
• All android devices above 4.2 have BLE enabled in itselves.
• They can act as a Receiver/Listener and can wake up once supported application receives a signal
• Android Devices having version > 4.4 i.e. Android-L devices can also act as a BLE Transmitter
![Page 36: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/36.jpg)
Android Beacons & Support Libraries
Android Beacon Library:https://github.com/AltBeacon/android-beacon-library-reference
Smart Gatt Library:
https://github.com/movisens/SmartGattLib
Bluetooth LE Library Android:
https://github.com/alt236/Bluetooth-LE-Library---Android
![Page 37: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/37.jpg)
Practical Use Case
Luggage Tracker
![Page 38: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/38.jpg)
Use Case : Luggage Tracker
1. Implement a broadcast receiver to catch broadcasts for turning bluetooth on and off.
2. Start a service when bluetooth turns on.
3. Stop service when bluetooth turns off
4. Register a listener to listen for nearby beacon devices
![Page 39: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/39.jpg)
Implementing Broadcast Receiver@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
if
(BluetoothAdapter.ACTION_STATE_CHANGED.equals(intent.getAction())) {
int state =
intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, -1);
Intent i;
switch (state) {
case BluetoothAdapter.STATE_OFF:
if (MyBeaconService.isStarted) {
i = new Intent(context,
MyBeaconIntentService.class);
i.putExtra("StartBeaconService",
false);
context.stopService(i);
}
Log.i(TAG, "Bluetooth State : OFF");
break;
case BluetoothAdapter.STATE_ON:
Log.i(TAG, "Bluetooth State : ON");
if (!MyBeaconService.isStarted) {
i = new Intent(context,
MyBeaconIntentService.class);
i.putExtra("StartBeaconService",
true);
context.startService(i);
}
break;
![Page 40: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/40.jpg)
Registering Ranging Listener in
Service’s onCreate() method@Override
public void onCreate() {
super.onCreate();
beaconManager.setMonitoringListener(new
BeaconManager.MonitoringListener() {
@Override
public void onExitedRegion(Region arg0) {
// TODO Auto-generated method stub
Util.postNotification(getBaseContext(),
"Alert Luggage Tracker",
notificationManager, 1,
AllDemosActivity.class);
}
@Override
public void onEnteredRegion(Region arg0, List<Beacon>
arg1) {
// TODO Auto-generated method stub
}});
}
![Page 41: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/41.jpg)
Connecting to BeaconManager’s Service
in Service’s onStartCommand()@Override
public int onStartCommand(Intent intent, int flags, int startId) {
beaconManager.connect(new
BeaconManager.ServiceReadyCallback() {
@Override
public void onServiceReady() {
try {
beaconManager.startMonitoring(BEACONS);
} catch (RemoteException e) {
Log.e(TAG, "Cannot start
ranging", e);
} catch (Exception e) {
e.printStackTrace();
}
}
});
return START_NOT_STICKY;
}
![Page 42: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/42.jpg)
Technical pitfalls of Beacons ?
• Bluetooth must be turned on.
• Your app must be installed on users devices.
• You can't trigger mobile beacon or iBeacon to trigger installation of an app.
• Location services must be enabled for the specific application.
• To download real data we must have an app connected via internet connection.
![Page 43: Hack your business android+beacons+big data](https://reader036.fdocuments.in/reader036/viewer/2022081404/5599ada31a28ab192b8b45b1/html5/thumbnails/43.jpg)