SlideShare a Scribd company logo
1 of 46
Download to read offline
Conhecendo e utilizando Beacons e a
Nearby API para Android
Marcelo Quinta
@mrquinta
Como implementar localização?
Como implementar localização?
Wifi Satélite Rede móvel Bluetooth
O que é um beacon BLE?
O que é um beacon BLE?
• Dispositivo por localização por bluetooth
• 2.4 Ghz, mas em canal diferente
• Certa capacidade de guardar informações
• ˜30bytes
• Bateria que pode durar anos
• Broadcast de uma a dez vezes por segundo
https://www.youtube.com/watch?v=TZf4WquRGJU
CONTEXTO
Qual é a parada?
Beacon
Beacon
Beacon
12345
Beacon
???
Beacon
12345
Beacon
???
Beacon
12345
Beacon
Parada X
https://github.com/google/eddystone
Eddystone
Eddystone
• Padrão open-source
• ID
• URL
• Ephemeral IDs
• Dados de telemetria
• Broadcast menos frequente que o iBeacon
https://www.youtube.com/watch?v=TZf4WquRGJU
Google PlacesNearby APIProximity beacons API
APIs
Começando
Passo 1: Hardware
Passo 2: Registro com Proximity Beacons API
Passo 2: Registro com Proximity Beacons API
https://proximitybeacon.googleapis.com/v1beta1/beacons:register
Passo 3: Codificação
Nearby API
Google Play Services 7.8 Bluetooth Sons inaudíveis
Android:
MesssageFilter.Builder messageFilterBuilder = new MessageFilter.Builder()

Android:
MesssageFilter.Builder messageFilterBuilder = new MessageFilter.Builder()

// Include messages published by this app.

.includeAllMyTypes()

// Include messages of a specific type, published by nearby beacons.

.includeNamespacedType("com.google.location.beaconservice", "sample_attachment");

messageFilterBuilder.includeDevicePresenceMessages(

NearbyDeviceFilter.forEddystone(MY_EDDYSTONE_NAMESPACE))

Android:
MesssageFilter.Builder messageFilterBuilder = new MessageFilter.Builder()

// Include messages published by this app.

.includeAllMyTypes()

// Include messages of a specific type, published by nearby beacons.

.includeNamespacedType("org.example.beaconinfoeservice", "sample_attachment");

messageFilterBuilder.includeDevicePresenceMessages(

NearbyDeviceFilter.forEddystone(MY_EDDYSTONE_NAMESPACE))



SubscribeOptions options = new SubscribeOptions.Builder()

.setStrategy(getStrategy())

.setFilter(messageFilterBuilder.build())

.build();

Nearby.Messages.subscribe(mGoogleApiClient, mMessageListener, options)

.setResultCallback(new ErrorCheckingCallback("subscribe(MessageListener)"));
iOS:
GNSStrategy *beaconStrategy
iOS:
GNSStrategy *beaconStrategy = [GNSStrategy

strategyWithParamsBlock:^(GNSStrategyParams *params) {

params.includeBLEBeacons = YES;

}];
iOS:
GNSStrategy *beaconStrategy = [GNSStrategy

strategyWithParamsBlock:^(GNSStrategyParams *params) {

params.includeBLEBeacons = YES;

}];

GNSSubscriptionParams *beaconParams = [GNSSubscriptionParams

paramsWithMessageNamespace:@“com.mycompany.mybeaconservice”

type:@“mybeacontype”

strategy:beaconStrategy];

_beaconSubscription = [_messageManager subscriptionWithParams:beaconParams

messageFoundHandler:myMessageFoundHandler

messageLostHandler:myMessageLostHandler];
// it here in code.
if (!_signInButton) {
_signInButton = [[GIDSignInButton alloc] init];
[_unsignedInView addSubview:_signInButton];
CGRect r;
r.origin.x = (viewf.width / 2) - 75;
r.origin.y = viewf.height / 2 - 20;
r.size.width = 150;
r.size.height = 40;
_signInButton.frame = r;
}
if (!_signInStatusIndicator) {
_signInStatusIndicator = [[UIActivityIndicatorView alloc] init];
_signInStatusIndicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray;
[_unsignedInView addSubview:_signInStatusIndicator];
CGRect r;
r.origin.x = (viewf.width / 2) - 40;
r.origin.y = viewf.height / 2 - 40;
r.size.width = 80;
r.size.height = 80;
_signInStatusIndicator.frame = r;
}
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(loginStatusChangedNotification:)
name:kBSDLoginStatusChangedNotification
object:nil];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
}
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[GIDSignIn sharedInstance].uiDelegate = self;
}
- (void)loginStatusChangedNotification:(NSNotification *)notification {
[self updateUIForSignInStatus];
}
Seja explícito ao
realizar broadcast
Tenha a permissão Cuidado com
a bateria
Mais informações
Nearby Connections e Nearby Messages
developer.android.com/nearby
Beacons em geral
developer.google.com/beacons
Proximity Beacon API
developer.google.com/beacons/proximity
Eddystone
github.com/google/eddystone
1/3 Developing with Beacons
Vídeos recomendados
Physical web
Algo a se pensar
https://github.com/google/physical-web
Venha conversar com a galera no Buteco!
Google Developer Experts
Marcelo Quinta
@mrquinta
Obrigado
Essa palestra foi baseada em material disponibilizado pelo Google. Dê uma olhada no canal do Youtube deles: https://www.youtube.com/user/GoogleDevelopers

More Related Content

Similar to Conhecendo e utilizando Beacons e a Nearby API para Android

WordCamp Columbus - Location Based Integrations
WordCamp Columbus - Location Based IntegrationsWordCamp Columbus - Location Based Integrations
WordCamp Columbus - Location Based Integrationslukepilon
 
Standardized API Development using Node.js
Standardized API Development using Node.jsStandardized API Development using Node.js
Standardized API Development using Node.jsndsmyter
 
Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013
Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013
Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013Aaron Parecki
 
Openstack Summit Vancouver 2018 - Multicloud Networking
Openstack Summit Vancouver 2018 - Multicloud NetworkingOpenstack Summit Vancouver 2018 - Multicloud Networking
Openstack Summit Vancouver 2018 - Multicloud NetworkingShannon McFarland
 
Anthos Security: modernize your security posture for cloud native applications
Anthos Security: modernize your security posture for cloud native applicationsAnthos Security: modernize your security posture for cloud native applications
Anthos Security: modernize your security posture for cloud native applicationsGreg Castle
 
Beacon Development
Beacon DevelopmentBeacon Development
Beacon DevelopmentMiro Cupak
 
FIWARE Wednesday Webinars - Short Term History within Smart Systems
FIWARE Wednesday Webinars - Short Term History within Smart SystemsFIWARE Wednesday Webinars - Short Term History within Smart Systems
FIWARE Wednesday Webinars - Short Term History within Smart SystemsFIWARE
 
How to Light a Beacon
How to Light a BeaconHow to Light a Beacon
How to Light a BeaconMiro Cupak
 
Developing applications with Cloud Services #javaone 2012
Developing applications with Cloud Services  #javaone 2012Developing applications with Cloud Services  #javaone 2012
Developing applications with Cloud Services #javaone 2012Chris Richardson
 
Lecture 11 Firebase overview
Lecture 11 Firebase overviewLecture 11 Firebase overview
Lecture 11 Firebase overviewMaksym Davydov
 
(120303) #fitalk ip finder and geo ip for fun
(120303) #fitalk   ip finder and geo ip for fun(120303) #fitalk   ip finder and geo ip for fun
(120303) #fitalk ip finder and geo ip for funINSIGHT FORENSIC
 
(120303) #fitalk ip finder and geo ip for fun
(120303) #fitalk   ip finder and geo ip for fun(120303) #fitalk   ip finder and geo ip for fun
(120303) #fitalk ip finder and geo ip for funINSIGHT FORENSIC
 
Simplify Cloud Applications using Spring Cloud
Simplify Cloud Applications using Spring CloudSimplify Cloud Applications using Spring Cloud
Simplify Cloud Applications using Spring CloudRamnivas Laddad
 
Pushing Datatothe Browserwith Comet Ajax W
Pushing Datatothe Browserwith Comet Ajax WPushing Datatothe Browserwith Comet Ajax W
Pushing Datatothe Browserwith Comet Ajax Wrajivmordani
 
Node Interactive: Node.js Performance and Highly Scalable Micro-Services
Node Interactive: Node.js Performance and Highly Scalable Micro-ServicesNode Interactive: Node.js Performance and Highly Scalable Micro-Services
Node Interactive: Node.js Performance and Highly Scalable Micro-ServicesChris Bailey
 
Hack your business android+beacons+big data
Hack your business  android+beacons+big dataHack your business  android+beacons+big data
Hack your business android+beacons+big dataTushar Choudhary
 
X-platform iBeacon apps with Xamarin
X-platform iBeacon apps with XamarinX-platform iBeacon apps with Xamarin
X-platform iBeacon apps with XamarinMark Radacz
 

Similar to Conhecendo e utilizando Beacons e a Nearby API para Android (20)

WordCamp Columbus - Location Based Integrations
WordCamp Columbus - Location Based IntegrationsWordCamp Columbus - Location Based Integrations
WordCamp Columbus - Location Based Integrations
 
Standardized API Development using Node.js
Standardized API Development using Node.jsStandardized API Development using Node.js
Standardized API Development using Node.js
 
Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013
Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013
Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013
 
Physical web
Physical webPhysical web
Physical web
 
Firebase overview
Firebase overviewFirebase overview
Firebase overview
 
Openstack Summit Vancouver 2018 - Multicloud Networking
Openstack Summit Vancouver 2018 - Multicloud NetworkingOpenstack Summit Vancouver 2018 - Multicloud Networking
Openstack Summit Vancouver 2018 - Multicloud Networking
 
Anthos Security: modernize your security posture for cloud native applications
Anthos Security: modernize your security posture for cloud native applicationsAnthos Security: modernize your security posture for cloud native applications
Anthos Security: modernize your security posture for cloud native applications
 
Beacon Development
Beacon DevelopmentBeacon Development
Beacon Development
 
FIWARE Wednesday Webinars - Short Term History within Smart Systems
FIWARE Wednesday Webinars - Short Term History within Smart SystemsFIWARE Wednesday Webinars - Short Term History within Smart Systems
FIWARE Wednesday Webinars - Short Term History within Smart Systems
 
How to Light a Beacon
How to Light a BeaconHow to Light a Beacon
How to Light a Beacon
 
Developing applications with Cloud Services #javaone 2012
Developing applications with Cloud Services  #javaone 2012Developing applications with Cloud Services  #javaone 2012
Developing applications with Cloud Services #javaone 2012
 
Lecture 11 Firebase overview
Lecture 11 Firebase overviewLecture 11 Firebase overview
Lecture 11 Firebase overview
 
(120303) #fitalk ip finder and geo ip for fun
(120303) #fitalk   ip finder and geo ip for fun(120303) #fitalk   ip finder and geo ip for fun
(120303) #fitalk ip finder and geo ip for fun
 
(120303) #fitalk ip finder and geo ip for fun
(120303) #fitalk   ip finder and geo ip for fun(120303) #fitalk   ip finder and geo ip for fun
(120303) #fitalk ip finder and geo ip for fun
 
Simplify Cloud Applications using Spring Cloud
Simplify Cloud Applications using Spring CloudSimplify Cloud Applications using Spring Cloud
Simplify Cloud Applications using Spring Cloud
 
Pushing Datatothe Browserwith Comet Ajax W
Pushing Datatothe Browserwith Comet Ajax WPushing Datatothe Browserwith Comet Ajax W
Pushing Datatothe Browserwith Comet Ajax W
 
Air superiority for Android Apps
Air superiority for Android AppsAir superiority for Android Apps
Air superiority for Android Apps
 
Node Interactive: Node.js Performance and Highly Scalable Micro-Services
Node Interactive: Node.js Performance and Highly Scalable Micro-ServicesNode Interactive: Node.js Performance and Highly Scalable Micro-Services
Node Interactive: Node.js Performance and Highly Scalable Micro-Services
 
Hack your business android+beacons+big data
Hack your business  android+beacons+big dataHack your business  android+beacons+big data
Hack your business android+beacons+big data
 
X-platform iBeacon apps with Xamarin
X-platform iBeacon apps with XamarinX-platform iBeacon apps with Xamarin
X-platform iBeacon apps with Xamarin
 

More from Marcelo Quinta

O que há de novo nas Android Support Libraries
O que há de novo nas Android Support LibrariesO que há de novo nas Android Support Libraries
O que há de novo nas Android Support LibrariesMarcelo Quinta
 
Dicas de otimização e planejamento de apps para o mercado brasileiro
Dicas de otimização e planejamento de apps para o mercado brasileiroDicas de otimização e planejamento de apps para o mercado brasileiro
Dicas de otimização e planejamento de apps para o mercado brasileiroMarcelo Quinta
 
Bibliotecas Google para iOS: Fanboy é a sua vó
Bibliotecas Google para iOS: Fanboy é a sua vóBibliotecas Google para iOS: Fanboy é a sua vó
Bibliotecas Google para iOS: Fanboy é a sua vóMarcelo Quinta
 
Games and Java ME - Have fun and earn some money
Games and Java ME - Have fun and earn some moneyGames and Java ME - Have fun and earn some money
Games and Java ME - Have fun and earn some moneyMarcelo Quinta
 
iOS no TDC Florianópolis
iOS no TDC FlorianópolisiOS no TDC Florianópolis
iOS no TDC FlorianópolisMarcelo Quinta
 
Introdução ao Arduino e robótica
Introdução ao Arduino e robóticaIntrodução ao Arduino e robótica
Introdução ao Arduino e robóticaMarcelo Quinta
 

More from Marcelo Quinta (14)

O que há de novo nas Android Support Libraries
O que há de novo nas Android Support LibrariesO que há de novo nas Android Support Libraries
O que há de novo nas Android Support Libraries
 
Dicas de otimização e planejamento de apps para o mercado brasileiro
Dicas de otimização e planejamento de apps para o mercado brasileiroDicas de otimização e planejamento de apps para o mercado brasileiro
Dicas de otimização e planejamento de apps para o mercado brasileiro
 
Bibliotecas Google para iOS: Fanboy é a sua vó
Bibliotecas Google para iOS: Fanboy é a sua vóBibliotecas Google para iOS: Fanboy é a sua vó
Bibliotecas Google para iOS: Fanboy é a sua vó
 
iOS libraries
iOS librariesiOS libraries
iOS libraries
 
Android libraries
Android librariesAndroid libraries
Android libraries
 
Android bluetooth
Android bluetoothAndroid bluetooth
Android bluetooth
 
Mobile
MobileMobile
Mobile
 
Games and Java ME - Have fun and earn some money
Games and Java ME - Have fun and earn some moneyGames and Java ME - Have fun and earn some money
Games and Java ME - Have fun and earn some money
 
iOS no TDC Florianópolis
iOS no TDC FlorianópolisiOS no TDC Florianópolis
iOS no TDC Florianópolis
 
Jquery Mobile
Jquery MobileJquery Mobile
Jquery Mobile
 
Introdução ao Arduino e robótica
Introdução ao Arduino e robóticaIntrodução ao Arduino e robótica
Introdução ao Arduino e robótica
 
Ria e Java FX
Ria e Java FXRia e Java FX
Ria e Java FX
 
Minicurso Java Me
Minicurso Java MeMinicurso Java Me
Minicurso Java Me
 
Hello World JavaFX
Hello World JavaFXHello World JavaFX
Hello World JavaFX
 

Recently uploaded

A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Recently uploaded (20)

A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Conhecendo e utilizando Beacons e a Nearby API para Android

  • 1. Conhecendo e utilizando Beacons e a Nearby API para Android Marcelo Quinta @mrquinta
  • 3. Como implementar localização? Wifi Satélite Rede móvel Bluetooth
  • 4. O que é um beacon BLE?
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11. O que é um beacon BLE? • Dispositivo por localização por bluetooth • 2.4 Ghz, mas em canal diferente • Certa capacidade de guardar informações • ˜30bytes • Bateria que pode durar anos • Broadcast de uma a dez vezes por segundo
  • 13.
  • 15.
  • 16.
  • 17. Qual é a parada?
  • 18.
  • 24.
  • 26. Eddystone • Padrão open-source • ID • URL • Ephemeral IDs • Dados de telemetria • Broadcast menos frequente que o iBeacon
  • 31. Passo 2: Registro com Proximity Beacons API
  • 32. Passo 2: Registro com Proximity Beacons API https://proximitybeacon.googleapis.com/v1beta1/beacons:register
  • 33. Passo 3: Codificação Nearby API Google Play Services 7.8 Bluetooth Sons inaudíveis
  • 35. Android: MesssageFilter.Builder messageFilterBuilder = new MessageFilter.Builder()
 // Include messages published by this app.
 .includeAllMyTypes()
 // Include messages of a specific type, published by nearby beacons.
 .includeNamespacedType("com.google.location.beaconservice", "sample_attachment");
 messageFilterBuilder.includeDevicePresenceMessages(
 NearbyDeviceFilter.forEddystone(MY_EDDYSTONE_NAMESPACE))

  • 36. Android: MesssageFilter.Builder messageFilterBuilder = new MessageFilter.Builder()
 // Include messages published by this app.
 .includeAllMyTypes()
 // Include messages of a specific type, published by nearby beacons.
 .includeNamespacedType("org.example.beaconinfoeservice", "sample_attachment");
 messageFilterBuilder.includeDevicePresenceMessages(
 NearbyDeviceFilter.forEddystone(MY_EDDYSTONE_NAMESPACE))
 
 SubscribeOptions options = new SubscribeOptions.Builder()
 .setStrategy(getStrategy())
 .setFilter(messageFilterBuilder.build())
 .build();
 Nearby.Messages.subscribe(mGoogleApiClient, mMessageListener, options)
 .setResultCallback(new ErrorCheckingCallback("subscribe(MessageListener)"));
  • 38. iOS: GNSStrategy *beaconStrategy = [GNSStrategy
 strategyWithParamsBlock:^(GNSStrategyParams *params) {
 params.includeBLEBeacons = YES;
 }];
  • 39. iOS: GNSStrategy *beaconStrategy = [GNSStrategy
 strategyWithParamsBlock:^(GNSStrategyParams *params) {
 params.includeBLEBeacons = YES;
 }];
 GNSSubscriptionParams *beaconParams = [GNSSubscriptionParams
 paramsWithMessageNamespace:@“com.mycompany.mybeaconservice”
 type:@“mybeacontype”
 strategy:beaconStrategy];
 _beaconSubscription = [_messageManager subscriptionWithParams:beaconParams
 messageFoundHandler:myMessageFoundHandler
 messageLostHandler:myMessageLostHandler];
  • 40. // it here in code. if (!_signInButton) { _signInButton = [[GIDSignInButton alloc] init]; [_unsignedInView addSubview:_signInButton]; CGRect r; r.origin.x = (viewf.width / 2) - 75; r.origin.y = viewf.height / 2 - 20; r.size.width = 150; r.size.height = 40; _signInButton.frame = r; } if (!_signInStatusIndicator) { _signInStatusIndicator = [[UIActivityIndicatorView alloc] init]; _signInStatusIndicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray; [_unsignedInView addSubview:_signInStatusIndicator]; CGRect r; r.origin.x = (viewf.width / 2) - 40; r.origin.y = viewf.height / 2 - 40; r.size.width = 80; r.size.height = 80; _signInStatusIndicator.frame = r; } [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loginStatusChangedNotification:) name:kBSDLoginStatusChangedNotification object:nil]; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; [GIDSignIn sharedInstance].uiDelegate = self; } - (void)loginStatusChangedNotification:(NSNotification *)notification { [self updateUIForSignInStatus]; }
  • 41. Seja explícito ao realizar broadcast Tenha a permissão Cuidado com a bateria
  • 42. Mais informações Nearby Connections e Nearby Messages developer.android.com/nearby Beacons em geral developer.google.com/beacons Proximity Beacon API developer.google.com/beacons/proximity Eddystone github.com/google/eddystone
  • 43. 1/3 Developing with Beacons Vídeos recomendados
  • 44. Physical web Algo a se pensar https://github.com/google/physical-web
  • 45. Venha conversar com a galera no Buteco! Google Developer Experts
  • 46. Marcelo Quinta @mrquinta Obrigado Essa palestra foi baseada em material disponibilizado pelo Google. Dê uma olhada no canal do Youtube deles: https://www.youtube.com/user/GoogleDevelopers