This application will take two user inputs for map -- Latitude and Longitude. Clicking on open in map will open the map that can show you directions from the current location to the given address defined by the two user inputs.
Introduction
Let's build a simple Map application that will contain the source and destination addresses in the form of fields From and To respectively.
This application will take two user inputs for the map, i.e., Latitude and Longitude. Clicking on open in the map will open the map that can show you the direction from current location to the given address defined by the two user inputs.
This application will show you how to open the map without giving any application key. You don't need to generate API key for this application.
We are opening the map intent from android.net.Uri. Immutable URI reference.
Implementation
The directory structure will be as follows.
Note You may have to add NewtonSoft.Json package for working on JSON serialize and deserialize objects.
Add the following file under the Model directory.
Add the following content on main.axml.
Add the follwoing content on string.xml.
Add the following content on MainActivity.cs
This activity is the main activity and it will have the screen that will take the user input. Clicking on button will take you to the new activity that will open the map.
Add file NavigateActivity.cs
This activity will open the map and contain the From and To fields filled when opening the map intent.
You don't need to add any manifest information for any permission related information in file AndroidManifest.xml.
Screens
Execution
Pro WPF: Windows Presentation Foundation in .NET 3.0