O'Reilly logo

Learn ARCore - Fundamentals of Google ARCore by Micheal Lanham

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time to test the connection

Believe it or not, our real-time database service is up and running; now we just want to test our connection by writing a single value to the database from our AR Web app. Open up spawn-at-surface.html in a text editor and follow along:

  1. Scroll down to the Firebase script we added earlier. Add the following code after the last line:
var database = firebase.database();
  1. The preceding line creates a reference to the database. Now, let's set some data using the following code:
firebase.database().ref('pose/' + 1).set({x: 12,y: 1,z: 0});
  1. Save the file.
Various versions of the spawn-at-surface.html page can be found in the book's downloaded source code at Chapter_5/Examples.
  1. Run the page on your desktop using the  ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required