Do I really Need An iPhone App?

I’ve been asked this question a few times lately and no one likes to hear the answer, “It Depends”.  This question reminds me of the “Do I Need A Website” question that everyone asked in 1999-2000. 

Leander Kahney on Cult of Mac had a great article about a similar conversation at CES called “CES: Companies Must Have An iPhone App or They Don’t Exist”.  The article is great and the comments are even better. 

You first need to focus on what experience you are looking to provide to your customers.  After you’ve decided on your purpose and how you want to present this to the user, then you should select your medium.  You also need to ask yourself if you are ready to own a software product.  Unlike a website you need to worry about versioning, piracy, installation problems, etc.

My recommendations 80% of the time is to focus on optimizing your website for mobile browsing.  This approach allows you to target all of the popular mobile devices (iPhone, Android, Blackberry, etc) without having to build an application for each platform.  CSSiPhone.com shows some excellent examples of websites optimized for the iPhone and other mobile devices.  With frameworks like iUI and jQTouch you can style your site to mimic native applications using only CSS and JavaScript. 

There are several frameworks and articles listed below help get you started.

If you feel you need an app anyway but don’t want to invest in developing and maintaining a software product there are tools/services that help you convert your website into an iPhone app quickly and cheaply.  Although I’m not a fan of this approach, it allows you to publish content to a mobile device without any real development concerns.  When using these tools/services I would caution that you read their features closely.  They almost always provide less functionality then any of the existing apps you are looking to mimic.

Below is a list of a few services that help with this conversion.

Sound, When Words & Images Are Not Enough

One of the joys and challenges of designing mobile applications is using the multimedia features of the device to provide cues on how to use your program.  The iPhone, Android, and Palm Pre all provide advanced graphic, video, and audio support.

We all know our applications need to look got to even get downloaded.  But, let’s not forget the proper use of sound can be just as important as your visual cues.  If you are building a game I would doubly stress the important of sound.  If you’ve ever played Mike Tyson’s Punch Out as a kid you most likely can’t remember many of the characters but you can remember the crowd roar and the bell ring.

Apple has made effective use of sound in many of their applications.  For those of us who use the iPhone delay the most common example is the sound played letting you know your mail has been sent.

A few resources to get you started:

Before purchasing any media resources carefully review the licensing options. If they are not 100% clear for your situation I highly recommend contacting the vendor for permission and/or details. 

Visual Studio 2010 Launch Date

In a recent post Rob Caron just announced that .Net 4 and Visual Studio 2010 will be shipping on April 12, 2010.

It will be interesting to see if Microsoft has been able to address the performance issues found in the earlier betas.  Visual Studio 2008 sets the bar pretty high, it will be exciting to see if they can raise expectations again.

VisualStudioLogo

Android 9-Patch Images

In an effort to make my Android app as flashy as my iPhone app I ran into something just plain odd.  All of the images looked furry.  It seems Android uses something called 9-Patch images.  9-patch graphics get their name for the fact they have 9 areas called patches that scale separately. 

So now I figured out my problem I figured there had to be a Photoshop plug-in that allowed me to convert my existing png or psd into 9-Patch format.  Unfortunately it seems the only way to do this currently is to use the draw9patch utility that ships with the Android SDK.

I’m still working on converting and will provide an update if there is any interesting tips or tricks that surface during the process.

To convert and set my areas I’m using the below references.

 

Some jQuery 1.40 Launch Resources

January 14, 2010 marks jQuery’s 4th birthday and the release version 1.40. 

The jQuery team has put together a launch event called 14 days of jQuery.  I highly recommend checking out the launch site http://jQuery14.com.

If you take your news in podcast format, you can find John Resig taking about the 1.4 release and the future of jQuery on the official jQuery podcast episode 7.  On this episode John also announced the jQuery team will be focusing on testing and optimizing for mobile devices.  This could mean a version that addresses the 25k caching limit and other jQuery performance issues found on the iPhone.

Google has already pushed version 1.4 out on it’s CDN, please reference this link for the details.

Give me your favorite four ways to do FOR

In listening to a recent Stackoverflow podcast Joel Spolsky was discussing one of his interview questions.  How to determine if a point is within a rectangle.    This was a great question and I spent the rest of my commute trying to determine how many different languages and ways you can do this.

My favorite has to be using the .Net framework’s Rectangle.Contains(Put Point Here). 

Point MyPoint2Test = new Point(10, 10); 
Rectangle MyRectangle
= new Rectangle(20, 40, 40, 40);

bool RectangleContainsPoint = ((MyPoint2Test.X >= MyRectangle.Left) &&
(MyPoint2Test.X
< MyRectangle.Right) &&
(MyPoint2Test.Y
>= MyRectangle.Top) &&
(MyPoint2Test.Y
< MyRectangle.Bottom));

Debug.Assert((RectangleContainsPoint
== MyRectangle.Contains(MyPoint2Test));




This made me think. In any given day most developers, at least I do, program in several languages.  Even if you are only flipping back and forth between C# and Vb.Net.  This made me think of another basic interview questions.  Can you show me four different ways to write a simple FOR loop.  Bonus points for different languages.



JavaScript



for (var i = 0; i < arr.length; i++) {
// some code here
}


 



Or



for (var i = 0, len = arr.length; i < len; i++) {
// some code here
}




C#



for(int i = 1;i<=10;i++)
{
//Some code here
}


PL/SQL



FOR i IN 1..1000 LOOP
-- Some code here
END LOOP;


Java



for (int i = 0; i < args.length; i = i + 1) { // Test and Loop
// Some code here
}

Using Git with ProjectLocker on the Mac

I can’t say enough about ProjectLocker, they offer a great service with support for SVN and Git. As a newbie to Git I thought it might be worthwhile to share my installation and setup steps.

Please note the below steps assume you are running Snow Leopard and have already have a ProjectLocker Account.

    1) Install Git using the Git for OS X installer
     
    2) I also recommend installing Open Terminal Here which allows you to open a terminal window directly from the current Finder directory.
     
    3) Either using Open Terminal Here or a standard terminal window navigate to your project directory.
     
    4) In the terminal window type git init this will create the subdirectory .git
     

    5) If you do not have a public key you will to create one as outlined below:

    Navigate back to your home (User) directory ( if you get lost close and re-open terminal)

        • Generate a public key by typing the following in the terminal window ssh-keygen –t dsa
    • This will create a new hidden directory called .ssh
     
    6) Navigate to this directory by typing the following in the terminal window cd .ssh
     
    7 ) Open your key using TextEdit by typing the following in the terminal window open –a textedit id_dsa.pub  This will open your public key in TextEdit. This key is needed in your ProjectLocker setup.
     
    8) Login to your ProjectLocker account
     
    9) Select the Manage Public Keys link on the left hand side of the screen under User Links
     
    10) On the Manage Public Keys screen press the New Key option at the bottom of the screen.
     
    11) Paste the entire contents of your public key now open in TextEdit into the Key field in your ProjectLocker Screen, Fill in the name on the Manage Public Keys screen to anything. This is just a label to help you organize your keys. Generally I think it is best to make this your computer name.  The User Name field is alittle tricky. This is generally your login username on your machine. The easiest way to confirm what username to enter is to look at the last part of your key. This should have your username. See the below example:
    PL6
    12) Press Save Public Key and you are ready to start setting up your ProjectLocker Git project
     
    13) Press the Add Project link located on the left of your screen under Account Links.
     
    14) Enter your project name and description, then select a Repository Type of Git see below example:
    PL3
    15) Now press the List Projects on the left of your screen under Account Links.
     
    16) Press the Edit option for your project and enable HTTP Access as shown below:
    PL4
    17) After you press Save Changes you will be taken to a screen showing your project details. You want to verify that your username is listed in the Users In Project section. If it is not press the Add option next to your name under the Account Users not Assigned to this project section.
     

    18) Now press the User Home link on the left of your screen under User Links. This lists all projects you have access to. Scroll to see your new Git project. Which should look something like the below:

    PL5
    19) The Git Location information is needed when you are setting up your remote repository. Copy this string to your clipboard, you’ll need this in a minute.
     

    20) Go back to your terminal window and navigate back to your project directory setup in step #3.

    In your terminal window type git remote add origin git-ConceptGeek@free1.projectlocker.com:MyTest.git (Substitute the Git Location information git-ConceptGeek@free1.projectlocker.com:MyTest.git with what you have copied to your clipboard as part of step #19)

     
    21) Then in your terminal window type git add * this will add files in your project directory into your local git repository.
     
    22) Now that you’ve added files to your repository you need to do an initial commit. In your terminal window type git commit –am “Initial commit” and press enter.

 

Finally you will need to push your local copy to ProjectLocker. You can do this by typing git push origin master in your terminal window or using a GUI client as one of those detailed in this post.

I’m sure there is a more efficient why to configure Git to speak with ProjectLocker, but as a Git and Mac newbie the above seemed to work best for me. I haven’t been able to find thorough documentation on this subject so hopefully it helps someone out along the way.

Working with Git on the Mac

Over the last few months I’ve found myself doing more and more development on the Mac. Though it has taken some getting used to MonoDevelop, TextMate, and Titanium are now daily companions. The more I develop the more I seem to be struggling with the last and most important piece of the development workflow, source code management.

At first I tried SCPlugin, a clone of the TortoiseSVN which I use daily. The only problem is as soon as you upgrade to Snow Leopard, this is no longer an alternative.

It seems as though everyone is using Git. Since switching to the Mac comes with it’s own learning curve, now seems the right time to give Git on the Mac a try.

I found the following StackOverFlow posts extremely helpful starting place to find what clients are available:

After alittle digging around I’ve found GitX. The project looked promising and has gotten many good reviews. Unfortunately coming from a Windows development background it doesn’t yet fit my workflow. I’ll be tracking this project going forward. GitX-History

I also found Gitty and SmartGit. Both of these are commercial software packages.

Gitty is reasonably priced at $18 and offers a majority of the functionality anyone would need.

The modified view allows you to quickly see the status of your files. I did find the list view challenging to navigate for large projects.
5

SmartGit offers both a Commercial and Non Commercial License. They also provide a Windows and Mac version. The SmartGit product so far seems to be the best fit for my development style.

I’m still waiting to see what functionality differs between the Commercial and Non Commercial versions. The price tag of $69 is alittle high to be used for open-source or hobby development. SmartGit seems focused on providing an Enterprise product for cross platform development.
teaser-picture

If you have any recommendations for this Git newbie I’d be greatly appreciated.

Happy development.

Yet Another Easy Button Template

I’ve been working on my first mobile game for the iPhone and Android platforms.  I wanted to add a big red start button on my launch page / scoreboard.  After being subjected to countless Staples holiday commercials about the “easy button” that icon quickly came to mind.  Alittle time in Photoshop and I put together my own push button.

In the holiday spirit I thought I’d share the Photoshop template.

EzButtonTemplate sample1
 

PhotoshopCS2Icon templateDownload