'Freedom From Porn': Steve Was Right

Back in May Steve Jobs got into a wee bit of email confrontation with Ryan Tate over the finer points of whether or not Apple was still a revolutionary company based upon their recent actions of going after the Gawker blogger/journalist/thief/revolutionary/martyr/whatever for publishing and printing information on the yet release iPhone 4.  One of the most circulated quotes from sed email exchange was "freedom from porn".  Even as a big Apple supporter that I am I had to laugh a little.  I do think Steve and his band of merry men and women are making the right business decisions I thought that one particular reasoning was somewhat of a copout used by politicians who want to guilt voters into believing in some draconian policy.  That was until I was watching my 3 year old niece play a Snow White puzzle game on my brother-in-law's Android Incredible.  The app was free with ad support.

Disclaimer: I FIRMLY believe that it is a parents responsibility to monitor what their children are doing online.

I was completely shocked when I saw an ad for "Sexy Single Chat Line" on a kids game.  People complain how Apple has "jump the shark" or "sold out" by having tight control on the advertising model of iAds or the submission process of apps, but having a completely "open" system is not necessarily a good thing. Apple has struck the right balance between along enough flexibility for developers to be create wonderfully creative and useful apps, but in the meantime maintaining a high standard of quality. 

Needless to say the app got deleted immediately and she played a similar game on my iPhone.

JandB Photo App Officially Launched

The past three months I have been working on an iPhone app for a local photographer John Childress.  Like most great iPhone apps, the idea that John had dealt with a concept that would:
  1. Get him iPhone app market for his business
  2. Provide a new value-added service to his customers
  3. Providing a new form of media to promote his business to potential new customers
In doing research for the app he and looked at a lot of other photo gallery viewing apps in the App Store to see what features dominated and most importantly what could he offer that others didn't.  Currently, after you have a photo shoot John will send you a gallery code and you can then view the flash slideshow on his site.  There are few issues  with the "mobile" market that we all live in now.  The first is you can't view flash on the iPhone so trying to view your photos on the phone and show them off to friends and family is not possible.  Rewriting his gallery website to be non-flash would be a good idea, but the system is currently in place and is integrated with his core business aspects.  The other roadblock that he runs into is that most people want to view slides shows with a soundtrack. 

*I think I just heard the RIAA scramble to call their lawyers for a lawsuit just for a business thinking of doing that*

With the JandB Photo app, which is a free download, users can add a gallery to their phone and enjoy the slideshow of images with an optional custom soundtrack from tracks on your phone.  Want to share a picture on Facebook?  Not a problem that feature in there as well.  Want to view current specials that John is offering, there is a place for that.

What I really love about the app from a consumer point-of-view is that it is simple and straightforward.  There is not guessing about what to do.  A specific task is performed in the least amount of steps.  You don't have to think.  From a developer's point of view this app was one of the more challenging apps I have done and learned a lot.  The app uses two complex frameworks.  Three20 and Google's objective-c framework.  Though integrating these components took sometime and I went through a few glasses of wine for support, both saved me COUNTLESS hours of custom development.

Three20 Modifications
Apple should really be THANKING @joehewitt for this work his creation of the Three20 framework.  Especially the photo gallery/viewer components.  If it wasn't for Three20 then I am sure that developers would be rioting outside of 1 Infinite Looper Cupertino, CA for the lack of such important piece of built-in functionality.  With all it's glory though I did have to make some modifications which include integration of posting an image to Facebook and adding in the ability to play an playlist that is associated with the gallery.  Unfortunately, and I plan on working on this soon, I had to modify the core source which to be frank felt dirty.  I just didn't have time to write classes extensions and categories for the gallery controller and viewer controller.

Google Objective-C Library
Man there really is a lot going with this library.  Everything and the kitchen sink.  When scouring through the wiki page for this I didn't see a lot of really good iPhone examples, but I was able to piece together what I couldn't figure out from their Mac example to modify a document and worked without a problem.  My only real disappointment with this library is that there, IMHO, waaaaaay too many delegate methods and callbacks.  With that being said I do understand why. Google gives you granular control of the content, metadata, revisions, ALC, etc. and objective-c is verbose so the end result is a lot of code to accomplish what I need which was: lookup a document by a given name, grab the latest revision, insert text at the end, close/save the document.

All in all I am very happy with the app.  The first few future releases will mainly deal with performance.  I still feel that I could squeeze some more performance on parsing through the images on the server side and optimize the network calls on the phone.  After that some UI tweaks. To me the gallery listing could be a little prettier.  Most importantly any enhancements that users want to see.  Feedback is always welcome.

Head over to the App Store and check it out.  If you want a check another gallery besides the default, then use "McKinna", without quotes.  Shameless plug for my daughter.

Benefits to Proxying APIs Using with Your Own Servers

Last night I was hacking away at some new features in EraseUrX and I ran into, what I still don't know is, a coding error on my part or incomplete api with Facebook. At this point it really could be either one. I am using their graph api and have no problem authorizing a user, requesting extended permissions and getting a list of friends from that user.  However, when I try to post a message to someone else's wall I get an OAuthException message that Facebook couldn't authorize the application.  WTF?! I thought possibly that my access token was invalid or that my url that I was posting with was incorrect. Nope they are fine. I tested it using curl and the post went through just fine with the same access token. After a few more code changes to no avail I decided to approach it from a different angle.

Though most big services take a lot of pride and care in their API's that they produce they still inevitably change method names, authentication schemes, parameters, validation, etc. This type of uncertainty isn't easily managed when you have compiled code on a device.  If/when a service provide decides to change/delete something from their API, your app could possibly break leaving the users pissed and blaming you.  Even though it TECHNICALLY isn't your fault, developers should take ownership and responsibility to do whatever they can to provide applications with the best user experience.

I decided that I would create a small webapp/script on my server that would act as a proxy or broker between api calls from my app and Facebook. On the surface it looks like it is overkill, but the benefits definitely outweigh the overhead.

A standardized output
Depending on if my request is successful or not to Facebook I will get a different JSON response which is fine, but the JSON structure is also different.  If I were do to all response checking on the phone, not only is it EXTREMELY verbose, but I don't want to have to parse through two different object graphs.  Instead my webapp will get the respone(s) and create a standard response structure of my choice. Something like this:

// Success
  'status': 'success',
  "data": [
         "name": "John Doe",
         "id": "55555"
         "name": "Jane Doe",
         "id": "6666666"

  'status': 'error',
  "data": [
         "message": "Bad error message",
   "title" : "Bad error message  title",
         "type": "666"

Having a standardized response my app code looks for an exact value in the json string, 'status', and transverse the rest of the json response and process everything accordingly.  Efficiency.

APIs Change
As stated above service providers (Facebook, Twitter, Google, etc.) can/will change their api at any given time.  It is by far easier to change code in a webapp, test and deploy then it is to modify code, no matter how well written it is, in a native device app.

Better Monitoring and Logging
Having your native apps hit your script will allow for better monitoring of a) how many user's are actually using your app b) if there are errors you can track down them down easier and faster c) more accurate analytics that are based on your use cases.  In addition, being able to integrate those stats into other business initatives and integration points.

Result Caching
I would bet that companies like Facebook are caching result sets for a better/faster response, but we will never know and to the full extent they are caching.  You can setup your own caching architecture that will best serve you and your apps needs supplementary to whatever may or may not be provided by the service.

Disaster Recovery
We have all seen the Twitter "fail whale" which means that ANY app trying to utilize that API is housed for x amount of time, which is not a good thing.  Having your own server side script would allow you to handle those unfortunate instances when the service is unavailable by using a cached copy of the result set if one is available or send back a message in your standard response that allows your app to present to the user that that piece of functionality isn't working at the moment.

By handling the majority of the requests/response on my server I reduce the amount of boilerplate code/frameworks that are in my iPhone/Android/Blackberry app, able to standarize the message format for more efficient parsing on the device and provide a better user experience.

Turn by Turn Directions with MapKit and Google Maps

Update - 03.31.2010

I decided that I didn't like the accuracy of the location from the browser.  It is isn't as good as the MapKit or default Google Maps app on the phone.  I added a button the directions page to open default maps application.

One of the best features used in Google Maps is the turn-by-turn directions.  Unfortunately, I haven't seen, and don't even know if it exists without proprietary code, an effective way to show turn-by-turn directions using the MapKit API in the iPhone SDK.  Though Google announced that they have included it in their Android platform they were vague about if/when it might come to the iPhone SDK.  No matter, where there is CoreLocation there is a way.

Most smaller companies only have one "brick and mortar" location.  So I wanted to show that location on the map and then present the user with ability to get turn by turn directions to their location.  In my example app the marker will show the location of my favorite sushi place in Memphis, Sekisui's Pacific Rim.

No clear way to implement turn-by-turn directions with MapKit using the iPhone SDK.  Though Safari for the iPhone has the ability to get your current location via the browser, i wasn't very impressed with it's accuracy.

Use CoreLocation to get the user's lat/long and then pass that to a UIWebView that will display a Google Map with directions.  Though in this example I am using a local html that is stored on the phone a better implementation would be to have the file stored remotely and then cached on the user's phone for faster load time.  However, it is important to note that you should "decache" the file if the user's previous coordinates are different then their new current location.

For the best results and accuracy it is better to run this on your device since CoreLocation the simulate will show Apple's headquarters as the user's location.

Google Fiber for Memphis

If I can't get to Google then why not bring Google to Memphis.  The latest project that I worked on is the promotional site to campaign for the Google Fiber project to select Memphis as one of the cities for the it's ultra-fast network infrastructure.  It, by-far, has been one of most rewarding endeavors that I have had the privilege to be apart of.  Not only because of the different technologies that were used for the site (jQuery, Google Docs, Google Buzz, Twitter, Facebook, YouTube, my custom ZF CMS), but also I was able to give back something to the community in hopes of growing not only the local economy, but also foster greater innovation for the rest of the world.

Support Memphis in it's bid for Google Fiber.  Due your small part in something BIG.