Interesting Info About iAds For Developers

So far iAds have provided a very high CPM rate although some have complained about the fill rates.  Recently Apple announced their iAds for developers program.

Here’s some of the more interesting info about it:

  • The cost is 0.25 cents per click, radically lower than the high cost per click paid for brand advertising.
  • One developer stated they had a conversion rate of 20%
  • Competitors apps can be excluded
  • You can’t choose to display specific ads in your app

Overall with the conversion rate and pricing it looks like things are looking extremely good for the new iAds for developers feature.

If you liked this info, please share it!

[Source: Business Insider]

©2010 iPhone iOS 4 iPad SDK Development Tutorials, Programming Tips, News. All Rights Reserved.

.

Share and Enjoy:

RSS
Twitter
Facebook
DZone
HackerNews
del.icio.us
FriendFeed

Handling Z-Ordering In Cocos2D Map Based Games

If you’ve used Cocos2D for awhile you may have had some difficult when trying to handle the display order of images.

Things get even more complicated if you are creating an isometric game.  The player character may need to be placed behind an obstacle such as a rock or a tree.  In v0.99.1 automatic z-ordering for tile maps was implemented, and the problem was somewhat solved, but some problems still exist and there is some tweaking to be done.

Another problem, especially with map-based games is creating a player HUD display as the images need to be placed at the right z-ordering and at a consistent location on the screen.

Nat Weiss has created a tutorial on how to overcome these problems by creating two different custom sprite classes which can be found here:
CCZSprite and HudLevelSprite

These two classes should be of help to anyone interested in creating a map-based game in Cocos2D.

Thanks for reading, if you like this please share it!

©2010 iPhone iOS 4 iPad SDK Development Tutorials, Programming Tips, News. All Rights Reserved.

.

Share and Enjoy:

RSS
Twitter
Facebook
DZone
HackerNews
del.icio.us
FriendFeed

How To Push Out Notifications Locally Based On Time

There are times when you want to notify the user that an important event has occurred or will occur.

Push notifications are a great way to notify the user that an event has occurred and became a staple feature immediately after they were added into the iOS sdk.

Now local notifications are available that allow you to push a notification to the device that your app is running on based on time, the notifications can even be recurring.

Brandon Treb has written a great step-by-step tutorial on exactly how to do just that, which you can find here:
iPhone Programming Tutorial Notifications

Thanks for reading, if you like this please share it!

©2010 iPhone iOS 4 iPad SDK Development Tutorials, Programming Tips, News. All Rights Reserved.

.

Share and Enjoy:

RSS
Twitter
Facebook
DZone
HackerNews
del.icio.us
FriendFeed

Blocks – An Interesting Objective-C Addition In iOS 4

Blocks are a feature of the C language that have been added to the iPhone and iPad sdk with iOS 4.

What they allow you to do are create usable “blocks” of code that you can pass along like any object. This probably sounds a lot like a function, and they are very similar, but there is a significant difference in that they “close” around variables that are in scope before a block is declared.

I know this sounds odd, and you might be wondering when you’ll need to use them, but they certainly have their uses as there are definitely times when you will want a small block of reusable code.

You can find a complete tutorial from Mike Clark here that explains things better here:
Using Blocks In iOS 4

If you liked this, please share it!

[Via Joost Schuur]

©2010 iPhone iOS 4 iPad SDK Development Tutorials, Programming Tips, News. All Rights Reserved.

.

Share and Enjoy:

RSS
Twitter
Facebook
DZone
HackerNews
del.icio.us
FriendFeed

Beginner iPhone Action Game Programming Tutorial

Welcome to my iPhone action game tutorial. This is a step by step tutorial for creating an iPhone action game.

You can see the result of a game running the code in the video below:

The graphics are a bit different with the tutorial (as some of those in the video are being used in an actual project) but that is the result of running the actual code within the tutorial.

Specificially the tutorial features:

  • Loading/Placing Images
  • Animation
  • Touch Events
  • Text
  • Sound Effects
  • Background Music
  • Buttons
  • Resetting The Game

Now before we start there are a few pre-requisites. You should have a basic understanding of Objective-C and will need a Mac with the iPhone SDK installed. The game was created using iPhone SDK 4.0, and the Sparrow Framework. Also note that I created this to be as easy to follow as possible so I used a minimum number of classes/methods to make it as easy as possible for a beginner to follow – I’ve even exclusively used autorelease objects  so you don’t need to worry about memory management (one of the facets of Objective-C many beginners have trouble with).

In case you’re wondering why I chose to go the route of using the Sparrow Framework it’s because I believe it is the easiest iPhone game development framework available for free for a beginner to start with, and it has already been used in a number of games in the app store.

Please share this tutorial by tweeting it or sharing using one of the buttons at the bottom.  If you have a Dzone account you can vote it up here!

You can navigate through the tutorial by using the page numbers at the bottom of each page.

If you’d like to jump right in you can download a project with all the resources loaded in here.

At the very end of the tutorial you will find the completed project with extensive comments, and at the end of every page you will find a project file that will bring you up to that point of the tutorial.

Otherwise if you’d like to go the route of installing Sparrow, and setting everything up you can visit the Sparrow Framework getting started page here which explains the process of setting up an Xcode project that utilizes the Sparrow Framework. You can get just the game assets (graphics/sound) here.

The tutorial is definitely not perfect, and there are probably some spelling/grammar mistakes, but it is the most extensive single tutorial I’ve seen around and might never be released if I tried to perfect it :)

The first thing we’re going to do is start the game scene by displaying in a background image, adding the score and level text, and playing some music.  Go to page 2 by clicking that number at the bottom of this article to go to that page.

©2010 iPhone iOS 4 iPad SDK Development Tutorials, Programming Tips, News. All Rights Reserved.

.

Share and Enjoy:

RSS
Twitter
Facebook
DZone
HackerNews
del.icio.us
FriendFeed

The Best Resources In iOS Development August 3rd 2010 (For Week 07/24-07/30)

Welcome to another weekly summary.  I’m a bit late with this one as I was finishing up the Beginners iPhone Action Game Tutorial.  If you are looking for an extensive tutorial on creating an iPhone or iPad game I highly suggest you check it out.

Things have gotten a little bit slower with the number of quality resources for iOS developers appearing each week.  I’m guessing it has something to do with the weather.

That being said here are some good ones:

Blocks – An Interesting Objective-C Addition In iOS 4
A good tutorial on how to use C closures that have been added to the iOS sdk.

Great Beginner iPhone And iPad Dev Screencasts
Some good absolute beginner screencasts.  If you are totally new to programming and having trouble you will want to check these out.

Easy Open Source iPhone And iPad Library For Communicating With Web Services
A new library that makes it easier to obtain and parse data from web services.

Easy iPhone Simulator Screenshots With Status Bar Removed
An automatic image cropper to simplify iPhone app image taking.

How To Push Out Notifications Locally Based On Time
A tutorial on the new local timer based push notifications recently added to the iOS sdk.

That’s it, if you find something you like please share it!

©2010 iPhone iOS 4 iPad SDK Development Tutorials, Programming Tips, News. All Rights Reserved.

.

Share and Enjoy:

RSS
Twitter
Facebook
DZone
HackerNews
del.icio.us
FriendFeed

Hosting A Beta Test For Your iPhone and iPad Apps

Hosting a beta test for an iPhone or iPad app is often a bit much.  The time spent conducting such a test can be extremely costly.

If you are creating a more advanced app though it can be a necessity, and there are many things you will need to do such as: finding beta testers, sending out ad-hoc builds, guiding people through the install process, and filtering through the different responses.

Ray Wenderlich has written a great article that explores all of these facets and more in detail which you can find here:
How To Host A Beta Test For Your iOS App

Thanks for reading, if you lik this please share it!

©2010 iPhone iOS 4 iPad SDK Development Tutorials, Programming Tips, News. All Rights Reserved.

.

Share and Enjoy:

RSS
Twitter
Facebook
DZone
HackerNews
del.icio.us
FriendFeed

CNBC Feature – Planet of the Apps

Planet of the Apps: A Hand-held Revolution Premiered on January 7th 10pm ET on CNBC. In this program CNBC looked at at how apps have changed our lives, and they meet some of the creators behind them, and figure out just how big a business they really are. For those who missed the CNBC special feature on iPhone Apps, this is 45 minute show is a must see / download. Just search on Youtube for related clippings or if you know where on torrents you can probably download the full episode from – if in USA from Hulu, picrap.com, clicker.com or any TV show streaming site. For more information. Please log onto: www.planetoftheapps.cnbc.com

Click here to view the embedded video.

Music Play in iPhoneOS4

This is the very simple example . In this application we will see how to play music in iPhone oS4.

Step 1: Create a new project in Xcode using View base application. Give the application name “MusicPlay_OS4”.

Step 2: Xcode automatically creates the directory structure and adds essential frameworks to it. You can explore the directory structure to check out the content of the directory.

Step 3: xpand classes and notice Interface Builder created the MusicPlay_OS4ViewController class for you. Expand Resources and notice the template generated a separate nib, MusicPlay_OS4ViewController.xib, for the “MusicPlay_OS4”.

Step 4: We need to add sound files in the Resources folder. Give the name of the sound files “music.mp3”,”sound.aif”. And also add a backgroung image.

Step 5: We need to add also two frameworks.So select Frameworks -> Add -> Existing Framework -> then select AVFoundation.framework and AudioToolbox.framework.

Step 6: In the MusicPlay_OS4ViewController.h file, we have  importAVFoundation.framework and AudioToolbox.framework. Create a instance of  AVAudioPlayer and UIButton class and create two IBAction method. So make the following changes in the file.

#import <UIKit/UIKit.h>
#import <AudioToolbox/AudioToolbox.h>
#import <AVFoundation/AVFoundation.h>

@interface MusicPlay_OS4ViewController : UIViewController
<AVAudioPlayerDelegate>{
       
        SystemSoundID systemSoundID;
        AVAudioPlayer *player;
        UIButton *StartStopSound;
       
}

@property (nonatomic, retain) IBOutlet AVAudioPlayer *player;
@property (nonatomic, retain) IBOutlet UIButton *StartStopSound;

(IBAction) playSound: (id) sender;
(IBAction) playSong: (id) sender;

Step 7: Double click the MusicPlay_OS4ViewController.xib file and open it to the Interface Builder. First drag the Image View from the library and place it to the View window. Select the image view and bring up Attribute Inspector, select the background image. Drag two Round Rect button from the library and place it to the view window.Give the name of the button “Play Sound “and “Play Song” Connect File’s Owner icon to the View icon and select View. Drag File’s Owner icon to the Play Song button and select StartStopSound. Select the Play Sound button and bring up Connection Inspector and drag from the Touch Up Inside to the File’s Owner icon, select playSound: action. Do the same thing with PlaySong button and select the playSong: action. Now save the MusicPlay_OS4ViewController.xib file, close it and go back to the Xcode.

Step 8: Open the MusicPlay_OS4ViewController.m file and make the following changes in the file.

(void)viewDidLoad {
        NSLog(@"InView did load");
        AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:[[NSBundle mainBundle]
                                                                                                                                           pathForResource: @"sound" ofType:@"aif"]],
                                                                         &systemSoundID);
   
       
        player = [[AVAudioPlayer alloc]
                          initWithContentsOfURL:[NSURL fileURLWithPath:
                                                                         [[NSBundle mainBundle] pathForResource:@"music" ofType:@"mp3"]]
                          error:nil];
       
       
        [player prepareToPlay];
       
       
       
}

(IBAction) playSound:(id) sender {
       
        NSLog(@"In Sample");
        AudioServicesPlaySystemSound(systemSoundID);
}

(IBAction) playSong:(id) sender {
       
        if ([[NSString stringWithFormat:@"%@", [StartStopSound titleForState:UIControlStateNormal]] isEqualToString:@"Play Song"]) {   
                [player play]
                [StartStopSound setTitle:@"Stop Song" forState:UIControlStateNormal];   }
        else { 
                [player stop]
                [StartStopSound setTitle:@"Play Song" forState:UIControlStateNormal];  
        }      
}

Step 9: Now compile and run the application in the Simulator.

You can Download Source Code from here MusicPlay_OS4

Distimo Mobile Report – July 2010

This report covers the Apple App Store for iPad and iPhone (with specific focus on in-app purchases), as well as BlackBerry App World (Worldwide), Google Android Market, Nokia Ovi Store, Palm App Catalog and Windows Marketplace for Mobile for June 2010 in the United States. The major findings are:

* The percentage of applications with in-app purchases is significantly higher in the Apple App Store for iPad (10%) than in the Apple App Store for iPhone (2%). The Games and Social Networking categories in both stores have the highest proportion of applications with in-app purchases available.

* The most successful free applications that monetized using in-app purchases this month in the Apple App Store for iPhone are MobiTV (MobiTV), ESPN 2010 FIFA World Cup (ESPN) and Tap Fish (BayView Labs).

* The most successful paid applications that monetized using in-app purchases this month in the Apple App Store for iPhone are Guitar Hero (Activision Publishing, Inc.), TomTom U.S.A. (TomTom International BV) and Call of Duty: World at War: Zombies II (Activision Publishing, Inc.).

* Mirroring the Distimo report covering May 2010, Pages and iBooks, published by Apple Inc, are again the number one paid and free applications on the Apple App Store for iPad, respectively.

* Three out of the ten most popular applications in the Apple App Store for iPhone were published by Electronic Arts.

* Quickoffice Connect Mobile Suite for iPad entered the top 10 highest ranked paid applications chart in the 6th position. It was the top grossing application in the Apple App Store for iPad after Pages by Apple Inc.

* Nine out of the ten most popular paid applications on the Apple App Store for iPhone are Games, however only two out of the ten most popular free applications are Games. In the Nokia Ovi Store, seven out of ten of the most popular paid applications are Games, while only three out of ten of the most popular free applications are Games.

You can download the report here.

Change View in iPad

In this application we will see how to change view in iPad.

Step 1: Create a Window base application using template. Give the application name “Windowbase_iPad”.

Step 2: Xcode automatically creates the directory structure and adds essential frameworks to it. You can explore the directory structure to check out the content of the directory.

Step 3: xpand classes and notice Interface Builder created the Windowbase_iPadAppDelegate class for you. Expand Resources and notice the template generated a separate nib, MainWindow.xib, for the “Windowbase_iPad”.

Step 4: We need to add two images in the resource folder. Give the name of the resources “1-1.png”,”2-1.png”.

Step 5: We have added QuartzCore.framework, select Frameworks -> add -> Existing frameworks -> selectQuartzCore.framework.

Step 6: In the Windowbase_iPadAppDelegate.h file, we have added instances of UIView and UIImageView class, and create one IBAction method. So make the following changes in the file.

#import <UIKit/UIKit.h>

@interface Windowbase_iPadAppDelegate : NSObject <UIApplicationDelegate> {
   
        UIWindow *window;
        UIView  *subView;
        UIImageView *view1;
        UIImageView *view2;
        BOOL change;
}

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UIView  *subView;

(IBAction)ChangeView:(id)sender;

Step 7: Double click your MainWindow.xib file open it to the Interface Builder. Open the the window and drag view from the library and place it to the window. Next drag Toolbar from the library and place it buttom of the view window. Now select ViewChangeAppDelegate, and bring up connection inspector. Select from subView to the view, and ChangeView to the BarButtonItem. Now save your .xib file and go back to the Xcode.

Step 8: Open the Windowbase_iPadAppDelegate.m file and make the following changes in the file.

(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
       
        UIImage *image1 = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"1-1.png" ofType:nil]];
        view1 = [[UIImageView alloc] initWithImage:image1];
        UIImage *image2 = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"2-1.png" ofType:nil]];
        view2 = [[UIImageView alloc] initWithImage:image2];
        view2.hidden = YES;
        [subView addSubview:view1];
        [subView addSubview:view2];
        change = NO;
       
        [window makeKeyAndVisible];
       
        return YES;
}

(void)performTransition
{
       
        CATransition *transition = [CATransition animation];

        transition.duration = 0.75;
        transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
       
        NSString *types[4] = {kCATransitionMoveIn, kCATransitionPush, kCATransitionReveal, kCATransitionFade};
        NSString *subtypes[4] = {kCATransitionFromLeft, kCATransitionFromRight, kCATransitionFromTop, kCATransitionFromBottom};
        int rnd = random() % 4;
        transition.type = types[rnd];
        if(rnd < 3)     {
                transition.subtype = subtypes[random() % 4];
        }
       
        change = YES;
        transition.delegate = self;
       
        [subView.layer addAnimation:transition forKey:nil];
       
        view1.hidden = YES;
        view2.hidden = NO;
       
        UIImageView *tmp = view2;
        view2 = view1;
        view1 = tmp;
}

(void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag
{
        change = NO;
}

(IBAction)ChangeView:(id)sender
{
        if(!change)
        {
                [self performTransition];
        }
}

Step 9: Now compile and run the application in the Simulator.

You can Download SourceCode from here Windowbase_iPad

Make $400 to $5000 DAILY from Ad Revenues With Your Free App

The iPhone Apps get-rich-quick landscape is best suited for one of two people development shops. However, some companies are also making good revenues – specifically from in-app advertising.

In the report below, AdWhirl says that top apps can make $400 to $5,000 per day on ads. The average CPM works out to around $2 per 1000 impressions. It may not look  impressive but its substantially better than the CPM rates at Facebook or MySpace apps.

However – These apps are from the most popular section on the app store… listing within the top 100 free apps. This is what is causing a problem for small developers. You need to crack into the top 100 if you want to get to the $400 daily revenue target.



Adwhirl iPhone Advertising Snapshot



You can access the Adwhirl data report directly here.

Display Splash Screen in iPad

In this application we will see how to display Splash Screen in iPad.

Step 1: Create a View base application using template. Give the application name “DisplaySplash_iPad”.

Step 2: Xcode automatically creates the directory structure and adds essential frameworks to it. You can explore the directory structure to check out the content of the directory.

Step 3: Expand classes and notice Interface Builder created the DisplaySplash_iPadViewController class for you. Expand Resources and notice the template generated a separate nib, DisplaySplash_iPadViewController.xib, for the “DisplaySplash_iPad”.

Step 4: We need to add one resource in the resource folder for display splash.

Step 5: In the DisplaySplash_iPad.h file, we have created instance of UIView class and two methods. So make the following changes in the file.

#import <UIKit/UIKit.h>

@interface DisplaySplash_iPadViewController : UIViewController {

        IBOutlet UIView *displaySplashScreen;
       
}

(void)displayScreen;
(void)removeScreen;

Step 6: Double click the DisplaySplash_iPadViewController.xib file and open it to the Interface Builder. Drag the view from the library and place it to the Main Window. Open the second view icon from the MainWindow,drag the image view from the library and place it to the view window,select the view and bring up Attribute Inspector select the image “themes.png”. Select the File’s Owner icon from the MainWindow and bring up Connection Inspector, drag from the displayScreen to the last view icon and connect File’s Owner icon to the view. Now save it , close it and go back to the Xcode.

Step 7: Open the DisplaySplash_iPad.m file and make the following changes in the file.

(void)displayScreen
{
       
        UIViewController *displayViewController=[[UIViewController alloc] init];
        displayViewController.view = displaySplashScreen;
        [self presentModalViewController:displayViewController animated:NO];
    [self performSelector:@selector(removeScreen) withObject:nil afterDelay:6.0];
       
       
}

(void)removeScreen
{
        [[self modalViewController] dismissModalViewControllerAnimated:YES];
}

Step 8 : Now compile and run the application in the Simulator.

You can Download SourceCode from here DisplaySplash_iPad

ViewBase application in iPad

This is the simple View Base application. In this application we will display image,  button and label.

Step 1: Create a View base application using template. Give the application name “ViewBase_iPad”.

Step 2: Xcode automatically creates the directory structure and adds essential frameworks to it. You can explore the directory structure to check out the content of the directory.

Step 3: Xpand classes and notice Interface Builder created the ViewBase_iPadViewController class for you. Expand Resources and notice the template generated a separate nib,ViewBase_iPadViewController.xib, for the “ViewBase_iPad”.

Step 4: In the ViewBase_iPadViewController.h file, we have created instance of UILabel and UIImage class. Define one IBAction method. So make the following changes.

#import <UIKit/UIKit.h>

@interface ViewBase_iPadViewController : UIViewController {
       
 IBOutlet UILabel *myLabel;
 IBOutlet UIImage *myImage;

}

@property(nonatomic,retain) IBOutlet UILabel *myLabel;
@property(nonatomic,retain) IBOutlet UIImage *myImage;

(IBAction)ButtonPressed:(id)sender;

Step 5: Double click the ViewBase_iPadViewController.xib file and open it to the Interface Builder.First drag the Image View from the library and place it to the View window. Next drag label and Round Rect from the library and place it to the view window. Select the Round Rect from the view window and bring up Connection iNspector. Drag from the Touch Up Inside to the File’s Owner icon and select ButtonPressed: method. Connect File’s Owner icon to the View icon and select view and connect File’s Owner icon to the label select myLabel. Now save the ViewBase_iPadViewController.xib file, close it and go back to the Xcode.

Step 6: Open the ViewBase_iPadViewController.m file and make the following changes in the file.

(IBAction)ButtonPressed:(id)sender{

myLabel.text = @"Welocome to the Real World!!!";
}

Step 7: Now compile and run the application in the Simulator.

You can Download SourceCode from here ViewBase_iPad

Download Apple WWDC 2010 Session Videos and Source Code

This might be a bit late, but just in case you missed this one and did not get the email from Apple – please do have a look! You don’t need to purchase the DVDs if you missed this years Apple WWDC session. To access them, all you need is a registered Apple developer account from – http://developer.apple.com/videos/wwdc/2010/. Grab them in both low and high definition, and if you don’t have an account ask your friendly neighbor or get on Youtube or some other video sharing sites to see what is uploaded there :)

Here is the link – Must Watch WWDC 2010 Keynotes!