Friday, May 18, 2018

Getting a Map

The next thing to get done was to set up displaying a Map on both iOS and Android. Android uses Google Maps and iOS uses Apple Maps. To use Google Maps you need to generate an API key and input it into the Android side of the code. You don't need to do anything special for Apple Maps. Each Map also needs to ask for permissions depending on what version you are running. To solve this I used the Plugin.Permissions plugin that provides code that takes care  of permissions for both sides of the project. At this point though I ran into problems. In order for Google Maps to run on earlier versions of Android you need to download the relevant support libraries. This is done through the NuGet Package Manager. The manager should act like any package manager for Linux, it should download and install dependencies for you depending on the package you are downloading. Unfortunately at the moment it is a buggy mess. For example if a package has a dependency that can be greater or equal to a certain version NuGet will ignore the greater than sign and spit out an error message saying you are installing something that exceeds the version number. The only way to solve this, that I found, was to write down all the dependencies and manually install them at the correct version one by one. Out of all the time I spent that week working, the largest chunk was taken up by solving this problem.

No comments:

Post a Comment