O'Reilly logo

Mobile Development with C# by Greg Shackles

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

Chapter 6. Location, Location, Location

One of the biggest reasons that smartphones have taken off in recent years is their ability to provide real-time information about what’s around you. You can look up restaurants in the area, read reviews about them, browse their menus, and even make a reservation. If you’re lost, you can quickly pinpoint your location on a map and get directions to where you need to go. Having access to the user’s current location is a very powerful feature, and can allow your application to provide a very personalized and localized experience to the user.

This chapter will introduce the location and mapping capabilities of each platform. Whereas the previous chapters focused largely on sharing code across them, the applications in this chapter will be independent from each other, despite providing the same functionality. That’s not to say that there is no potential code reuse in these scenarios, though. If you recall, the example in Chapter 2 demonstrated how you might apply the abstraction pattern to building an application that utilizes the user’s location. Since each platform has its own way of doing mapping and location, it makes sense to assess them individually rather than rushing into an abstraction.

The applications in this chapter will be built in two phases. In the first, the user will see a map centered on New York City, where she can zoom and pan around, and where there will be a marker showing the location. The second part of this chapter will ...

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