iPad

From $1
Table of contents

MonoTouch v2.0 has been released with iPad support.

The APIs exposed by MonoTouch for iPad reflect the APIs published by Apple on April 3rd, 2010 for iPhoneOS 3.2. 

This release contains MonoDevelop support for iPad projects: creating iPad projects, Universal iPad/iPhone projects, launching projects in the iPad simulator and intellisense for all the new APIs.

Requirements

  1. iPhone SDK 3.2 or higher
  2. MonoDevelop 2.2 (you will be upgrading to 2.2.2 for iPad support)
  3. MonoTouch 2.0

Installation

You must install the iPhone SDK 3.2 before following any of the following installation steps, if you do not install at least version 3.2, you will not be able to test or deploy iPad applications.

If you are new to MonoTouch, follow the standard installation instructions for MonoTouch.   Then continue here.

If you already have MonoTouch and MonoDevelop, start MonoDevelop, and go to the Help->Check For Updates menu option.  Upgrade to MonoDevelop 2.2.2

After installing the new MonoDevelop 2.2.2 release you will need to go into the updater (available from MonoDevelop's Help->Check For Updates Menu) .  If you have the iPhone SDK v3.2 properly installed you will be presented an alpha version of MonoTouch v2.0 with iPad support.   Download and install.

After successfully installing all the requirements you will have a new iPad project type availible in the iPhone options.

Working with MonoTouch/iPad

With the introduction of the iPad, developers can choose what kind of application they want to build:

  • iPhone or iPod-touch only applications
  • iPad-only applications
  • Universal applications: that can run on iPhone, iPod Touch or iPad platforms.
IPad Project Templates

In addition to the existing iPhone and iPod Touch project templates, new project templates have been created for both iPad applications and universal applications.      With these templates you can create either iPad-only applications or universal applications.

If you have an existing iPhone application, upgrading it to run on the iPad is very simple, you need to:

  • Set the minimum required OS version to 3.2 (see below)
  • Set the kind of application that you are building (see below)
  • Follow the Apple recommended guidelines for the iPad to target the iPad.
  • Select the resolutions you want to support
Configuring Your Application

In the "iPhone Build" settings pane in the project properties you need to make sure that you have selected the "Minimum OS Version" to be 3.2.   iOS 3.2 is the first version that supported the iPad.

In the "iPhone Application" settings pane in the project properties you can configure the kind of application that you want to build, the options are:

  • iPhone only
  • iPad only
  • iPhone and iPad (universal applications)

This is how you configure the UI based on the above setting:

  Main Interface File iPad Interface File
iPhone or iPod Touch Main UI Unused
iPad Main UI on the iPad Unused
Universal (iPad/iPhone/iPod Touch) UI file used when the program runs on the iPhone or the iPod Touch UI file used when program runs on the iPad

You also need to pick the orientations that your application will support.   You do this in the iPhone application section in your project properties by setting the proper value in "Orientation".

Testing your application

You can use the new iPhone Simulator Target option in the Project menu to pick which version of the iPhoneOS SDK to start up with and which simulator will be used (iPhone simulator or iPad simulator).  Changing this setting will change both the runtime and simulator used by the Run and Debug commands.

Additionally, if you just want to quickly launch your application with a different SDK or simulator, you can use the new Run With option from the Run menu.

Interface Builder and MonoDevelop.

When you add new Interface Builder elements to iPad projects, with the exception of the MainWindow added in the project template, they still default to their iPhone counterparts.  To change this, double clicking the XIB file in the Solution Pad after adding it and performing the following actions:

  1. Click File->Transition To->iPad
  2. Close the old iPhone style XIB
  3. File->Save As and overwrite the old XIB with the transitioned one
Downgrading

If you want to downgrade MonoTouch to the old APIs, you should re-install the monotouch.pkg package that you got originally.

Testing in iPad iPhone Mode

If you would like to test your existing projects in the iPad iPhone mode.  Simply change the Target SDK version to 3.2 in the appropriate project configuration.

Determining Running Device

You can check the UIScreen.MainScreen.Bounds.  The new iPad runs at 1024x768 whereas the iPhone runs at 480x320

 


Retrieved from "http://monotouch.net/IPad"

Tag page

Files (0)

 
Page last modified 04:22, 25 Jul 2010 by Miguel