iPhone

MapKit Video Tutorial

Tagged:  

I did a short video version of my MapKit talk. Its about 6:37 minutes long and moves pretty quickly but should give you a good head start on using Map Kit.

The slides and code are here

Let me know what you think.

Markr

Tagged:  

I just wanted to say thank you so much for Markr!! It's just what I needed and it's free!
As a student I record lectures at class and this app is perfect for me!! - Grant R.

360iDev Getting Oriented with MapKit presentation Materials

Tagged:  

Earlier this week I presented a talk on getting oriented with MapKit on the iPhone at the 360iDev conference in Denver.

String template processing in your native Cocoa and Cocoa Touch applications with MGTemplateEngine

Tagged:  

Template engines are common in web applications and there are many options such as Smarty, FreeMarker, etc.

It may not be immediately obvious but the can also be really useful in native iPhone Cocoa Touch and Desktop Cocoa applications. It can be even more important now that native applications are integrating more and more with functionality using UIWebView and WebView.

They can be particularly useful to generate

  • text or HTML emails for reports, invoices, etc.
  • XML or formatted data to be exported or sent to another application

You can try to do it [NSMutableString appendFormat] or maybe with [NSString localizedStringWithFormat] but it really easy to do with a template engine such as MGTemplateEngine by the prolific Matt Gemmell.

There is some helpful documentation included with the code but the basic steps are:

  1. add MGTemplateEngine code to your project
  2. add libicucore to your target
  3. Use the MGTemplateEngine to generate a formated string (described below)
  4. Display or email the formatted string.
  5. To use the template engine you'll need a template file. In this case I'm using an HTML template but it can be any format (text, xml) that you like. In this example I'm using an extremely simple HTML template. Note that the variables to be substituted are demarcated by dual curly braces {{ totalNumberOfParts }} and the for loop by a curly brace and percent sign {% for part in parts %} . Note also the {% /for %} that ends the for loop.

    In our Objective-C program its pretty simple to use the template engine to process the templates with a dictionary of variables that we provide.

    If there is a tricky part to using the MGTemplateEngine is that if you make a mistake in the template such as forgetting the /for you'll only get an obscure error such as.
    Previous frame identical to this frame (gdb could not unwind past this frame)
    But with this heads up you'll know to study the template for any syntactical issues.

    All in all it is a great framework that has really helped me in a couple of applications. Thanks Matt for this really useful code. It has saved me a bunch of time.

Assisted GPS and the iPhone

Tagged:  

The (GPS) location function on the iPhone is Assisted GPS (A-GPS) which means it uses a combination of cell tower and wifi information when available along with Global Positioning System (GPS) satellite information to determine your location.

This normally works really well and is a lot faster than waiting for a satellite lock from multiple satellites. However, it can give you strange results when there is no cell tower or wifi information available.

This may not be a problem if you stay near major urban areas but if you go

  • hiking in the mountains
  • to "remote" parts of the country
  • somewhere with only a single cell tower
  • or to a foreign country with roaming turned off

you won't get the benefit of the assisted part of A-GPS. In this case your location aware applications will start getting, possibly multiple, (kCLLocationError) erorrs.

Many applications turn the location function off after the first error to save battery power. Which is normally the right thing to do.

In this case though, you'll need to give the phone a clear view of the sky, stop moving if possible and use an application that leaves the GPS function on even after it gets the initial error. Then wait for a satellite lock which can take a few minutes.

It is true that in this situation you would not be getting data for your Google maps but you may be trying to use an off line map browsing application or trying to get the raw geo coordinates for use with a paper map or for some other reason.

Note that moving the phone while off, for example flying to a different country or turning off the phone to save battery, can also exacerbate this problem.

On a recent trip to Yukon, Canada my then new phone kept thinking I was in Tuscon, AZ. Once I figured out what to do it got an accurate location fix. I hope that this helps keep you from worrying that your phone is broken and helps you help your phone to figure out where you are.

Logstr

Tagged:  

Get it today from the iTunes app store

Preserve memories of all life's adventures with Logstr, a unique map-creation application designed to create, manage and share maps of wherever you and your iPhone find yourselves. At any point along your journey, use Logstr to document your position, adding a description or snap a picture if you'd like, and save the point under the “adventure” of your choice.

Then this user-friendly application makes it easy to share your annotated and illustrated adventures with family and friends via an email for one location or a KML/KMZ file that opens in Google Earth. The ultimate map creator, Logstr also allows users to manage multiple adventures simultaneously and share as-yet-uncompleted adventures in progress.

Features:

  • Create maps of your “adventures” by adding GPS coordinates, descriptions and pictures to points and experiences along your route
  • Manage multiple adventures simultaneously
  • Continue updating and sharing ongoing, open-ended adventures
  • Easily export your maps for use with Google Maps and Google Earth
  • Share your adventures by email

If you are chronicling a cross-country trip, documenting high points on a backpacking trek or on an adventure of a life time Logstr allows you to preserve and share those memories.

You'll also find Logstr useful in everyday situations, too such as: mapping your favorite local restaurants or coffee shops, noting interesting homes or sale or rent, documenting your weekend trek to farmers markets or garage sales, keeping track of delivery routes or bike rides, and much more.

Logstr transforms your iPhone into an ideal mapping tool for the adventurous soul, creating the perfect visual souvenir and record for you and a great “wish you were here” postcard for friends and family. With Logstr, creating travel logs is fun and easy!

I'm presenting "Getting Oriented with MapKit" at 360iDev

Tagged:  

I'm presenting a talk titled "Getting Oriented with MapKit: Everything you need to get startd with the new mapping framework" in a few weeks at 360iDev September 27-30 2009 in Denver. I spoke at the last one in San Jose at the beginning at the year and had an awesome time. It was clearly one of the best conferences I have ever been too as I learned so much and met so many great people. If you are at all interested I highly recommend it.

Speaking at iPhone Developer Summit

Tagged:  

In two weeks I'll be at the iPhone Developer Summit. I'm presenting an intro to native iPhone development. If you are attending make sure to stop by and and say hi.

WWDC next week

Tagged:  

I'm going to be at WWDC next week. Please feel free to get in touch if you would like to meet up. Perhaps twitter would be a good way to coordinate. I'm @JulioBarros

Looking forward to it.

Syndicate content