Building a Place-Based Experience With Places API and Firebase
Using the YouTube API, the Google Places API, and Firebase, I created an Android game where you help rescue a scientist who is trapped in an alternate dimension.
Join the DZone community and get the full member experience.Join For Free
In my spare time, I’ve been working on a party game for Android where you can pick any three locations in the world and give them a code. When you initialize the game with that code, you’ll help rescue a scientist, Alyssa, who is trapped in an alternate dimension. The interactive story has her guide you to three locations where your dimension overlaps with hers where you can help her fix her interdimensional machine and get home.
So, how is a game like this built? Well, the cut scenes of Alyssa that drive the scene forward were implemented using YouTube and the YouTube API. (I’ll blog more about that part in the future.) When it comes to the game itself, the picking of places, and the detection of whether you are at those places or not is achieved using Google’s Places API.
As part of the API, Google provides a Place Picker control, which will render a map, and then recognize places on that map, allowing you to select them. Once selected, you can get the unique place ID for that place. There are over 100 million points of interest around the globe that are supported in a variety of categories from restaurants, places of worship, and bus stops to just about anywhere else you can think of.
You can see more of how I built it using the Place Picker and Firebase in this Geocast! Enjoy!
Published at DZone with permission of Laurence Moroney, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.