SlideShare ist ein Scribd-Unternehmen logo
1 von 46
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 

Kürzlich hochgeladen (20)

ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 

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