Tuesday, December 16, 2014

Getting Started with iOS Programming

Getting Started with iOS Programming

 

However, when writing applications for iOS, you need to consider these
differences:
? Tiny keyboards: iOS device keyboards make data entry very difficult.
Data entry is no easy task to begin with, and touchscreen virtual keyboards,
which you press with your thumbs, are prone to data-entry
errors (for example, your app should provide smart spell-checking or
allow the user to simply select from a set of options rather than making
him type text).
Some applications are created primarily to enter data (think Twitter or
e-mail apps). However, try to limit data entry by doing things such as
prefilling commonly used default values and providing drop-down lists
that users can select from.
? Small display area: Displays on iOS devices come in these three shapes
and sizes (see Figure 1-1):
• 4-inch iPhone and iPod Touch
• 7.9-inch iPad mini
• 9.7-inch iPad

Compare these sizes to laptop screens, which are usually 15 inches or
larger, and you’ll see what I mean by limited screen space.
In order to be usable on small screens, an application must be designed
so as to allow users to
• Move intuitively in the program (without getting confused by a
maze of screens).
• Use controls (buttons, for example) that are large enough to press
easily and place them in a way that helps to prevent click errors.
? Universal applications needed: In order for an iOS application to be
popular, it must run on a range of devices with varied capabilities — that
is, the iPhone, the iPad mini, and the 9.7-inch iPad (refer to Figure 1-1).
Applications need to function well on the smallest and largest iOS
displays.
Note that previous generations of iOS devices had even smaller screens
(iPhones prior to iOS 5 and iPod Touches prior to the 5th generation
all had 3.5-inch displays). Also, Apple TV runs iOS. If Apple opens these
platforms for app development with the latest iOS versions, the problem
of creating universal apps will become even more complicated.
? Limited storage: iOS devices can store only about one-tenth of the information
that PCs can, in both memory and persistent storage (flash or disk).
Don’t store too many images, music, or (especially) video on the device
because it can run out of space pretty darn quickly.
? Unreliable networks: It’s a fact of life: Mobile devices periodically lose
network connectivity. Even when a device has a stable connection, the
amount of data that can be sent or received varies based on the strength
of the connection. So make your app
• Buffer incoming data when the network connectivity is good.
• Save outgoing data locally.
• Receive and transmit data on a separate background thread.
? Device unavailability: A mobile device can be turned on and off depending
on a user’s situation (for example, when boarding a plane). A device can
also be damaged (say, by being dropped), its computing speed can slowly
degrade, and it can even shut down as its battery is consumed.
Your application must deal with all these situations. For example, it
could periodically check-point its state and have low-power modes of
operation (for instance, a video-playing app might switch to playing only
audio when the battery is low).
? A range of uses: Mobile devices are used in a variety of locations: rooms
with low ambient lighting or sports stadiums with high levels of background
noise, for example.
Your applications must be able to adapt to these types of situations.
For example, your app may lower the brightness of the screen when the
ambient light is low or increase its audio volume when background noise
is high.
? Coding in Objective-C: Apple made an early and highly innovative
decision to base its development platform on Objective-C, well before
standard object-oriented (sometimes referred to as OO) programming
languages (such as Java, C++, and C#) came on the scene. Objective-C
has an unusual syntax (as I explain in Chapter 3). It also has object-oriented
semantics that are more like the early object-oriented languages like
Smalltalk, but it’s different from the later and now standard object-oriented
languages like C++ and Java that most programmers are used to.
Apple has provided a robust, highly reliable framework and excellent
documentation to help build up strong skills in iOS app development.

No comments:

Post a Comment