Sunday, October 28, 2012

Iphone Connecting to the World with Networking

One of the incredible things about the iPhone is that underneath it all, it really is running Mac OS X. This means that down deep, underneath everything else, lays the beating heart of UNIX. It’s true, if you dig deep enough into the iPhone OS, you eventually find that there is a full UNIX file system and many of the libraries and capabilities that you’ve come to expect from a UNIX computer. Normally, even as a developer, you are sufficiently isolated from UNIX that it simply doesn’t matter to you that UNIX is underneath the covers. But there’s one area where having UNIX available to you becomes a definite asset. That area is in the realm of networking.

UNIX was built with networking from the ground up, and so it’s no surprise that its networking stack is one of the best available. As a result, the iPhone, because of its heritage, shares this excellent networking capability. The iPhone not only has built-in BSD sockets, but it also has an excellent set of Cocoa Touch classes that enable you to work with sockets with very little effort. The beauty of this design is that when you need simple things done, you have the higher-level abstractions available to you. Things such as accessing Web pages, sending e-mail, and so forth are trivial on iPhone OS.

But in addition to this, when you need to go lower, when you need to do things that are different or more difficult, these are also possible through the use of Core Foundation sockets and BSD sockets. In this chapter, you are going to see how to use some of the high-level classes for doing basic networking. You’re also going to take a look at using Bonjour to discover services on the local network. You’re going to take a look at how to send e-mail using the new messaging API. Finally, you’re going to take a brief look at core foundation sockets to introduce them to you. By the time you’re finished, you should be able to conquer just about any networking task on the iPhone.

Accessing the Web

In our connected world, perhaps the most frequent type of network activity is connecting to the Web. Therefore, it’s no surprise that Apple has integrated Web connectivity into all levels of Cocoa Touch. Not only can you connect to the Web using dedicated classes for doing so, such as NSURL Request and so forth, but there are even utility methods on several of the foundation classes that encapsulate some of the most frequently needed methods for Web connectivity. Let’s take a look at how the Web can be accessed through Cocoa Touch.

BIO:

This content is brought to you by Exam Key. Are you seeking for this 640-816 exam assistance? Let’s get the advantage of n10-005 and pass your IT certification exam on first attempt with 100% money back guaranty.


No comments:

Post a Comment