Archive for 2008

Jun 20 2008

Road to iPhone: Intro

Published by john under iPhone

Having spent the past 8 years working with mobile application development (beginning with the book Core J2ME that I wrote in 2000), it’s odd that its taken me so long to dive into developing for the iPhone. The good news is, I’m now fully engaged and plan to spend a fair amount of time writing about this new endeavor…

This is the first in what I anticipate to be a long series of posts as I ramp up on all things iPhone. The intention is to share how I am going about learning to develop iPhone applications, in the hopes it can help you.

To begin, my plan is to learn the following, in the order shown below (with Xcode, Apple’s development environment, thrown in as needed):

  • Objective-C
  • Cocoa
  • iPhone SDK (API’s)

So let me begin by pointing you to a few resources:

As you’ll see once you download a few of the docs, there is huge amount of information here. To keep things in perspective, my intention is not to revisit all the material in the documents, as much as point out the nuances that I think will be important in becoming a proficient iPhone developer.

A good example is the next post in this series where I’ll point out how to work around one of the sore spots for many who come to Objective-C from an object-oriented language, lack of support for private methods. With Objective-C there are a few tricks to "hide" methods, however, it’s really just a slight-of-hand, so to speak. I’ll explain more later.

There is a fair amount of information to digest above (assuming you are new to Objective-C, Cocoa and/or Xcode). Once you are ready for more, here is a list of additional documents to further immerse yourself:

I hope you’ll join me as learn the ropes for developing iPhone applications.

2 responses so far

Jun 12 2008

Mobile Developer Survey, $1000 Drawing

Published by john under General

I was contacted by VisionMobile, a market analysis and strategic advisory firm in the wireless sector, to pass along a link to their most recent survey for developers who are building mobile applications.

Although this is not a Mac tip or trick, I know there is a great deal of application development done on a Mac for a range of mobile devices and platforms. Also, seeing as all developers who complete the survey will be entered into a drawing to win an Amazon voucher worth $1000, I thought you might be interested :)

The survey consists of 5 pages of questions, somewhere around 10-15 minutes of your time. The deadline to complete the survey is Friday, June 27th. The winner will be announced on Friday, July 4th.

If you are working with mobile devices, give it a go, your insight might be helpful to someone else down the road…

No responses yet

Jun 11 2008

iPhone SDK, First Impressions

Published by john under iPhone

I’ve been spending some time with the iPhone SDK to get a perspective on the architecture, tools and overall landscape. In addition, I’ve started to develop a few applications with Xcode (Cocoa/Objective-C) to exercise the tools for building iPhone applications. More on application development next week…

So far, I’m impressed. Here’s how I see things…

The Platform:
The iPhone architecture consists of the Core OS (kernel level resources), Core Services (system services), Media (audio, video and graphics) and Cocoa Touch (classes for managing graphics and event-driven applications).

From my perspective, there are two key areas that are exposed. First, the system services in Core OS, accessible through a C library (LibSystem) where one can work with wrappers for low-level features such as threading, networking, file system, Bonjour, among others.

Second, and even more compelling from a user interaction perspective, is the Media layer. Quartz is a 2-D drawing engine. Through the C-based API one can work with vector graphics, lines and shapes, etc. Core Animation is an Objective-C API providing animation and is also part-and-parcel to providing dynamic feedback from the UI. Many of the standard animations that make the iPhone so compelling (screens sliding, flipping over, etc) are included in View classes in the UIKit. OpenGL ES is a mobile version of the OpenGL standard and is the engine behind 3-D graphics. When high-frame rates are in order (think games), OpenGL is the answer.

From what I can tell, the iPhone SDK looks quite comprehensive, providing access across all areas of the device.

Distribution:
One of the challenges since day one for mobile developers has been getting their applications in front of potential users. With the iPhone, applications will be available through Apple’s App Store, which is accessible on the phone as well as through a desktop/laptop system. My understanding is that Apple will offer developers 70% of the revenue. Not unreasonable given Apple will provide the store front and manage all that goes with it.

Overall, an impressive start to what I think could be a significant, and welcome change, to the mobile development landscape.

Technorati Tags:

No responses yet

Jun 10 2008

TextMate: Working with Comments

Published by john under TextMate

In a recent email exchange with Allan Odgaard, creator of TextMate, I asked if he had any suggestions for tips that would make for a good screencast. Allan mentioned that on the TextMate IRC, there are often questions about working with comments. And with that, he shared a list of tips that you’ll find in the video that follows.

There are five tips on working with comments, including toggling comments on/off, commenting a subset of a line, inserting comment blocks and a short section on how to insert todo lists inside a comment block.

Summary of tips:

  • Apple-/ Togggle comment
  • Alt-Apple-/ Comment a block and comment subset of a line
  • “head” tab-key Insert comment header at top of file
  • Control-Shift-B Insert comment banner (top of declaration, function, etc)
  • “todo” tab-key Insert todo block

Note: In order for these features to work, you will need to make sure the Source and TODO bundles are enabled within TextMate (see the video for more information).



The music in the video is J.J. Cale and the song: Call Me the Breeze.
Click to hear a longer clip of J.J. Cale:

Technorati Tags: ,

4 responses so far

Jun 09 2008

Sponsor: Give Good Food to Your Mac

Published by john under Sponsors

I’d like to introduce (and thank) another sponsor of Mac Developer Tips: Give Good Food to your Mac is a two week promotion, coinciding with the kickoff of the World Wide Mac Developer Conference, that is offering an intriguing assortment of tools and utilities for developers. From database tools such as DBVisualizer to REALBasic cross-platform IDE to SourceGaurdian PHP encoder, there is assortment of interesting software.

To see what Give Good Food to Your Mac has to offer, click on the banner ad to the right or one of the links in this post (no, I am not paid on a per-click basis :) and spend a few minutes to check out some of the tools and utilities. There are discounts from 20 to 50% while the kitchen is open between the 9th and the 23rd of June 2008.

Here’s a quote from the creators of the promotion that sheds a little light into the name and intention:

No junk food, just healthy, tasty and innovative products. And because we are speaking ‘haute cuisine’ everybody gets to create their own combination of titles matching their own and unique taste.

No responses yet

Jun 06 2008

At Least They Are Consistent…

Published by john under Humor

I’ve been searching for an “ergonomic” keyboard recently and figured I owed it to myself to give one of the Microsoft split keyboards a go.

The keyboard is fine, if not unusual. I find myself spending a fair amount of time looking at the keys as I type since my index fingers have typically done this goofy crossing-over each other reaching for keys that should of been handled by another finger (alas, the split keyboard idea). If nothing else, my typing is much slower and more methodical. The jury is still out on whether this is the best solution of me to ease some of the stress of typing…

What I find rathering amusing is that MS pops up the following warning during the install process:

If you’ve spent any amount of time working on an MS platform, or even if not and you’ve read about the frustrations, you’ll understand the irony behind this dialog and why as a Mac user, it’s amusing.

For what it’s worth, I’ve decided to make Friday’s posts things that are not as much tips as something more on the humorous side. If you have ideas and suggestions, drop me a note.

Technorati Tags:

2 responses so far

Jun 03 2008

Using a String as a File in Ruby

Published by john under Ruby

The ability to treat a string as a file can often be quite handy. Generally this most useful when classes/methods expect a file object as an input type. With Ruby, you can use the StringIO library to use a string when a file is expected, thus allowing operations such as read, write, rewind, etc.

In the lines below, the code after the #=> shows the results when executing the script. Follow the code to see several examples of a string using operations that are typically reserved for files.

require 'stringio'
str = StringIO.new %{This is a test of a string as a file. \r\n
                     And this could be another line in the file}

# Get a line
str.gets # => "This is a test of a string as a file. \r\n"

# Get the next 18 charaters
str.read(18) # => " And this could be"

# Seek to new position and read 7 more characters
str.pos = 59  # => 59
str.read(7) # => "another"

# Rewind the file and overwrite some of the existing text
str.rewind
str.write("Here's how to use")

# Rewind again and output the new contents
str.rewind
str.read # => "Here's how to use a string as a file.
     \r\n And this could be another line in the file"
str.eof? # => true

Any easy way to work with a string in a method that is expecting a file is to create a new StringIO object and pass the result to the method requiring a file type. For example:

  some_method(StringIO.new("Your string here"))

Technorati Tags: , ,

3 responses so far

« Prev - Next »