How to Set Your App’s Splash Screen

Dec 9, 2009   //   by Derek van Vliet   //   Development  //  2 Comments

All iPhone apps have a splash screen, or what Apple refers to as a “launch image”. It is the screen that is displayed immediately after you press your app’s icon on the home screen, while the app icons are sweeping away and your app is zooming into view.

Some apps opt not to display a splash screen and go for a black screen, which is the default behaviour when you create an app. Others display a wireframe of the app’s interface in order to look like it is loading faster. See Apple’s native apps such as Clock and Camera for good examples of this. The most common use of the splash screen (especially in games) is to present a company or game logo, as we do in Addicus:

9

How to Do It

Apple has made it so easy to set your splash screen that you don’t even need a single line of code to do it. Why, you don’t even need to change a setting. Here’s how to set your splash screen it in just 2 steps:

1. Add a file to your project’s Resource folder called Default.png.

2. There is no step 2. Take this time to reflect on how good life is.

And that’s it. Run your app and your splash screen will zoom into glorious view.

Heads Up

A couple of things to watch out for when working with splash screens:

Whatever image you give it will be scaled to fill the 320×480 resolution of the iPhone, so ideally you would use a 320×480-sized image.

If your iPhone app is running in landscape mode, you need to rotate the splash screen you use. For example, our splash screen is rotated 90 degrees to the right in the above image.

iTunes Connect Unavailable to Developers Dec 23 – Dec 28, 2009

Dec 8, 2009   //   by Derek van Vliet   //   PSA  //  No Comments

news_calendarAllow us to take a break from our adventures in iPhone development to give you a brief service announcement.

Apple just announced that iTunes Connect, the site that developers use to submit and manage their iPhone apps, will be unavailable from December 23 – December 28, 2009. Quote:

iTunes Connect, the tool you use to manage your applications and access your reports, will be unavailable from December 23 through December 28, 2009.


Access to iTunes Connect will resume December 29, 2009.

This means a couple of things:

1. Developers will be flying blind for 6 days. They will not be able to access their sales data, crash logs or financial reports until Dec. 29.

2. This also means no new apps or updates to apps can be submitted to Apple during this time. Developers may have to adjust their schedules accordingly.

3. Users who were hoping that an app will go on sale for Christmas day are most likely out of luck since developers will not be able to change their prices during that time. Unless developers are prepared to hold a 6 day sale, don’t expect many deals on apps after you open your iPhone on Christmas morning.

We now return to your regularly scheduled iPhone dev blog.

How to Get the Platform Name

Dec 8, 2009   //   by Derek van Vliet   //   Development  //  1 Comment

With each iPhone OS-powered device that Apple has added to its lineup, along with it has come new capabilities and new APIs. Because of this, it is often necessary for an app to figure out what platform it is running on before deciding to enable device-specific functionality, such as functionality that would use the compass on the iPhone 3GS, vibration on iPhones or GPS on iPhones.

Here is a function that serves just that purpose by returning the internal name of the platform:

#include <sys/types.h>
#include <sys/sysctl.h>
 
-(NSString*)getPlatformName {
	size_t size;  
	sysctlbyname("hw.machine", NULL, &size, NULL, 0);  
	char *machine = (char*)malloc(size);  
	sysctlbyname("hw.machine", machine, &size, NULL, 0);  
	NSString *platform = [NSString stringWithCString:machine encoding:NSASCIIStringEncoding];
	free(machine);
 
	return platform;
}

Possible Values

The possible values that the above function will return when developing for the iPhone OS are listed below along with the product they represent.

Return Value Product
i386 iPhone Simulator
x86_64 iPhone Simulator
iPhone1,1 iPhone 1G
iPhone1,2 iPhone 3G
iPhone2,1 iPhone 3GS
iPhone3,1 iPhone ?
iPod1,1 iPod Touch 1G
iPod2,1 iPod Touch 2G

Example Usage

The following is an example of an if statement that takes advantage of the results of the above function.

NSString * platform = [self getPlatformName];
 
if ([platform isEqualToString:@"i386"]) {
	// do simulator-specific stuff, perhaps enable a more verbose level of logging?
}
else if ([platform isEqualToString:@"iPod2,1"]) {		
	// do iPod-specific stuff, perhaps disable UI that refers to GPS, vibration, etc.
}
else if ([platform isEqualToString:@"iPhone2,1"]) {
	// do iPhone 3GS-specific stuff, perhaps compass related?
}

Addicus Reviewed by AppShouter

Dec 8, 2009   //   by Derek van Vliet   //   In the Media  //  No Comments

Screen shot 2009-12-08 at 9.18.21 AM

AppShouter chimed in with the latest glowing review of Addicus today. Money quotes:

  • “a great game for both kids and adults.”
  • “The graphics are great and very cartoonish.”
  • “be careful because it is very addicting”

Read the full review here

How to Get the Current Time with NSDate

Dec 7, 2009   //   by Derek van Vliet   //   Development  //  No Comments

In iPhone app development, timing is everything. Being able to take a pulse on the current time is crucial to many apps, especially games. Fortunately, this can be done with as much ease as a developer would expect using the NSDate class in the iPhone SDK. Today’s iPhone development advent tip is another one-line wonder:

NSTimeInterval time = [[NSDate date] timeIntervalSince1970];

The timeIntervalSince1970 method returns the number of seconds since epoch. The return value type, NSTimeInterval, is a typedef of double, so you will have the necessary accuracy to get the current milliseconds from the first 3 digits after the decimal if need be.

How to Open the Mail App With a Pre-Composed HTML Email

Dec 6, 2009   //   by Derek van Vliet   //   Development  //  3 Comments

photo 2-1Have you ever wanted to open the Mail app with a pre-composed email? Then today’s iPhone development advent tip is the one for you! This has many uses, but a common one is a tell-a-friend feature in apps. If you attach the code from this tip to a button, you can give your users a way to promote your app to their friends via the iPhone’s built in Mail app.

A Handy Function

The sendEmailTo function, seen below, can be included in any class in your app. This function gives you a simple interface to send emails. It allows you to define “to” addresses, “cc” addresses, “bcc” addresses, a subject and a body. The body supports HTML tags.

- (void)sendEmailTo:(NSString*)to withCC:(NSString*)cc withBCC:(NSString*)bcc withSubject:(NSString*)subject withBody:(NSString*)body {
	NSString * url = [NSString stringWithFormat:@"mailto:?to=%@&cc=%@&bcc=%@&subject=%@&body=%@",
					  [to stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding],
					  [cc stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding],
					  [bcc stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding],
					  [subject stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding],
					  [body stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]];
 
	[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
}

NOTE: Running this function in the iPhone Simulator will have no effect because the simulator does not include the iPhone’s Mail app. To see the effects of this function, it must be run on a device.

Example Usage

Once you have that message defined in one of your classes, you can open the Mail app with a pre-composed email with just one message call. The following example opens an email and specifies a to, cc and bcc address. It populates the subject with “Addicus” and populates the body with a short message about Addicus that includes a link and an image (which is also a link). As you can see, this is done with good old HTML tags. This results in the email in the above screenshot.

[self sendEmailTo:@"mom@example.com"
           withCC:@"dad@example.com"
          withBCC:@"asecretfriend@example.com"
      withSubject:@"Addicus"
         withBody:@"<p>Check out this game, <a href='http://addicusgame.com'>Addicus</a>, for the iPhone and iPod Touch. It's super-addictive!</p><p><a href='http://addicusgame.com'><img src='http://getsetgames.com/wp-content/uploads/2009/11/icon_addicus.png'/></a></p>"];

If you would like to have the user specify the to, cc and bcc addresses themselves, as you would in the case of a tell-a-friend button, then you would call the following message:

[self sendEmailTo:@""
           withCC:@""
          withBCC:@""
      withSubject:@"Addicus"
         withBody:@"<p>Check out this game, <a href='http://addicusgame.com'>Addicus</a>, for the iPhone and iPod Touch. It's super-addictive!</p><p><a href='http://addicusgame.com'><img src='http://getsetgames.com/wp-content/uploads/2009/11/icon_addicus.png'/></a></p>"];

How to Load a UIImage From a URL

Dec 5, 2009   //   by Derek van Vliet   //   Development  //  1 Comment

Early on in development of Addicus, we discovered how easy it was to load images from the web. This was a huge boon to us since it meant our artists could modify assets on our server and they would update live in the test builds, without having to make a new build.

This all hinged on the ability to load a UIImage from a URL. And as it happens, this can be accomplished in as little as one line of code:

UIImage * img = [[UIImage alloc] initWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://example.com/image.png"]]];

This eventually led to us writing a resource manager singleton class that handles all of our resource loading and can be toggled between local and web mode.

Addicus in the Spotlight on OpenFeint’s Shiny New Site

Dec 5, 2009   //   by Derek van Vliet   //   In the Media  //  No Comments

Screen shot 2009-12-04 at 11.50.29 PM

iPhone social game network OpenFeint launched version 0.1 of their new website today. The new site’s slick design is made even more beautiful by the loveable little shrooms of Addicus. For you see, Addicus is one of the games that OpenFeint has selected to feature in their spotlight.

We have so many good things to say about OpenFeint that I wouldn’t know where to begin. From the easy integration to the feature-filled product to the stellar level of support, they have all the bases covered. You can expect many more OpenFeint-enabled games from Get Set Games.

Addicus Free Now Available on the iPhone App Store – For Free!

Dec 4, 2009   //   by Derek van Vliet   //   Announcements  //  No Comments

Free_shroom
We are delighted to announce that the free version of Addicus, called Addicus Free, is now available for download in the App Store. Addicus Free will give you a taste of the world of number-mushroom-adding fun, but without all the hassle of having to pay for it.

Like the full version, it has all of these heart-warming features:

  • Dozens of secret bonuses!
  • Multipliers and chain combos!
  • 70 unlockable achievements worth 1,000 Feint score!
  • Overdrive mode for ridiculously high scores!
  • Endless replayability!
  • Part of OpenFeint, the largest iPhone game community!
  • Integrated with Facebook and Twitter!

App_Store_Badge_100x200

Addicus 1.1 Update Now Available with 70 OpenFeint Achievements!

Dec 4, 2009   //   by Derek van Vliet   //   Announcements  //  No Comments

Update_shroom
Addicus version 1.1 is now available on the iPhone App Store! It has all the number-popping fun you’ve been enjoying, plus these new and wonderful additions:

  • added 70 unlockable achievements worth 1,000 Feint Score
  • option to publish to Twitter and Facebook
  • updated to OpenFeint 2.3.1
  • user interface improvements
  • minor bug fixes

Stay tuned for more totally awesome updates to Addicus!

App_Store_Badge_100x200

Our Games

Latest Tweets