035 iPhreaks Show – Mapkit with Christopher Judd

00:00
Download MP3

Panel Christopher Judd (twitter github blog) Pete Hodgson (twitter github blog) Andrew Madsen (twitter github blog) Jaim Zuber (twitter Sharp Five Software) Charles Max Wood (twitter github Teach Me To Code Rails Ramp Up) Discussion 00:37 - Christopher Judd Introduction CTO of Manifest Solutions 01:59 - Mapkit TomTom App Geocaching 04:16 - Getting an App to Work with Mapkit Core Location 06:19 - Accuracy iBeacon iSimulate 11:02 - Turn-by-turn Navigation maps.apple.com/maps 13:16 - New in iOS7 Overlay Levels MK Camera Snapshotter Direction & Routing Geo District Polyline Overlay Rendering Tiled Overlays 15:00 - Heat Mapping 16:44 - Alternatives Google Maps route-me CloudMade MapQuest Microsoft Bing Maps Mapbox Scout 19:35 - Gotchas 23:58 - Drawing Polygons/Charting 29:57 - Core Location iBeacon Estimote Beacons 34:49 - Battery Life Geolocation Picks Objective-Cloud (Andrew) Sound Exchange: Tampa Bay (Andrew) Jyoti Natural Foods Chhole, Chickpeas with Potatoes and Onions (Jaim) Indian Food (Pete) Cooking Your Own Indian Food: Madhur Jaffrey's Curry Nation (Pete) Upright Brewing (Pete) Pivotal Tracker (Chuck) Redmine (Chuck) Pepsi Max (Christopher) Cocoaconf (Christopher) Next Week Other Languages Transcript CHUCK:  Hey everybody and welcome to episode 35 of the iPhreaks Show. This week on our panel, we have Pete Hodgson. PETE:  Good morning from sunny San Francisco. CHUCK:  Andrew Madsen. ANDREW:  Good morning from cold Salt Lake City. CHUCK:  Jaim Zuber. JAIM:  Hey, hey. My, my. ANDREW:  Rock and roll will never die. CHUCK:  There we go. JAIM:  [Inaudible] on mood. ANDREW:  I’m a huge fan. CHUCK:  I’m Charles Max Wood from DevChat.TV. And this week, we have a special guest and that’s Chris Judd. CHRIS:  Thanks for having me. CHUCK:  Yeah, no problem. Since you haven’t been on the show before, do you want to introduce yourself really quickly? CHRIS:  Sure. I am the CTO of a medium-sized consulting company here at Columbus, Ohio called Manifest Solutions. And what I like to tell people is that by day, I’m a mild-mannered enterprise Java developer, but by night, I’m a crime-fighting mobile developer. CHUCK:  Ooh, very nice. JAIM:  Do you wear a cape for that? CHRIS:  I don’t. But one of the applications I worked on is like ADT for your body. So, if you feel like you’re in a harmful situation, you can triple click this big button in the app and it will dispatch emergency or police to your location or open a one-way communication to a dispatch center. CHUCK:  Oh, wow! JAIM:  Wow! That’s pretty cool. PETE:  It’s cool. It’s kind of like your phone is its own superhero or something. CHUCK:  There you go. Do you wear glasses during the day and then take them off to save the world? CHRIS:  Only when I go to the phone booth to change. CHUCK:  For a second there, I was like, “I’d like to see that,” and then I was like, “No, no I wouldn’t.” [Laughter] PETE:  So, do you do mainly iOS development when it comes to mobile or do you do Android as well? CHRIS:  So, I do a variety. I do Android, iOS, I do mobile web, I’ve done some PhoneGap and I’m Titanium Certified. PETE:  Okay. CHRIS:  Wow. PETE:  That sounds like the kind of thing a superhero would say, “I am Titanium Certified.” [Laughter] PETE:  But Kryptonite allergic. CHUCK:  Alright. Well, we brought you on today to talk about Mapkit. CHRIS:  Well, that’s great because I think writing applications that take advantage of mapping data are a lot of fun. CHUCK:  Do you know how many times my iPhone has gotten me lost? CHRIS:  No, I don’t. [Laughter] PETE:  You have to be a real expert to know that. I know about everyone’s Mapkit. CHUCK:  It’s about half the time, it seems. I get directions and it’s just like,

Transcript

CHUCK:  Hey everybody and welcome to episode 35 of the iPhreaks Show. This week on our panel, we have Pete Hodgson. PETE:  Good morning from sunny San Francisco. CHUCK:  Andrew Madsen. ANDREW:  Good morning from cold Salt Lake City. CHUCK:  Jaim Zuber. JAIM:  Hey, hey. My, my. ANDREW:  Rock and roll will never die. CHUCK:  There we go. JAIM:  [Inaudible] on mood. ANDREW:  I’m a huge fan. CHUCK:  I’m Charles Max Wood from DevChat.TV. And this week, we have a special guest and that’s Chris Judd. CHRIS:  Thanks for having me. CHUCK:  Yeah, no problem. Since you haven’t been on the show before, do you want to introduce yourself really quickly? CHRIS:  Sure. I am the CTO of a medium-sized consulting company here at Columbus, Ohio called Manifest Solutions. And what I like to tell people is that by day, I’m a mild-mannered enterprise Java developer, but by night, I’m a crime-fighting mobile developer. CHUCK:  Ooh, very nice. JAIM:  Do you wear a cape for that? CHRIS:  I don’t. But one of the applications I worked on is like ADT for your body. So, if you feel like you’re in a harmful situation, you can triple click this big button in the app and it will dispatch emergency or police to your location or open a one-way communication to a dispatch center. CHUCK:  Oh, wow! JAIM:  Wow! That’s pretty cool. PETE:  It’s cool. It’s kind of like your phone is its own superhero or something. CHUCK:  There you go. Do you wear glasses during the day and then take them off to save the world? CHRIS:  Only when I go to the phone booth to change. CHUCK:  For a second there, I was like, “I’d like to see that,” and then I was like, “No, no I wouldn’t.” [Laughter] PETE:  So, do you do mainly iOS development when it comes to mobile or do you do Android as well? CHRIS:  So, I do a variety. I do Android, iOS, I do mobile web, I’ve done some PhoneGap and I’m Titanium Certified. PETE:  Okay. CHRIS:  Wow. PETE:  That sounds like the kind of thing a superhero would say, “I am Titanium Certified.” [Laughter] PETE:  But Kryptonite allergic. CHUCK:  Alright. Well, we brought you on today to talk about Mapkit. CHRIS:  Well, that’s great because I think writing applications that take advantage of mapping data are a lot of fun. CHUCK:  Do you know how many times my iPhone has gotten me lost? CHRIS:  No, I don’t. [Laughter] PETE:  You have to be a real expert to know that. I know about everyone’s Mapkit. CHUCK:  It’s about half the time, it seems. I get directions and it’s just like, “How did I wind up here?” PETE:  So the, what’s it called, mapping, the Apple mapping, I heard that it’s improved quite a lot from the initial launch though, right? I’ve got to be honest, I totally gave up on Apple’s mapping and I use Google Maps and I’m quite happy with that. But I don’t know. You guys can tell me if your mapping experiences have been better in the years, or in the months after the Mapkit launch. JAIM:  I never actually had a problem. CHRIS:  So from my perspective, I don’t utilize the map application all that much. I’m using Mapkit, the framework underneath the covers. And for my daily getting to a location map usage, I typically use the TomTom app on the iPhone and I find that to be fantastic. CHUCK:  Oh, nice. PETE:  Okay. JAIM:  Interesting. CHRIS:  But really, dealing with mapping data can be quite challenging. I can talk about some scenarios that I’ve run into with the applications that I’ve built and surprises that I did not expect and why I can see why Apple may be challenged by having their own mapping application and their own mapping data, points of interest and stuff like that underneath the covers. PETE:  Yeah, sounds great. CHUCK:  So, what do you use Mapkit for? CHRIS:  In particular, two applications that I’ve developed for the state of Ohio. One is historical locations across the state. I’m talking about physical locations where there’s a big brown sign that has information about what occurred at that location, and then another one that’s kind of similar which is an application for public colleges and universities across the state of Ohio that also shows you on the map where those are located. And both those applications have the ability to get driving directions from them by basically opening up the map application underneath the covers CHUCK:  That’s really interesting. You made me go look and see what the state of Utah has. There’s a bunch of stuff on here. JAIM:  So, what are the basic steps for getting an app working with Mapkit? CHRIS:  Sure. So, it’s really quite easy because basically Mapkit is the MKMapView. It’s a visual component that basically renders tiles historically and now renders vectors of map data. And so, all you have to do is add the map framework to your application and then drop an MKMapView onto your view and now you have the maps and they’ll render the maps. And you can add annotations, which will add the pins. Or if you wanted to customize those applications, you could put other images on top of those as well. CHUCK:  Do you have to use a Mapkit view or are there other functions that Mapkit provides that don’t necessarily involve the view? CHRIS:  So mostly, Mapkit is oriented around the view. There’s a sister framework called Core Location that you can utilize to find out what your current location is and your altitude, stuff like that. It can also be used to reverse geocode. That logic used to be in Mapkit, but they rightfully moved it in the Core Location to do the reverse geolocating. So basically, Mapkit is really geared towards the visualization of map data. CHUCK:  Okay. So, if I put points on the map, is that Core Location then or Mapkit? CHRIS:  If you put points on the map that is really Mapkit. Now, where you get those points may be coming from Core Location, depending on the app you’re building. CHUCK:  Okay. CHRIS:  And Mapkit also has built into it to know where your current location is right now. So, I’m sure if you’ve run the map application that Apple provides, you see that blue dot. It kind of pulsates until it gets more accurate location data. You can do that same thing in Mapkit by checking a property that says ‘show user location’. PETE:  Now, that’s nice. So, you don’t have to mess around with the Core Location stuff. If you just want to display that information, you don’t have to kind of do that by hand? CHRIS:  Exactly. PETE:  Oh, cool. CHUCK:  Now, how accurate is it? Is it accurate enough, for example, to tell me which store I’m in at the mall? Or will it just tell me you’re in this part of the mall? CHRIS:  Right. So, Mapkit uses Core Location underneath the covers and so you’re as accurate as Core Location can be. And then that depends on the type of device you have and the type of connectivity that’s around. So, if you start with the cell towers, the least accurate, and so that’s also the fastest to gather that information, the least battery consumption and the accuracy is within a kilometer. If it uses Wi-Fi, you can get it down to a hundred meters. And then the most accurate is down to 10 meters. Now, I think you recently had a show about Bluetooth and the low-power Bluetooth. And I can’t remember what those devices are called. But if you want even more accuracy like with inside of a store, you would have to have some type of solution like that. Or there’s also been some solutions to get more accurate inside of a building using sound where your application could pick up sounds and then based on those sounds tell you approximately where you are at a finer grain such as I’m standing in front of this picture inside of a museum, or this artifact. CHUCK:  And it does that by ambient sound? Or is there some kind of noise generator? CHRIS:  Right. You’d have to have a noise generator. PETE:  I think iBeacon is the thing you’re talking about for the low-energy Bluetooth stuff. CHRIS:  Right, iBeacon, exactly. PETE:  And I guess even if you’ve got GPS, the accuracy depends on a few different things. If you’ve just got off an airplane, it will take a while. If you’re in a metropolitan, like a downtown with a bunch of buildings or in a canyon or something, it’s actually surprisingly bad. CHRIS:  Correct. And I have one funny story. The first application I built, we went to demo it at a conference and we were in a big conference facility. And the application is built around the state of Ohio. So, it assumes that you’re in the state of Ohio and when it gets your location, it kind of zooms in to give that animation effect that’s really cool. And the problem was either we had a rogue Wi-Fi device inside the building because we couldn’t get satellite inside the building or when the google car, this was back when google was providing the maps inside of Mapkit, would drive around, they couldn’t get to the Wi-Fi signals inside the building. So, the application kept on responding as we were in Connecticut. And it would zoom to Connecticut and that was a horrible user experience because then we’d have to pan all the way back to Ohio. So, it taught me a very valuable lesson to make sure I test outside the location. So now, I try to make sure that inside of my projects, that I convince my clients to send me to Bermuda to make sure I try it outside the location. [Chuckles] CHRIS:  Of course, that hasn’t happened very much. But nowadays, there’s built-in debugging tools inside of Xcode that will allow you to simulate alternative locations. When I built my first application that was not available. PETE:  So how does that work, if I wanted to pretend I was in Bermuda rather than actually getting on a plane? CHRIS:  Sure. On your debugging toolbar, there is an arrow and in that arrow you can create a GPS file which is just locations, your geo lat/long, your lat/longitude and the name. And then you can load that and basically select those locations. And then it will simulate that you’re at that location. Alternatively, there’s a project that I used called iSimulate which can take the GPS location of a physical device tethered to your machine while you’re debugging in Xcode to also simulate. So, maybe if you wanted to simulate movement in a car or something like that, that might be an alternative as well. And that’s a combination of a library loading your app as well as an application you install on your mobile device. PETE:  And you can even simulate, I think the more recent versions of Xcode will even, well the [inaudible] will simulate driving around and things like that. They have some California-centric scenarios of driving around on the 280 and that kind of stuff. JAIM:  Being stuck in traffic for California. CHUCK:  [Laughs] PETE:  Yeah, right. CHUCK:  Yeah, my virtual car isn’t moving. That’s not a bug. PETE:  [Chuckles] I actually do think that it stops every now and then. Well, I guess it stops at traffic lights. But yeah. CHUCK:  So, I’m a little curious. Let’s say that you built this app with the historic sites. How do you get from there to giving people turn-by-turn directions? Do you actually have to tell it to open another app to do that, or can you build that in with Mapkit? CHRIS:  So, if you want to have turn-by-turn, you cannot build that in with Mapkit. It would be a violation of the agreement. And so, what I did is there’s a URL you can pass to the shared application. And that can include the lat and longitude of your destination and your starting point, your source address. And so, that’s maps.apple.com/maps? d address and then the lat/longitude of your destination address and s address, here lat and long of your source where you’re starting from. CHUCK:  And does that kick over to the Apple Maps app? CHRIS:  Exactly. And recently, in iOS7, they did add a new API so that other applications can register for routing information. So, I mentioned the TomTom App before. So, it could register and say, “Hey, I can give driving directions,” so that it could alternatively go into that application. CHUCK:  So, what you’re saying is that you could give it the URL and it would open TomTom instead of the maps app on the iPhone? CHRIS:  In that case, you wouldn’t be doing it with the URL. The URL is more specific. But there’s a way of calling and saying, “Hey, I want directions,” and it will basically tell you what applications offer that routing. And then the user can just select which one of those applications they want to use routing. CHUCK:  So, how is it a violation of the terms for you to do it but not for TomTom? CHRIS:  Well, you can’t utilize the data coming from Apple of Google to do turn-by-turn directions or fleet type of applications. And that’s basically because they want to utilize their own applications in those markets. In the case of TomTom, they have their own map data that they may be licensing from another source. And so, they’re not utilizing the Apple data. CHUCK:  Right. That makes sense. Okay. JAIM:  So, what are the things that have changed for iOS7? I did some map stuff in iOS4, iOS5, and I looked at the APIs, the documentation now and a lot of them are deprecated in iOS7. So, what other new things are coming out or are out? CHRIS:  So in iOS7, there’s a couple. One is overlay levels. There were overlays that were added in iOS5 I think and the overlay levels give you the ability to set, I think it’s three different levels. One of the challenges was routing information. So route signs, route names were being covered up by the overlays. So now, you can select whether you want those on top or on bottom. One is they added the camera, MK camera. And this allows you to do positioning, tilting, heading, so that it doesn’t have to be just a bird view straight down. So that’s a nice, more user fancy feature. They also added the ability to do, a Snapshotter, to take a picture of the map at a particular location if you need that. I already mentioned the direction and routing for applications registered to provide those services and then take advantage of those. They added in new geo district polyline. And they added a new type of overlay rendering rather than the previous overlays to give you some more flexibility. They also added, which is interesting, tiled overlays. So, maybe if you had a map of a historical battle and you wanted to overlay that over top of the map provided by Mapkit, you can do that by giving it tiles and it will scale those appropriately, to save you having to do all that work. CHUCK:  Very nice. One thing I’m curious about, I worked before for a crime mapping company. PETE:  Are you a superhero too, Chuck? CHUCK:  Only for my day job and only in the past. [Laughter] PETE:  At nighttime, he turns into a mild-mannered developer. CHUCK:  There we go. I guess my question is that one of the things that we were working on for some of the customers that we’ve had was doing heat mapping and things like that. Can you do that with the overlays? CHRIS:  There’s nothing built-in to do that, but as long as you have geolocation, you could build your own overlays and determine the colors based on some other type of data. CHUCK:  Okay. So, you could just color sections on the map? CHRIS:  Right. You could draw a polygon based on points that would mark the boundary of the location for your heat. And then you can color the overlays whatever color you want and define transparency and stuff like that. CHUCK:  Oh, nice. JAIM:  Yeah, this is part of the areas where Google Maps on the web was always gold standard. And it was hard to get the same kind of functionality you could do with creating an app with overlays in custom applications. But it sounds like Apple’s coming a long ways in helping us deliver that kind of functionality. CHRIS:  Yeah, they definitely are. It actually started, before Apple took over from Google, they added the overlays. And the nice thing about the overlays is they scale as you zoom in and zoom out. Prior to that, you had to have basically a transparent view with your shape over top and then you had to do really hokey stuff in order to simulate the zooming and pinching and getting the overlays to really match the changes in the map. But now all that’s handled for you. JAIM:  Very nice. So, right about the time of the Apple SDK map debacle, Google came out with their own library, were doing their own maps. Have you had a chance to play with that? CHRIS:  It was actually about six months later, which was frustrating for a lot of people. Google came out with their own app and then six months later, they came out with the Google Maps SDK for iOS. I have not used it. I’ve been happy enough with the apps. I didn’t have to make any changes when Apple made their changes. But Google’s not the only alternative. There’s actually a whole bunch of alternatives. If you don’t like, maybe the way the colors are rendered by Apple, if you want offline storage of map tiles or vectors, if you want points of interests that are already built-in, if you want some type of interactive data such as traffic data and stuff like that, there are other services that offer that. And so, some of the examples are route-me, CloudMade, MapQuest, Microsoft Bing Maps has a component, Mapbox. If you’re in enterprise and you have ArcGIS, they also have a mapping component so you could take advantage of mapping data you might already have in your system. And [inaudible] uses a web view with Mapkits for mobile web also inside of your application, if that meets your needs. CHUCK:  I’ve also used a mapping turn-by-turn one called Scout. It’s kind of nice. Anyway, just throwing that one in the pile. JAIM:  Yeah, I tried installing the Google SDK when it first came out because I was working on a map application and after spending two, three hours getting it included in the application, I realized my API key I could use for Google Maps on the web didn’t work for it. At that point, I just threw my hands up in disgust and walked away. It’s good to see there are some other options out there. ANDREW:  Yeah, I guess that brings up that in Mavericks, Mapkit is on OS X too. And I don’t know. Have you had a reason to use Mapkit on the Mac at all? CHRIS:  I have not, no. ANDREW:  Neither have I. But I understand the API is basically identical, right? CHRIS:  I believe so. I would imagine so. ANDREW:  I think that’s right. CHUCK:  So, what’s the coolest thing that you’ve seen people do with Mapkit? CHRIS:  Yeah, so one of the applications I really liked was a, by default you put pins on a map, but those annotations can have an annotation view that could be anything that is an image or that you can render live. So one of the interesting things was taking photographs of your photo library and putting those on the map. And I found that really fun because I forgot that I had even been to some cities. And the fact that I had photos there reminded me that I was there. That’s probably the most interesting one I’ve seen. JAIM:  I don’t remember Tijuana at all. What’s going on here? [Chuckles] PETE:  Are there any common pitfalls that you think people who are getting into using Mapkit for the first time might run up against that you can help? Give some advice to these folks and help them avoid some of the obvious mistakes. CHRIS:  Sure. One of them is to assume that location data is valid data. That was a scenario I provided before where we’re at the conference center and I expected it to be good data. So basically make sure you know where your bounds are and handle that appropriately. Or you also mentioned the scenario where you’re in a big city and it may report you as someplace else or not be able to get the data. So make sure you handle those scenarios where you can’t get data or it’s inaccurate. Also remember that users have a preference. When your application starts up and you have Mapkit, the user can say, “Hey I don’t want this application to use my current location.” So you can’t assume that you’re always going to have their location. Another thing is if you put your own images on top of the view for your annotation, there is an offset. And depending on the image, if you have a shadow or something like that, you may need to offset that a little bit. So it’s going to put the image by default at the center of your image, but a shadow or something like that would cause you to have to adjust it a little bit. Otherwise, it’s going to be slightly off for your location. Most cases, it may not be a problem, but if you need to be really accurate, you might want to make sure that’s true. But probably the biggest thing is the accuracy of your data. So I was demoing to my son’s class. They were talking about Ohio history and I was demonstrating the application showing that you can find all these interesting points. Unbeknownst to me, my son is in the background playing with the app on the screen and when I turned around, I found that there were still a bunch of map points that were right in the middle of the Atlantic Ocean. CHUCK:  [Laughs] CHRIS:  And obviously, right in the middle of the Atlantic Ocean is (0, 0) so the data coming to me from my service provider has some inaccurate data. And as he played with it more, I noticed that there were some map points in India, which is in the exact opposite part of the world as Ohio. So basically, they had switched the latitude and longitude. JAIM:  Nice. Got their negative sign mixed up? CHRIS:  Yes, exactly. So the other aspect of that is the precision. You want to have as many decimal points after the integer value in your lat and longitude. And every time you lose a decimal point, you lose precision. So when I talk about this at conferences, I have a demonstration using the Horseshoe, the Buckeye’s football stadium where if you were meeting somebody and you said let’s meet at this geolocation, at the 50 yard line, you would find each other. And that I slowly take away some of that precision and then you go to maybe three yards away and then it’s ten yards away. And you’re probably going to find each other. And then you’re in C Deck and you’re meeting somebody at the 50 yard line. If you lose a little bit more precision, you’re on the other side of the Ohio State campus. And if you lose one more precision, you’re in sorority alley. And you may have a lot of explaining to do, why you were at the 50 yard line. [Chuckle] CHRIS:  And so you can lose precision in a lot of different ways. One is you don’t get the precision that you need or possibly you do some mathematical functions on it and lose it. Or maybe you store it into a database that doesn’t have enough precision either, so it truncates some of that data. So making sure you get as much latitude and longitude accuracy as you can is really important. JAIM:  So, to help get a ballpark figure, one of the main or one of the basic granularities is one kilometer. How many decimal places would that be for latitude and longitude? CHRIS:  That’s a good question. I don’t know the answer to that. PETE:  Does that vary by, oh I’m just going to make myself sound stupid. I thought that varies by if you’re at different latitudes, then the degrees are different, but I could be talking absolute nonsense. JAIM:  I think you’re right, Pete. It’s somewhat variable based on how far you are away from the equator and stuff like that. PETE:  I’m having vague flashbacks of high school geometry. CHUCK:  [Laughs] PETE:  And not paying attention. CHUCK:  So one thing that I have done with maps that I’m a little curious about and you did mention a little bit of this, but drawing polygons. So for example, you could demarcate a neighborhood, or you could demarcate an area of interest, or a national park, or something like that. I know that some of that is built into the map. You see the outline of the national park on the map so you know you’re driving into it or out of it. Is there a way for people to actually do that themselves? Say this area is of interest to me one way or the other. CHRIS:  Is it built in so you can say I’m interested in all state parks, is that what you’re asking? CHUCK:  Not quite. So, let’s say that I wanted to draw a line around my neighborhood because I’m interested in maybe I have a feed of events that have location data and I want to filter them so that they’re inside of that area. Does Mapkit allow you to basically draw or demarcate an area? I know that you can set up locations as points on the map. Can you set up an area on the map? CHRIS:  So not necessarily render it with an overlay, but just mark points so you’d know where they are? I don’t think in the way you’re referring to. And I’m going to turn the question a little bit and say one of the things is even though they’re vectors, there are still these levels there that any time you ask for the map to go to a certain location, whether you’re zooming into a location or trying to position the map, it’s always basically a recommendation to Mapkit. And then they will try to do a best fit based on the amount of data that they have at that particular level. So you can recommend, “I want this location to be 500 meters from this center point,” but maybe 700 meters provides better rendering level and display, so the Mapkit may adjust that to itself. CHUCK:  Right. And then you can have the points that make up the polygon and render that in an overlay and do whatever else it is that you’re going to do with that data? CHRIS:  Right. CHUCK: Can you do things more along the lines of set up your own course? So say I want to make an app that will chart a run for me. So again, it’s just a series of points. Run to here, run to there, run to there, run to there. Does it allow you to do that? I guess when you set up the next point you just draw the lines between the points? CHRIS:  Right. You can do that. Now remember, when you set up those points, it’s going to be as the crow flies and not following streets and stuff like that. So if you wanted to follow a street, you’d have to be much more specific and finer-grained. But you could do that. CHUCK: Can you tell it to follow streets? Or does it not work that way? CHRIS:  No, it doesn’t work that way. PETE:  I think that would be a pretty tricky problem to solve. CHUCK:  I think it would be a pretty cool feature, too. [Chuckles] PETE:  [Chuckles] Yeah. JAIM:  It gets down to a level of how often do you want to check your GPS? So what accuracy you can get off that. So if you’re checking your location every 15, 20 seconds, you can probably get down what street you’re going on. CHRIS:  Well if you want to do it while you’re running, you could capture that information and be pretty accurate. If you wanted to predict your run, that’s where it’d be hard because the roads are windy so it’d be as a crow flies. But if you checked it every couple of seconds, you could get pretty accurate and follow those roads. CHUCK:  Yeah, otherwise you have to set the points so that they approximate the curve of the road. CHRIS:  Right. CHUCK:  And are those points Core Location points or is there some other entity in Mapkit that actually… CHRIS:  So, that’s why I say that the sister API is Core Location. So to do the overlays, you would create a CL location, coordinate in 2Ds. And you use the lat and longitude for that and you will create as many of those as you need. And then you can put those into an array and it will follow that order of the array and then ultimately close that polygon. And you tell it how many points and pass that array to the polygon and add that polygon as an overlay to your map view. CHUCK:  Now you said that it was a Core Location something 2D. Is there a 3D Core Location thing? CHRIS:  I don’t know. I’d have to look that up. JAIM:  Well, there is altitude on Core Location. ANDREW:  Yeah. PETE:  That’s separate though. Core Location is a coordinate plus, I think I’m right, a CL location is those 2D coordinates plus an altitude plus accuracy plus a timestamp. JAIM:  And speed, too. PETE:  Technically, it’s like four-dimensional. Oh, plus speed it’s five-dimensional. JAIM:  You just blew my mind. CHUCK:  Can you set the altitude so that you’re 20 feet underground or 50 feet in the air? PETE:  You could definitely set it so you’re up in the air. Because that’s how, the way you represent locations in a mappy world isn’t 3D x, y, z. It’s basically where you are on a sphere and then how high or low, how far you are from the center of that sphere, right? But then you fake it a little bit to make it easy and you say that oh, well the earth is a sphere that’s this wide so we’ll consider that to be zero. CHUCK:  Yeah, there’s a whole bunch of fun math you can do with that. Because there are so many approximations to how spherical the earth is or how oblong it is. So it approximates the curvature and approximates the unevenness of the earth and things like that. I’ve had to deal with this before with other apps, just not on the iOS device or the Mac. So what else does Core Location do other than just give you some construct for saying something is right here? CHRIS:  So primarily what I’ve used it for is just determining my location. And you can determine that location with the level of accuracy that you want or relative level of accuracy that you may want. But as I mentioned before, it can also do reverse geolocating for you. And it also has now the beacons included in it. JAIM:  So if I’m setting up a location, I want to monitor my run. What’s the process for that? Do we set up a Core Location manager? Do we register something for the system? Do we do this ourselves? Are we polling? How does that work? CHRIS:  So they’ve added a bunch of functionality and the most recent one’s in Core Location in 7 to do some of the stuff more in the background and call back to your application. And I’ve not used those as much. But historically, what you would do is create the location manager, register as a delegate, tell it the degree of accuracy you’re interested in, and it will call back to you with your location and your altitude and all that stuff that’s associated with that CL Core Location 2D item. PETE:  Okay. CHRIS:  Then you could gather those, put them into an array or into a database or something like that. PETE:  I think with some of the changes of iOS7 which I guess is around power management is they’re doing this coalescing thing where I think it used to be you would just get, “This is your current location.” When that delegate fired that you registered, it would tell you this is your current location, with accuracy and all that stuff, and this is where you were last time. But now it actually will give you an array of locations saying, so it will coalesce those rather than just waking up your app and pinging it over and over and over again, it will hit them, it will maybe coalesce them into a bunch of locations and then send them with less granularity. But you still have all the information. It’s just that you’re not being woken up every time because that’s a battery thing. You have different ways. JAIM:  And there’s also a concept of a significant location change, which it’s not really clear what that entails. Does anyone know? Because I was working with this [inaudible] ago… PETE:  I think that depends on that when you register with a delegate, you tell it what granularity, what accuracy you’re interested in. So you say I am a pedestrian app or I am a driving app or something like that. And then there’s an “other”, which according to the documentation can include boating. [Chuckles] It’s the randomest thing for them to put in the documentation. But I think that’s what they, that’s how they decide what’s significant or not. So obviously if you’re a pedestrian, then small changes are more important than if you’re on a boat. CHRIS:  There’s also a way of telling it you have a geofence. And so when you enter or leave that geofence, it could also call you back. ANDREW:  There’s also the new iBeacon stuff, where you get a notification when you come in range of a Bluetooth iBeacon. PETE:  Yeah. I think that means the same as, I think that works pretty much the same as geofencing except you also get a range of how far you are from that. Well, a guesstimated range of how far you are from the beacon. JAIM:  So the beacon would know what its latitude and longitude is? PETE:  No. JAIM:  It wouldn’t? PETE:  The beacon, you’ll just know, as far as I know with iBeacons. For the ThoughWorks Christmas party, some ThoughtWorkers made a scavenger hunt using these things. [Chuckles] I was chatting to them about it just the other day. CHUCK:  Wow. PETE:  Yeah, it was a fun thing, people running around San Francisco with their iPhones. It turns out the hardest part of building this scavenger hunt app was actually figuring out how to get it onto people’s iPhones without having to use the app store. [Chuckles] PETE:  But anyway, yeah I think that you just find out, “Oh I’m this far away from a beacon with this ID.” And I guess it depends. We were using this Estimote Beacons that have been popular for using in retail environments. And with those, I don’t think they know where they are. They just know, “I’m a beacon with this ID,” and they’ll tell your phone when you’re nearby, basically. And you can try and do triangulation and stuff by looking at how far you are from multiple beacons. But it’s not going to be very good quality, because that range is, as far as I understand, just based on how far away, oh I’m sorry, the power of the radio signal. So it just guesses, “Well I’m getting a signal at this much, a signal strength of this so I’m probably about this many meters away from the beacon.” CHUCK:  Awesome. Do we have any other questions about Core Location or Mapkit that we want to cover? JAIM:  Yeah. I’d like to get some guidelines on, I think as Pete mentioned before, it’s a balance between accuracy, how often you get readings, and your battery life. Do you have any guidelines for how to approach the problem? CHRIS:  So one thing that the instruments provides is a battery monitor. So I think that would be the best, is to actually utilize that and measure that. And it will capture the data while you’re disconnected with the device, because you want it to be in the real world. And then when you reconnect with the device, it will basically explain to you the battery utilization that your application used. And so you can get the, you can determine based on your application, what is the best mix of battery life versus the need for data. JAIM:  Okay, so it’s primarily manual, but at least with instruments you can get some data and it’ll actually tell you what your battery usage is versus you just trying to estimate it based on your percentages. That’s pretty cool. PETE:  And I guess part of it is just turning off the, telling Core Location you don’t care about locations after you’ve got a good estimate. I guess probably, I don’t even know whether that’s something that as an app developer we should be doing or whether we should just assume that when we say to Core Location we care about this much accuracy, then we can rely on Core Location to not tell us about small changes and to turn off the GPS and all that kind of stuff. I’ve always assumed, so I have an iPhone app that I developed that’s just for, it’s a transit app and it needs to know where your nearest station is. Well, it doesn’t need to but it will tell you what your nearest station is. And obviously I use Core Location for that. Then I just assumed that it was good practice to turn off, deregister my interest in location updates after I’ve got a good estimate that’s reasonably recent. But maybe I’m overthinking it and I should just leave it on all the time. CHRIS:  No, you’re right. You really should turn it off if you’re done with the data. So let’s say you’re a note-taking app and you want to grab the geolocation of where the note was created, you want to get that measurement and then turn it off as opposed to if it’s a jogging application. While you’re jogging you want to keep capturing that data. So there are definitely different use cases for that. JAIM:  Okay. CHUCK:  Is there any way to be, because I know that with a lot of these apps, if they need the geolocation stuff, they’ll actually prompt you if you have it turned off. But when you’re done, they don’t always prompt you to turn it back off, so you have to remember yourself. CHRIS:  I think that would be an app by app case where you’d have to determine what’s the best usability for your users, whether it makes sense to turn it off automatically or have them let you know when they’re done utilizing it. PETE:  And you can have that be something inferred. Like if they’re on a specific screen, then they want location to be updated but if they’re not on that screen then they don’t care. Although obviously, I don’t know, maybe you would get more accurate location information if you just turned on Core Location when you first fired up the app just to get the GPS radio warmed up and guessing at a good location. And then you could turn it off once you get your first location and then turn it back on when they go to a specific screen or something. But probably, there are Apple engineers at [inaudible] tearing their hair out at the idea of me doing that. Think of the battery. CHUCK:  [Laughs] Alright. Well, I’m going to push us along to picks unless there’s anything else. CHRIS:  I don’t have anything else. CHUCK:  Alright. Well then, we’ll go to the picks. We’ll make Andrew start us off. ANDREW:  Okay. I’ve got two picks today. And my first one is Objective-Cloud. I think this was announced about a year ago. But as we record today, it just finally went into public beta so you can actually try it out without an invitation. I haven’t tried it out yet, but I’m excited to give it a try. The idea is that you can write your server side code in Objective C and then make requests to it using a standard REST interface. But everything on the backend is Objective C code and it’s running on OS X so you can use OS X-specific APIs in your server side app. Kind of an interesting solution for people who are primarily Objective C programmers to do some of their web programming in the language that they’re familiar with. CHUCK:  No, I’ll be out of a job. Actually, not really. ANDREW:  I don’t think it’s going to take over the world. But it seems interesting. CHUCK:  [Chuckles] JAIM:  And Objective C just had to be JavaScript, didn’t it? You know? [Laughter] JAIM:  We’re server side too. ANDREW:  And then my second pick is I was actually in Tampa, Florida last week. And when I’m on a trip, one of the things I always do is find the local record stores and go check them out. And I was surprised to find that Tampa actually has a really cool record store called Sound Exchange. And the thing I like besides their big selection was they sell a bunch of classic stereo equipment. And particularly, they have a whole bunch of reel-to-reel tape decks. And they also sell prerecorded reel-to-reel tapes which are pretty hard to find. So it’s a cool place. If you’re in Tampa, go check it out. Those are my picks. JAIM:  So, how do you get your records back to Utah? ANDREW:  I had the room in my suitcase and I just pack them in the middle and they’re usually fine. I put it in carry-on luggage so I’ve never had a problem. PETE:  Aren’t they super heavy? ANDREW:  They were pretty heavy, yeah. But I don’t buy a whole crate or anything. PETE:  [Laughs] ANDREW:  At least, not usually. CHUCK:  Awesome. Jaim, what are your picks? JAIM:  Alright. I’m going to do one pick. So my wife and I keep things pretty healthy. We shop at the co-ops, eat mostly organic, that sort of thing. But to put it nicely, a lot of the prepackaged food you buy at those stores, not really that good. It turns out putting stuff in a can doesn’t taste that good unless you add a bunch of weird stuff to it. But I just found one thing that I really like to eat. The company’s Jyoti. I don’t even know if I’m saying that correctly. But they do a Punjabi Chhole which is pretty much crack that’s Indian food. They’re very good. Put it with rice, get it by a can, and yeah, I like it a lot. CHUCK:  Very nice. JAIM:  That’s my pick. CHUCK:  Pete, what are your picks? PETE:  I’m free-styling and I’m just going to pick Indian food because Indian food is so good. I’m actually going to pick Indian food and cooking your own Indian food. It’s actually surprisingly easy to cook Indian food from scratch. You have to do this initial upfront investment on the spices. The spices aren’t that expensive and may last for ages. And you can impress your friends and loved ones by making really yummy Indian food like Chhole. JAIM:  Chhole? Okay. PETE:  Yeah. I think it’s Chhole. It’s also called Chhole Masala. Actually ironically, or by coincidence, I was actually looking up a recipe for that last night. So it’s like the chickpea and tomato thing, right? JAIM:  Yeah, that sounds about right. PETE:  Yeah. JAIM:  I should have asked the guy from the UK before saying anything. PETE:  Yeah [chuckles]. Yeah, I’m not going to make any reference to colonies. Okay, so Indian food I guess is my pick and making it yourself. And then my beer pick this week is not a beer. It is an entire brewery. I’m going to pick Upright Brewing who, I don’t even know where they’re based. I think maybe Portland or somewhere up there. But they do really good French and Belgian style beers, so lots of farmhouse saisons and stuff like that. They have a really good rye beer. Their beers are numbered. There’s like Upright Brewing number four, number six, et cetera, which makes it really easy for me to remember which ones I’ve had before and which ones I haven’t tried yet. So yeah, Upright Brewing. If you can get a hold of them, then definitely give them a shot. And that’s it. CHUCK:  Awesome. Alright. Well, I’ve had a little bit of trouble trying to figure out what to pick. I think I’m going to talk through the project management system I have set up for my client projects these days. I used to use Pivotal Tracker which is a terrific tool and I highly recommend it. So they’re going to get a pick. But the problem was that half the time, my clients were either paying for Pivotal Tracker themselves, which meant that me paying for it was a waste, or I was working on something where it was just me and I didn’t really need it because the client was never looking at it anyway. So, I moved over to hosting my own Redmine setup. So I’m going to pick Redmine. It’s a little bit not exactly what I want but it has enough of what I want to where I really like it. And I have a few plugins for it that I’m using. The first one is the Redmine backlogs plugin which is super-duper handy. And basically what it is, is it’s a Kanban board. So you have your stories and you can add tasks to your stories. And each of these stories are in their own backlog that you setup which is effectively a sprint, so tell it when it starts and ends and things like that. It gives you burn down and all that good stuff. Anyway, so then you can move the tasks across from new to in progress and so on and so forth. So that should give you an idea of some of the things that it does there. And I just really like it. It’s worked out real nicely so far. And then Redmine also provides you with things like a wiki and stuff like that. So you can go and you can put information about the project in there and just manage things that way. And yeah, so I’ll just leave things there. I’ll put links to those picks in the show notes. ANDREW:  Do you host your own? CHUCK:  Uhuh. ANDREW:  Redmine? So, you just have your own box and just it on that? CHUCK:  Yeah. ANDREW:  Okay. CHUCK:  Anyway, Chris, what are your picks? CHRIS:  So, I’m also a Redmine user, so I’ll second that. I know you guys frequently choose your beverage of choice, so I thought I’d share mine. Anyone who knows me knows I’m a huge fan of Pepsi Max. If you see me at a conference, I usually have a couple of bottles. And basically, I like it because it’s a diet soda that tastes great, doesn’t have an aftertaste. And it also has a little bit of extra caffeine for those late night coding binges. And then for my second pick, I’ll choose Cocoaconf. I think it’s just a fantastic conference that Dave Klein and his family put on. They have incredible speakers: Jonathan Pen, Daniel Steinberg, Chris Adamson, Bill Dudney, Aaron Hillegass and some other speakers from the Big Nerd Ranch. And so every time I go, I just learn a lot of great information about iOS and Mac development. PETE:  Plus one for Cocoaconf. CHUCK:  Yup. Alright. Well, thanks for coming Chris. It was interesting to talk about and hopefully some people will have some stuff from this that they can go and put into their apps and do cool things with. CHRIS:  Thanks for having me. And for all those people that want to try it out, definitely go and try it out. It’s a very easy framework to get started with and you can do a lot of interesting things in your app. CHUCK:  So, if people want Java, where do they get you for your day job and if they want iOS where do they get you in general? CHRIS:  [Chuckles] Well, I’m  javajudd@gmail.com or you can do @javajudd on Twitter. So, those are two easy ways to get a hold of me. CHUCK:  Alright. Well, we’ll wrap up the show then. Thanks again for coming. We’ll catch you all next week.

Sign up for the Newsletter

Join our newsletter and get updates in your inbox. We won’t spam you and we respect your privacy.