<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Webmaster-Source &#187; Mobile</title>
	<atom:link href="https://www.webmaster-source.com/tag/mobile/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.webmaster-source.com</link>
	<description>Useful Resources For Webmasters</description>
	<lastBuildDate>Thu, 24 Aug 2017 02:01:18 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.42</generator>
	<item>
		<title>Building an iPhone App to Parse the Twitter API with NSXMLParser</title>
		<link>https://www.webmaster-source.com/2011/10/24/building-an-iphone-app-to-parse-the-twitter-api-with-nsxmlparser/</link>
		<comments>https://www.webmaster-source.com/2011/10/24/building-an-iphone-app-to-parse-the-twitter-api-with-nsxmlparser/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 11:20:58 +0000</pubDate>
		<dc:creator><![CDATA[Matt]]></dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[Xcode]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.webmaster-source.com/?p=4362</guid>
		<description><![CDATA[iOS has a simple event-based XML parser built in, which makes it fairly easy to do less involved parsing operations without having to load up a third-party framework. This tutorial will show you how to build a simple iPhone application that will download an XML feed from Twitter containing a user&#8217;s tweets, and then display [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>iOS has a simple event-based XML parser built in, which makes it fairly easy to do less involved parsing operations without having to load up a third-party framework. This tutorial will show you how to build a simple iPhone application that will download an XML feed from Twitter containing a user&#8217;s tweets, and then display them with a pretty UI. (You could easily adapt this to parse other XML documents, such as RSS feeds.)</p>
<p style="text-align: center;"><img style=' display: block; margin-right: auto; margin-left: auto;'  class="aligncenter size-full wp-image-4364 imgborder" title="Displaying data from a Twitter XML feed in iOS" src="//www.webmaster-source.com/wp-content/uploads/nsxmlparser-example-fantasyfolder.jpg" alt="" width="600" height="306" /></p>
<h3><span id="more-4362"></span>Getting Started</h3>
<p>First, create a new View-based application. Give it a memorable name like &#8220;TwitterXML.&#8221;</p>
<p style="text-align: center;"><img style=' display: block; margin-right: auto; margin-left: auto;'  class="aligncenter size-full wp-image-4365 imgborder" title="Creating a view-based application in Xcode" src="//www.webmaster-source.com/wp-content/uploads/nsxmlparser-view-based-application.png" alt="" width="600" height="471" /></p>
<p>Now that you have a clean slate to work off, let&#8217;s rename some classes. I find Xcode&#8217;s default naming scheme a bit silly, with the way it prepends the project name to each file. I think the Application Delegate should be called, simply, <em>AppDelegate.m</em> instead of the needlessly long <em>TwitterXMLAppDelegate.m.</em> However, you can&#8217;t just rename the file to whatever your preference is, as that would break things.</p>
<p>You can rename a class project-wide, file and all, by using the Refactoring tool. You can call it up by right-clicking on the class name in the implementation file and choosing &#8220;Refactoring&#8221; from the resulting menu.</p>
<p><img style=' display: block; margin-right: auto; margin-left: auto;'  class="aligncenter size-full wp-image-4366" title="Renaming classes with the Refactor tool" src="//www.webmaster-source.com/wp-content/uploads/nsxmlparser-renaming-classes-with-refactor-tool.png" alt="" width="600" height="352" /></p>
<p>This renaming business is entirely optional as far as this tutorial goes, but it&#8217;s worth know how to do. Imagine if you made a typo in a class name and didn&#8217;t realize it until after you had already referenced it in a few places. It&#8217;s nice to have an automated fix.</p>
<h3>Setting Up the Header File</h3>
<p>Most of our code is going to go in the View controller, named <em>TweetViewController</em> in my case. Switch to the corresponding .h file and we can start setting up properties and whatnot.</p>
<p>First, we need to implement the NSXMLParserDelegate protocol so our class can respond to NSXMLParser delegate methods. This is easily done by adding <em>NSXMLParserDelegate</em> to the <em>@interface</em> line, like so:</p>
<pre class="brush: cpp; title: ; notranslate">
@interface TweetViewController : UIViewController &lt;NSXMLParserDelegate&gt; {
</pre>
<p>Now we need to declare some variables and other objects in the interface block. We need a string to hold the name of the Twitter user whose profile we will be accessing, a mutable array to hold the statuses we&#8217;ve pulled from the parser and a few that are used to hold data temporarily during the parsing process. Also, we need a few IBOutlets so we can update the View once we finish reading the XML data.</p>
<pre class="brush: cpp; title: ; notranslate">
@interface TweetViewController : UIViewController &lt;NSXMLParserDelegate&gt; {
NSString *twitterUser;
NSMutableArray *statuses;
NSString *currentElement;
NSMutableDictionary *currentElementData;
NSMutableString *currentElementString;
IBOutlet UIImageView *backgroundImage;
IBOutlet UILabel *tweetLabel;
IBOutlet UIImageView *avatar;
}
</pre>
<p>Of course, we need to make these objects into properties. This means adding a few property declarations after the interface block ends.</p>
<pre class="brush: cpp; title: ; notranslate">
@property (nonatomic, retain) NSString *twitterUser;
@property (nonatomic, retain) NSMutableArray *statuses;
@property (nonatomic, retain) NSString *currentElement;
@property (nonatomic, retain) NSMutableDictionary *currentElementData;
@property (nonatomic, retain) NSMutableString *currentElementString;
@property (nonatomic, retain) UIImageView *backgroundImage;
@property (nonatomic, retain) UILabel *tweetLabel;
@property (nonatomic, retain) UIImageView *avatar;
</pre>
<p>And then you need to synthesize them in the .m file by adding the following line right after the @implementation line:</p>
<pre class="brush: cpp; title: ; notranslate">
@synthesize twitterUser, statuses, currentElement, currentElementData, currentElementString, backgroundImage, tweetLabel, avatar;
</pre>
<p>Now that that&#8217;s out of the way, we can get to the interesting part.</p>
<h3>Setting Up the Parser</h3>
<p>The first method in the View controller is &lt;em&gt;viewDidLoad&lt;/em&gt;, which fires as soon as the View as loaded. (Subtle, isn&#8217;t it?) We will be putting our initialization stuff in there. Basically, we just need to ready our properties, set the Twitter username and start the parser.</p>
<pre class="brush: cpp; title: ; notranslate">
- (void)viewDidLoad {
[super viewDidLoad];
statuses = [[NSMutableArray alloc] init];
currentElement = [[NSString alloc] init];
currentElementData = [[NSMutableDictionary alloc] init];
currentElementString = [[NSMutableString alloc] init];
twitterUser = [NSString stringWithString:@&quot;collis&quot;];
[self parseXMLForUser:twitterUser];
}
</pre>
<p>After the first arrays and dictionaries are initialized, the <em>twitterUser</em> string is set to the username of the Twitter account we want the app to pull the latest statuses from. I&#8217;m using <a href="http://twitter.com/#!/collis">Collis</a>, one of the co-founders of <a href="http://envato.com/">Envato</a>, as an example. You could put any user you want there, so long as they have a cool-looking background on their profile!</p>
<p>The last line calls the <em>parseXMLForUser:</em> method and passes the <em>twitterUser</em> string along with it. We will work on that part next.</p>
<p>The <em>parseXMLForUser:</em> method is responsible for setting up the parser, as well as building the Twitter API URL.</p>
<pre class="brush: cpp; title: ; notranslate">
- (void)parseXMLForUser:(NSString *)user {

//Build the Twitter API URL by combining the user with the rest of the URL
NSString *urlString = [NSString stringWithFormat:@&quot;http://twitter.com/statuses/user_timeline/%@.xml?count=3&quot;, user];
NSURL *url = [NSURL URLWithString:urlString];

//Create an instance of NSXMLParser and download the XML data from the URL
NSXMLParser *parser = [[NSXMLParser alloc] initWithContentsOfURL:url];

//Set this class as its own delegate so we can process NSXMLParser callbacks
[parser setDelegate:self];

//Disable namespace support and other things we don't really need
[parser setShouldProcessNamespaces:NO];
[parser setShouldReportNamespacePrefixes:NO];
[parser setShouldResolveExternalEntities:NO];

[parser parse]; //Go go gadget XML parser...

[parser release];

}
</pre>
<p>The first part of the method should look familiar to anyone who has worked with C or Java before. It takes our <em>user</em> argument (which contains the text of <em>twitterUser</em>) and splices it into the URL string, just before the <em>.xml</em> part. Cocoa expects URLs to be of the NSURL object type, we create a new one of those and pass it <em>urlString</em>.</p>
<p>After that is done, we create a new instance of the NSXMLParser class and nickname it &#8220;parser.&#8221; We also pass it the new URL object, which it will use to download the contents it finds there at runtime. Next we set the parser&#8217;s delegate to <em>self</em>, or the current class. The next three lines turn off some features we don&#8217;t really need. Finally, we kick the parser into action and leave a <em>[parser release]</em> command to clean up after it&#8217;s done.</p>
<p>That was simple, wasn&#8217;t it? Sadly, that was only the beginning. In order for the parser to, well, <em>parse</em> we still need to implement the delegate methods for NSXMLParser. And we need to make a spiffy UI.</p>
<h3>Building the Parser</h3>
<p>NSXMLParser is what is called an event-based parser. This means it loops around, searching a document for anything that looks like an XML tag. When it finds one, it raises an event. Basically it says &#8220;I found an opening tag named &#8216;something'&#8221; and leaves you to deal with it. The parser does the same thing with ending tags and the text between them. We have to implement delegate methods to handle these events and save the data they find.</p>
<p>Let&#8217;s start with a couple of simple ones.</p>
<pre class="brush: cpp; title: ; notranslate">
- (void)parserDidStartDocument:(NSXMLParser *)parser {
NSLog(@&quot;The XML document is now being parsed.&quot;);
}

- (void)parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)parseError {
NSLog(@&quot;Parse error: %d&quot;, [parseError code]);
}
</pre>
<p>The first method fires when NSXMLParser starts to parse the document. For this application, there isn&#8217;t really anything that we need to do at that point. Putting an NSLog there is great for debugging, though. (If your app is crashing, it&#8217;s helpful to know whether it&#8217;s getting to that step or not.) I&#8217;m sure you can guess what the <em>parseErrorOccurred</em> method does. (It logs an error code if the XML document is malformed or if, for some other reason, the parser could not process it.)</p>
<p>Moving on, we have a method that is called when the parser finds an opening XML tag.</p>
<pre class="brush: cpp; title: ; notranslate">
- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict {

//Store the name of the element currently being parsed.
currentElement = [elementName copy];

//Create an empty mutable string to hold the contents of elements
currentElementString = [NSMutableString stringWithString:@&quot;&quot;];

//Empty the dictionary if we're parsing a new status element
if ([elementName isEqualToString:@&quot;status&quot;]) {
[currentElementData removeAllObjects];
}

}
</pre>
<p>This one is a bit more complicated. When it&#8217;s called, its arguments are populated with information that the parser found out about the element currently being parsed. It&#8217;s name is what we care about, primarily. Using the properties we created earlier, the method keeps track of the element currently being parsed (we need to know its name in other methods) and whatever is <em>inside</em> the element (between the opening and closing tag). The conditional statement at the end empties our dictionary every time the parser moves on to a new &lt;status&gt; element, as we will have already copied its contents to the statuses array.</p>
<p>The next delegate method takes any characters found inside an XML element and stores it in the <em>currentElementString</em> property for later.</p>
<pre class="brush: cpp; title: ; notranslate">
- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string {
//Take the string inside an element (e.g. &lt;tag&gt;string&lt;/tag&gt;) and save it in a property
[currentElementString appendString:string];
}
</pre>
<p>And finally, the penultimate method. This one contains the real meat of the parser. It is called whenever NSXMLParser comes across a closing XML tag. And so, it serves as a good place to put most of the data-saving logic.</p>
<pre class="brush: cpp; title: ; notranslate">
- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName {

//If we've hit the &lt;/status&gt; tag, store the data in the statuses array
if ([elementName isEqualToString:@&quot;status&quot;]) {
[statuses addObject:[currentElementData copy]];
}

//Trim any extra spaces and newline characters from around currentElementString
NSString *string = [currentElementString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];

//Store the status data in the currentElementData dictionary
if ([currentElement isEqualToString:@&quot;created_at&quot;]) {
[currentElementData setObject:string forKey:@&quot;created_at&quot;];
} else if ([currentElement isEqualToString:@&quot;text&quot;]) {
[currentElementData setObject:string forKey:@&quot;text&quot;];
} else if ([currentElement isEqualToString:@&quot;retweeted&quot;]) {
[currentElementData setObject:string forKey:@&quot;retweeted&quot;];
} else if ([currentElement isEqualToString:@&quot;id&quot;]) {
[currentElementData setObject:string forKey:@&quot;id&quot;];
} else if ([currentElement isEqualToString:@&quot;profile_image_url&quot;]) {
[currentElementData setObject:string forKey:@&quot;profile_image_url&quot;];
} else if ([currentElement isEqualToString:@&quot;profile_background_image_url&quot;]) {
[currentElementData setObject:string forKey:@&quot;profile_background_image_url&quot;];
} else if ([currentElement isEqualToString:@&quot;profile_link_color&quot;]) {
[currentElementData setObject:string forKey:@&quot;profile_link_color&quot;];
}

}
</pre>
<p>The first code chunk saves the contents of the <em>currentElementData</em> dictionary to the <em>statuses</em> array if, and only if, the ending tag being processed currently is &lt;/status&gt;. If you remember from before, <em>currentElementData</em> will be emptied the next time the <em>didStartElement</em> method is called. Otherwise, the block will be skipped and the application will handle the tasks it needs to run for child elements of &lt;status&gt;.</p>
<p>After stripping out extraneous spaces and newline characters from either side of <em>currentElementString</em>, so we don&#8217;t end up with weird output, we have a rather long if/else if block. This checks whether the element being parsed is one we want to save (e.g. &#8220;text&#8221; or &#8220;profile_image_url&#8221;) and if it is, it adds it to the element data dictionary.</p>
<p>The code may seem a bit strange at first, but it should make more sense after you become more familiar with it.</p>
<p>And now, for the last delegate method. This one fires when the document has finished parsing. This is the place to launch any operations we want to be started after we have our data. As you can see below, logging the <em>statuses</em> array to the console and then calling a method to display that data is what we will be doing here.</p>
<pre class="brush: cpp; title: ; notranslate">
- (void)parserDidEndDocument:(NSXMLParser *)parser {
//Document has been parsed. It's time to fire some new methods off!
NSLog(@&quot;%@&quot;, statuses);
[self updateView];
}
</pre>
<h3>The View</h3>
<p>After all that code, let&#8217;s work on the interface. Double-click the <em>TweetViewController.xib</em> file (or whatever your View XIB is called) in the Xcode sidebar to open it in Interface Builder. Now that your screen is sufficiently cluttered with windows, you want to drag a UIImageView from the Library window into your View canvas. Make sure that it is sized to fit the whole available area.</p>
<p>Of course, the Image View won&#8217;t be much use to us unless we link it with the controller. Right-click on the File&#8217;s Owner icon and drag the little rubberband/wire thing from the <em>backgroundImage</em> Outlet over to the UIImageView and drop it. The File&#8217;s Owner overlay window should update to show the Image View as being connected to <em>backgroundImage</em>.</p>
<p style="text-align: center;"><img style=' display: block; margin-right: auto; margin-left: auto;'  class="aligncenter size-full wp-image-4367 imgborder" title="Adding a UIImageView in Interface Builder" src="//www.webmaster-source.com/wp-content/uploads/nsxmlparser-ib-adding-uiimageview.png" alt="" width="600" height="440" /></p>
<p>I think this app would be better if it used a horizontal orientation, don&#8217;t you? Click the little arrow icon in the upper right corner of the View canvas. Interface Builder should automagically resize the Image View inside it to still fill the View. Save the XIB file out and switch back to Xcode. Now we have to configure the application to use a landscape orientation instead of the default portrait one.</p>
<p>Inside your controller class there should be a method called <em>shouldAutorotateToInterfaceOrientation</em>. It&#8217;s commented out by default. Uncomment it and change the interfaceOrientation to <em>UIInterfaceOrientationLandscapeLeft</em>. It should look like this:</p>
<pre class="brush: cpp; title: ; notranslate">
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
</pre>
<p>Back in Interface Builder, drop in a new UIImageView. We won&#8217;t be hooking this one up to an IBOutlet. Instead, we will set the image to the word bubble image I made (it&#8217;s in the project file), resize the view to be the same point-width as the image (375&#215;208) and position it neatly over the background image view. I also lowered the opacity a bit, just because I liked the effect.</p>
<p>Now we need a way to display the contents of the latest tweet. So drag a UILabel onto the View canvas and resize it to fit nicely over the word bubble graphic. Turn the &#8220;# Lines&#8221; setting up to five or so, set the font size to something that looks legible and change the &#8220;Line Breaks&#8221; option to &#8220;Word Wrap. Then wire it up to the <em>tweetLabel</em> IBOutlet, like you did with the UIImageView.</p>
<p><img style=' display: block; margin-right: auto; margin-left: auto;'  class="aligncenter size-full wp-image-4368" title="Adding the Label" src="//www.webmaster-source.com/wp-content/uploads/nsxmlparser-adding-the-label.png" alt="" width="600" height="421" /></p>
<p>Ready to tie everything together? Switch back to Xcode and add one last method to the controller class.</p>
<pre class="brush: cpp; title: ; notranslate">
- (void)updateView {

//Select the latest tweet
NSDictionary *latestTweet = [statuses objectAtIndex:0];

//Set the tweet label
[tweetLabel setText:[latestTweet objectForKey:@&quot;text&quot;]];

//Set the background image after downloading it.
NSString *urlString = [latestTweet objectForKey:@&quot;profile_background_image_url&quot;];
NSURL *url = [NSURL URLWithString:urlString];
NSData *data = [NSData dataWithContentsOfURL:url];
UIImage *background = [[UIImage alloc] initWithData:data];
[backgroundImage setImage:background];
backgroundImage.contentMode = UIViewContentModeScaleAspectFill;

}
</pre>
<p>While it looks nearly as intimidating as the NSXMLParser <em>didEndElement</em> delegate method, it&#8217;s actually quite a bit simpler. The first line gets the newest tweet from the <em>statuses</em> array, the =<em>[tweetLabel setText:&#8230;]</em>= line updates the UILabel with the text of the message, and the last part changes the background image behind the word bubble to be the same as the Twitter user&#8217;s profile background.</p>
<p>That last part needs the most explanation. Before we can display the image (which is what the <em>setImage</em> line does) we have to download it first. Taking the <em>urlString</em>, which of course is a string containing the web address where the image can be found, we convert it to a NSURL object, which is named <em>url</em>. We create a new NSData object and use it&#8217;s <em>dataWithContentsOfURL</em> method to download the image. (Cocoa requires that URLs used with it&#8217;s objects be of the NSURL class.) Next we initialize a UIImage object with the NSData object and set it as the image in the UIImageView named backgroundImage. Oh, and we set the content mode to <em>UIViewContentModeScaleAspectFill</em> so it&#8217;s not squished funny.</p>
<p>Now if you build and run the app, you should get something like this:</p>
<p style="text-align: center;"><img style=' display: block; margin-right: auto; margin-left: auto;'  class="aligncenter size-full wp-image-4369 imgborder" title="A styled tweet in the iOS app" src="//www.webmaster-source.com/wp-content/uploads/nsxmlparser-first-demo-tweet-on-bg.png" alt="" width="600" height="394" /></p>
<p>Before we free up our allocated memory and finish the app up, let&#8217;s add one more thing: an avatar field! Switch back to Interface Builder and add a new UIImageView. Resize it to 52&#215;52 or so and wire it up to the &#8220;avatar&#8221; IBOutlet. Re-using the code from the background image bit, we can quickly modify it for the avatar.</p>
<pre class="brush: cpp; title: ; notranslate">
//Set the avatar image after downloading it.
NSString *avatarUrlString = [latestTweet objectForKey:@&quot;profile_image_url&quot;];
NSURL *avatarUrl = [NSURL URLWithString:avatarUrlString];
NSData *avatarData = [NSData dataWithContentsOfURL:avatarUrl];
UIImage *avatarImage = [[UIImage alloc] initWithData:avatarData];
[avatar setImage:avatarImage];
avatar.contentMode = UIViewContentModeScaleAspectFill;
</pre>
<p>That goes in the <em>updateView</em> method, after everything else.</p>
<p>Now, before we can say the application is finished, there is one thing that needs to be done. Any memory we specifically allocated should be released. It&#8217;s not a huge deal in a single-view app, as it will be forcefully freed up on exit, but it&#8217;s a good habit to get into. (In more complicated applications, you can expect to see frequent crashes if you don&#8217;t release objects when you&#8217;re done with them.) It&#8217;s easy to do. For every object we explicitely <em>alloc</em> or <em>retain</em>, we have to <em>release</em> somewhere. The <em>dealloc</em> method is called when the application quits in this case, so we put most of our <em>release</em> statements there.</p>
<p>You can learn more about iOS memory management in <a href="http://mobile.tutsplus.com/freebies/qa-sessions/qa-session-3-ios-memory-management-and-best-practices/">this screencast</a>.</p>
<pre class="brush: cpp; title: ; notranslate">
- (void)dealloc {
[twitterUser release];
[statuses release];
[currentElement release];
[currentElementData release];
[currentElementString release];
[backgroundImage release];
[tweetLabel release];
[avatar release];
[super dealloc];
}
</pre>
<p>And we&#8217;re done!</p>
<p style="text-align: center;"><img style=' display: block; margin-right: auto; margin-left: auto;'  class="aligncenter size-full wp-image-4370 imgborder" title="And we're done!" src="//www.webmaster-source.com/wp-content/uploads/nsxmlparser-final.png" alt="" width="505" height="342" /></p>
<h3>Additional Challenge</h3>
<p>Want to add to this sample application? Try making the following change: Use an <a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSTimer_Class/Reference/NSTimer.html">NSTimer</a> to cycle through the items in the <em>statuses</em> array and update the View accordingly. Most of the groundwork has been laid for you already.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.webmaster-source.com/2011/10/24/building-an-iphone-app-to-parse-the-twitter-api-with-nsxmlparser/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Optimize a Website for iPhone Using Only CSS</title>
		<link>https://www.webmaster-source.com/2010/11/19/optimize-a-website-for-iphone-using-only-css/</link>
		<comments>https://www.webmaster-source.com/2010/11/19/optimize-a-website-for-iphone-using-only-css/#comments</comments>
		<pubDate>Fri, 19 Nov 2010 11:21:32 +0000</pubDate>
		<dc:creator><![CDATA[Matt]]></dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://www.webmaster-source.com/?p=3714</guid>
		<description><![CDATA[Lots of websites now have mobile versions that optimize their designs for speed and ease-of-use on the iPhone, reducing scripts and designing for the device&#8217;s smaller screen. They usually use some sort of browser detection script that loads a different template on the mobile device. Sahil Lavingia, creator of the Dayta app, has a quick [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Lots of websites now have mobile versions that optimize their designs for speed and ease-of-use on the iPhone, reducing scripts and designing for the device&#8217;s smaller screen. They usually use some sort of browser detection script that loads a different template on the mobile device.</p>
<p>Sahil Lavingia, creator of the <a href="http://daytaapp.com/">Dayta</a> app, has a quick tutorial on how to <a href="http://sahillavingia.com/blog/2010/11/13/optimize-a-website-for-iphone-in-10-minutes/">optimize your website for iPhone in 10 minutes</a>&#8230;using only CSS.</p>
<p>I haven&#8217;t had a chance to try it out for myself, but it looks fairly simple.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.webmaster-source.com/2010/11/19/optimize-a-website-for-iphone-using-only-css/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>iPhone Application Development For Dummies</title>
		<link>https://www.webmaster-source.com/2010/02/24/iphone-application-development-for-dummies/</link>
		<comments>https://www.webmaster-source.com/2010/02/24/iphone-application-development-for-dummies/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 11:12:03 +0000</pubDate>
		<dc:creator><![CDATA[Matt]]></dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.webmaster-source.com/?p=3068</guid>
		<description><![CDATA[Have you ever wanted to learn how to write your own iPhone applications? It&#8217;s certainly more difficult than web development, but the device is a good platform to learn client-side programming with. Mobile applications that tie into web services are becoming increasingly common, so now is a good time to give it a try. iPhone [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.amazon.com/iPhone-Application-Development-Dummies-Goldstein/dp/0470568437/webmasterso0d-20"><img style=' float: right; padding: 4px; margin: 0 0 2px 7px;'  class="alignright size-full wp-image-3069 imgborder" title="iPhone Application Development for Dummies" src="//www.webmaster-source.com/wp-content/uploads/iphone-application-development-dummies.jpg" alt="" width="130" height="162" /></a>Have you ever wanted to learn how to write your own iPhone applications? It&#8217;s certainly more difficult than web development, but the device is a good platform to learn client-side programming with. Mobile applications that tie into web services are becoming increasingly common, so now is a good time to give it a try.</p>
<p><em><a href="http://www.amazon.com/iPhone-Application-Development-Dummies-Goldstein/dp/0470568437/webmasterso0d-20">iPhone Application Development For Dummies</a></em> is a good primer on building applications for the iPhone or iPod Touch. It covers the basic theory over the first few chapters, and then moves on to building a simple View-based application. I haven&#8217;t finished the book quite yet, as I&#8217;m working my way through the tutorials as I read, but the book seems to cover all of the basics quite well. There are parts on data storage, input events, and many other things that are critical to iPhone development.</p>
<p>I&#8217;m finding the book to be a bit challenging, as I don&#8217;t have any real desktop programming experience, other than BASIC if that counts. I don&#8217;t think I&#8217;d recommend it to someone who doesn&#8217;t have a strong grasp of at least one programming language with a C-style syntax, such as PHP or Java. Knowledge of object-oriented programming is important, in addition to more basic skills such as dealing with variables and control structures. If you&#8217;re a total programming newbie, I would recommend reading a good introductory book first, and then moving on to <em>iPhone Application Development for Dummies.</em></p>
<p>I&#8217;ve enjoyed what I&#8217;ve read of the book so far, and I hope that, by the time I&#8217;m done, I&#8217;ll have a good enough grasp of things to develop an idea I&#8217;ve had for awhile into an app.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.webmaster-source.com/2010/02/24/iphone-application-development-for-dummies/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Add a Mobile Stylesheet to Your Site</title>
		<link>https://www.webmaster-source.com/2009/08/07/add-a-mobile-stylesheet-to-your-site/</link>
		<comments>https://www.webmaster-source.com/2009/08/07/add-a-mobile-stylesheet-to-your-site/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 10:30:17 +0000</pubDate>
		<dc:creator><![CDATA[Matt]]></dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://www.webmaster-source.com/?p=2434</guid>
		<description><![CDATA[Don&#8217;t want to go all-out with a separate mobile mini-site, but you still want your site to be accessible on phones and PDAs? You can just add a new stylesheet intended only for mobile browsers, in which you can reformat the page to render acceptably on a wide range of handheld web browsing devices. By [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Don&#8217;t want to go all-out with a separate mobile mini-site, but you still want your site to be accessible on phones and PDAs? You can just add a new stylesheet intended only for mobile browsers, in which you can reformat the page to render acceptably on a wide range of handheld web browsing devices.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot; type=&quot;text/css&quot; media=&quot;Screen&quot; /&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;mobile.css&quot; type=&quot;text/css&quot; media=&quot;handheld&quot; /&gt;
</pre>
<p>By linking a stylesheet with a media of &#8220;handheld,&#8221; you tell mobile browsers to remove any of the preceding styles. You can then apply some new styles within, taking care to avoid explicitly setting widths or anything that might foul-up mobile browsers.</p>
<p>It&#8217;s a little bit more complicated than that in reality, but not too much so. You can find a full how-to over at Perishable Press: <a href="http://perishablepress.com/press/2009/08/02/the-5-minute-css-mobile-makeover/">The 5-Minute CSS Mobile Makeover</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.webmaster-source.com/2009/08/07/add-a-mobile-stylesheet-to-your-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Mobile Web Part 6: 7 Useful Mobile Site Resources</title>
		<link>https://www.webmaster-source.com/2008/09/30/the-mobile-web-part-6-7-useful-mobile-site-resources/</link>
		<comments>https://www.webmaster-source.com/2008/09/30/the-mobile-web-part-6-7-useful-mobile-site-resources/#comments</comments>
		<pubDate>Tue, 30 Sep 2008 10:19:09 +0000</pubDate>
		<dc:creator><![CDATA[Matt]]></dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[WML]]></category>

		<guid isPermaLink="false">http://www.webmaster-source.com/?p=876</guid>
		<description><![CDATA[Over the past five days we have covered quite a few bases in the mobile website area. In case you missed them, you can find the posts here: Part 1: Why Go Mobile? Part 2: Mobilize Your Site the Easy Way Part 3: iPhonitizing Your Site Sans MoFuse Part 4: 14 iPhone-Formatted Websites Part 5: [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Over the past five days we have covered quite a few bases in the mobile website area. In case you missed them, you can find the posts here:</p>
<ul>
<li><a href="http://www.webmaster-source.com/2008/09/24/the-mobile-web-part-1-why-go-mobile/">Part 1: Why Go Mobile?</a></li>
<li><a href="http://www.webmaster-source.com/2008/09/25/the-mobile-web-part-2-mobilize-your-site-the-easy-way/">Part 2: Mobilize Your Site the Easy Way</a></li>
<li><a href="http://www.webmaster-source.com/2008/09/26/the-mobile-web-part-3-iphonitizing-your-site-sans-mofuse/">Part 3: iPhonitizing Your Site Sans MoFuse</a></li>
<li><a href="http://www.webmaster-source.com/2008/09/28/the-mobile-web-part-4-14-iphone-formatted-websites/">Part 4: 14 iPhone-Formatted Websites</a></li>
<li><a href="http://www.webmaster-source.com/2008/09/29/the-mobile-web-part-5-iphonemicrositescom/">Part 5: iPhoneMicrosites.com</a></li>
</ul>
<p>I think it&#8217;s about time to bring this series to a close, with today&#8217;s post &#8220;7 Useful Mobile Site Resources.&#8221; I have to admit, the biggest reason I wrote this series was because I recently got my hands on an iPod Touch, after far too much waiting. I&#8217;ve been thinking about the topic for a long time, well before I got the i&#8217;Touch, since before I was seriously considering buying one (since the first generation Touch came out).</p>
<p>Now, where should you go from here? Following are a few resources that you may find useful.</p>
<h3>1. Mobile Web Development by Nirav Mehta</h3>
<p><a href="http://www.amazon.com/gp/product/1847193439/103-2101880-6267848?ie=UTF8&amp;tag=webmasterso0d-20"><img style=' float: left; padding: 4px; margin: 0 7px 2px 0;'  class="alignleft" title="Mobile Web Development" src="https://images-na.ssl-images-amazon.com/images/I/51BVVpKToIL._SL160_.jpg" alt="" width="130" height="160" />Mobile Web Development</a> is focused on non-iPhone mobile sites (I&#8217;m not sure if it even <em>mentions</em> the iPhone). It&#8217;s fairly current, having been published in 2008, and covers a broad array of topics in it&#8217;s 216 pages. It covers WML and WAP, XHTML MP, sending text messages (SMS) via server-side script, PayPal Mobile, Interactive Voice, and a few other things.</p>
<p>I haven&#8217;t tried out any of the examples or anything, but I read through the book, and it seems to be good overall. It&#8217;s an easy read, and shouldn&#8217;t take much time to get through.<span id="more-876"></span></p>
<h3>2. iPod Touch or iPhone</h3>
<p>Now, you can get by without one of these. You can use simulators to get a good idea of what a page will look like on the iPhone (I gave a couple links <a href="http://www.webmaster-source.com/2008/09/24/the-mobile-web-part-1-why-go-mobile/">here</a>), or you can borrow someone else&#8217;s for a couple minutes. But if you do a lot of work targetted at the iPhone, especially if you do it professionally, it&#8217;s a logical purchase.</p>
<p>The iPod Touch has come down in price, costing $229 for the 8GB model. Not something you want to impulse-buy, but if you&#8217;re looking for a new MP3 player it&#8217;s a good option.</p>
<h3>3. MoFuse</h3>
<p>I know, I know. I already wrote <a href="http://www.webmaster-source.com/2008/09/25/the-mobile-web-part-2-mobilize-your-site-the-easy-way/">an entire post</a> about <a href="http://www.mofuse.com/">MoFuse</a> fo this series. It&#8217;s a great service, and one ideal for newbies and those who aren&#8217;t the Do-it-Yourself type. I&#8217;m not saying it&#8217;s only for newbies, after all some bigwig blogs (blogwigs?) like ReadWriteWeb use it, but it&#8217;s a great option for them.</p>
<blockquote><p>MoFuse allows you to “Mobilize your blog” in about ten minutes. You simply create a free account, supply your blog’s URL, and pick a URL for your resulting mobile site. The URL will look something like <code>you.mofuse.mobi</code>, though you can map it to your own subdomain if you wish (<code>m.yourdomain.com</code> is a common convention).</p></blockquote>
<p>Did I mention it generates an iPhone version <em>and</em> a WML version?</p>
<h3>4. CiUI</h3>
<p>My favorite JavaScript iPhone interface. <a href="http://clientside.cnet.com/cnet-js-standards/ciui-cnet-iphone-ui/">CiUI</a> was developed by CNET for <a href="http://iphone.cnet.com/">their own</a> mobile site. Their developers made it publicly available, with a little bit of documentation. A little bit of server-side scripting magic can pull posts from WordPress (or whatever you content management system may be) and display them in the AJAX-y interface. Or you could build a web app with it.</p>
<h3>5. Apple Developer Connection</h3>
<p>The maker of the iPhone and iPod Touch has <a href="http://developer.apple.com/webapps/">plenty of documentation on their website</a> for web app developers. There are tutorials, specs, and more. You need to create a free developer account to access the documents though.</p>
<h3>6.  iPhoneMicrosites.com</h3>
<p><a href="http://iphonemicrosites.com/">iPhone Microsites</a> is another web location I covered in this series. They have a nice collection of articles, news, and tutorials to help you build iPhone sites. They also offer their services to build such sites for you. (Their services are a little pricey for most individuals, and are more targetted at businesses, I would assume.) Their tutorial section is especially worth a look.</p>
<h3>7.  A List Apart</h3>
<p>ALA is one of the most popular designer sites ever. Since 1998 they&#8217;ve been in the business of informing and teaching &#8220;people who make websites.&#8221; They have a couple posts on iPhone/i&#8217;Touch web development.</p>
<ul>
<li><a href="http://alistapart.com/articles/putyourcontentinmypocket">Put Your Content in My Pocket</a></li>
<li><a href="http://www.alistapart.com/articles/putyourcontentinmypocketpart2/">Put Your Content in my Pocket, Part II</a></li>
</ul>
<p>Definitely worth a read. If you haven&#8217;t been to A List Apart before, you don&#8217;t know what you&#8217;re missing. I&#8217;m not a frequent reader (I just drop in now and then rather than subscribe), but I just may end up adding them to my feed reader one of these days&#8230;</p>
<h3>Conclusion</h3>
<p>Well, there you have it. Six days of nothing but mobile web development. Perhaps I should start a spin-off blog, iPhone-Source? (FYI, I&#8217;m kidding. I don&#8217;t have time for that&#8230; <img src="https://www.webmaster-source.com/wp-includes/images/smilies/icon_razz.gif" alt=":P" class="wp-smiley" /> ). It would be fun though&#8230;</p>
<p>If you have any questions about anything from the past six posts, feel free to leave a comment. I&#8217;ll do my best to answer it.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.webmaster-source.com/2008/09/30/the-mobile-web-part-6-7-useful-mobile-site-resources/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Mobile Web Part 5: iPhoneMicrosites.com</title>
		<link>https://www.webmaster-source.com/2008/09/29/the-mobile-web-part-5-iphonemicrositescom/</link>
		<comments>https://www.webmaster-source.com/2008/09/29/the-mobile-web-part-5-iphonemicrositescom/#comments</comments>
		<pubDate>Mon, 29 Sep 2008 10:34:59 +0000</pubDate>
		<dc:creator><![CDATA[Matt]]></dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://www.webmaster-source.com/?p=873</guid>
		<description><![CDATA[While I was looking for some extra iPhone-formatted websites to round out yesterday&#8217;s list, I came across iPhone Microsites. The site caught my attention, so I figured I&#8217;d make it part of the Mobile Web series. iPhone Microsites is based entirely around the &#8220;iPhone Version&#8221; idea. They not only offer their services to build said [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>While I was looking for some extra <a href="http://www.webmaster-source.com/2008/09/28/the-mobile-web-part-4-14-iphone-formatted-websites/">iPhone-formatted websites</a> to round out yesterday&#8217;s list, I came across <a href="http://iphonemicrosites.com/">iPhone Microsites</a>. The site caught my attention, so I figured I&#8217;d make it part of the Mobile Web series.</p>
<p>iPhone Microsites is based entirely around the &#8220;iPhone Version&#8221; idea. They not only offer their services to build said <a href="http://en.wikipedia.org/wiki/Microsite">microsites</a>, but they also provide free tutorials and articles to teach you how to do it yourself. In addition, they provide a handy list of resources for developing web pages for the iPhone.</p>
<p>Their services certainly aren&#8217;t cheap, and are more in the price range for medium to large businesses than individuals, but their articles and resource lists are good. The site&#8217;s definitely worth a look at least.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.webmaster-source.com/2008/09/29/the-mobile-web-part-5-iphonemicrositescom/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Mobile Web Part 4: 14 iPhone-Formatted Websites</title>
		<link>https://www.webmaster-source.com/2008/09/28/the-mobile-web-part-4-14-iphone-formatted-websites/</link>
		<comments>https://www.webmaster-source.com/2008/09/28/the-mobile-web-part-4-14-iphone-formatted-websites/#comments</comments>
		<pubDate>Sun, 28 Sep 2008 10:43:43 +0000</pubDate>
		<dc:creator><![CDATA[Matt]]></dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://www.webmaster-source.com/?p=868</guid>
		<description><![CDATA[Welcome to day four of The Mobile Web. We&#8217;ve previously covered a lot of ground on the subject of mobile websites over the last few days. Today will be lighter reading though. Who&#8217;s up for a design roundup of mobile websites? What are some good examples of iPhone-formatted websites? (I won&#8217;t be rounding up any [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Welcome to day four of <a href="http://www.webmaster-source.com/2008/09/24/the-mobile-web-part-1-why-go-mobile/">The Mobile Web</a>. We&#8217;ve previously covered a lot of ground on the subject of mobile websites over the last few days. Today will be lighter reading though. Who&#8217;s up for a design roundup of mobile websites? What are some good examples of iPhone-formatted websites? (I won&#8217;t be rounding up any WML sites, since style and WML are pretty much mutually exclusive.)</p>
<p>Here are some good examples of iPhone-specific pages.</p>
<h3>Amazon</h3>
<p><a href="http://amazon.com"><img class="alignnone" title="Amazon" src="http://i33.tinypic.com/svnhbt.jpg" alt="" width="320" height="480" /></a></p>
<h3><span id="more-868"></span>CNET</h3>
<p><a href="http://iphone.cnet.com"><img class="alignnone" title="CNET" src="http://i35.tinypic.com/k2h4j.jpg" alt="" width="320" height="480" /></a></p>
<h3>Digg</h3>
<p><a href="http://m.digg.com"><img class="alignnone" title="Digg" src="http://i38.tinypic.com/2j295zo.jpg" alt="" width="320" height="480" /></a></p>
<h3>Evernote</h3>
<p><a href="http://evernote.com"><img class="alignnone" title="Evernote" src="http://i36.tinypic.com/suu4h1.jpg" alt="" width="320" height="480" /></a></p>
<h3>Facebook</h3>
<p><a href="http://iphone.facebook.com"><img class="alignnone" title="Facebook" src="http://i34.tinypic.com/153lb1l.jpg" alt="" width="320" height="480" /></a></p>
<h3>Leaflets</h3>
<p><a href="http://getleaflets.com/"><img class="alignnone" title="Leaflets" src="http://i34.tinypic.com/2ltt0n7.jpg" alt="" width="320" height="480" /></a></p>
<h3>GMail</h3>
<p><a href="http://gmail.com"><img class="alignnone" title="GMail" src="http://i35.tinypic.com/25hmg6b.jpg" alt="" width="320" height="480" /></a></p>
<h3>Google Reader</h3>
<p><a href="http://google.com"><img class="alignnone" title="Google Reader" src="http://i34.tinypic.com/2i9s3sm.jpg" alt="" width="320" height="480" /></a></p>
<h3>Powerset</h3>
<p><a href="http://powerset.com"><img class="alignnone" title="Powerset" src="http://i37.tinypic.com/6q9o3r.jpg" alt="" width="320" height="480" /></a></p>
<h3>Remember The Milk</h3>
<p><a href="http://i.rememberthemilk.com"><img class="alignnone" title="Remember the Milk" src="http://i34.tinypic.com/efpj7a.jpg" alt="" width="320" height="480" /></a></p>
<h3>Retail Me Not</h3>
<p><a href="http://iphone.retailmenot.com/"><img class="alignnone" title="Retail Me Not" src="http://i33.tinypic.com/dxlc83.jpg" alt="" width="320" height="480" /></a></p>
<h3>Ta-Da List</h3>
<p><a href="http://tadalist.com"><img class="alignnone" title="Ta-Da List" src="http://i37.tinypic.com/330sluf.jpg" alt="" width="320" height="480" /></a></p>
<h3>Twitter</h3>
<p><a href="http://twitter.com"><img class="alignnone" title="Twitter" src="http://i36.tinypic.com/krq84.jpg" alt="" width="320" height="480" /></a></p>
<h3>Weather Underground</h3>
<p><a href="http://i.wund.com"><img class="alignnone" title="Weather Underground" src="http://i37.tinypic.com/jl48cx.jpg" alt="" width="320" height="480" /></a></p>
<h3>Bonus #15: Engage Interactive</h3>
<p>I just found this design in time to stop the clichéd presses. It&#8217;s unique because it makes use of the iPhone&#8217;s orientation to show different content. In portrait orientation the designer&#8217;s blog is shown. Turn the device on one side to see the portfolio. Flip it over to the other horizontal position to see the about page. You have to try it to believe it.</p>
<p><a href="http://www.engageinteractive.co.uk/blog/2008/05/16/how-to-create-an-iphone-website/"><img class="alignnone" title="Engage Interactive" src="http://i33.tinypic.com/11t9cah.jpg" alt="" width="480" height="320" /></a></p>
<p>That&#8217;s all for today. Come back tomorrow for the next installment in &#8220;The Mobile Web.&#8221;</p>
<p>P.S. If you liked this post, be sure to give it a quick Stumble or <a href="http://www.designfloat.com/Showcases_Galleries/14-great-iphone-optimized-designs/">Float</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.webmaster-source.com/2008/09/28/the-mobile-web-part-4-14-iphone-formatted-websites/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The Mobile Web Part 3: iPhonitizing Your Site Sans MoFuse</title>
		<link>https://www.webmaster-source.com/2008/09/26/the-mobile-web-part-3-iphonitizing-your-site-sans-mofuse/</link>
		<comments>https://www.webmaster-source.com/2008/09/26/the-mobile-web-part-3-iphonitizing-your-site-sans-mofuse/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 09:54:00 +0000</pubDate>
		<dc:creator><![CDATA[Matt]]></dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://www.webmaster-source.com/?p=860</guid>
		<description><![CDATA[In part two of the &#8220;The Mobile Web&#8221; series, I covered MoFuse, a service that automatically generates (and hosts) iPhone and WML versions of websites for you. Today we will be doing something a little more interesting. Today we will be putting together iPhone-formatted sites without the help of a hosted service. Option 1: Use [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>In <a href="http://www.webmaster-source.com/2008/09/25/the-mobile-web-part-2-mobilize-your-site-the-easy-way/">part two</a> of the &#8220;The Mobile Web&#8221; series, I covered MoFuse, a service that automatically generates (and hosts) iPhone and WML versions of websites for you. Today we will be doing something a little more interesting. Today we will be putting together iPhone-formatted sites without the help of a hosted service.</p>
<h3>Option 1: Use a WordPress Plugin</h3>
<p>If you&#8217;re blog is powered by WordPress, you&#8217;re in luck. There are a couple of plugins out there to help make your blog iPhone-friendly.<span id="more-860"></span></p>
<ul>
<li><a href="http://www.bravenewcode.com/wptouch/">WPtouch</a></li>
<li><a href="http://iwphone.contentrobot.com/">iWPhone</a></li>
</ul>
<p>Both of the plugins automatically detect whether the user is coming to the site via iPhone and render the blog with their own included iPhone themes. WPtouch also allows the reader to toggle between iPhone-formatted and normal versions of the site. (iWPhone does not have this feature yet.)</p>
<h3>Option 2: Code it Yourself</h3>
<p>Note: I will not be providing complete sample code, and I won&#8217;t be covering every little detail of the process. The following is intended for people who have some knowledge of PHP or <em>*insert web language here*</em>.</p>
<p>First, download a CSS/JavaScript iPhone interface. There are a few out there, such as <a href="http://code.google.com/p/iui/">iUI</a>, <a href="http://clientside.cnet.com/cnet-js-standards/ciui-cnet-iphone-ui/">CiUI</a>, and <a href="http://davidcann.com/iphone/">iPhone Interface in JavaScript</a>. (My favorite is CiUI.)</p>
<p>Once you get the feel for how the interface works, start writing a back-end for it. Use your favorite scripting language to pull the content into the interface. There are two ways to go about this:</p>
<ul>
<li>Access the database, query the posts, then display them.</li>
<li>Use <a href="http://simplepie.org">SimplePie</a> or <code>SimpleXmlElement</code> (in the case of PHP) to parse the RSS feed and write the items into the page.</li>
</ul>
<p>Both options are generally easy enough if you know what you&#8217;re doing, and work well. If you want as much control over the final product as possible, this is the way to go.</p>
<h3>Further Reading</h3>
<ul>
<li><a href="http://developer.apple.com/webapps/">Web Apps DevCenter</a></li>
<li><a href="http://www.problogdesign.com/accessibility/prepare-your-blog-for-the-iphone-easily/">Prepare Your Blog for the iPhone, Easily</a></li>
<li><a href="http://dotnetslackers.com/articles/aspnet/DevelopingForTheiPhone.aspx">Developing for the iPhone</a></li>
</ul>
<p><em>Come back on Sunday for the next installment in The Mobile Web.</em></p>
]]></content:encoded>
			<wfw:commentRss>https://www.webmaster-source.com/2008/09/26/the-mobile-web-part-3-iphonitizing-your-site-sans-mofuse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Mobile Web Part 2: Mobilize Your Site the Easy Way</title>
		<link>https://www.webmaster-source.com/2008/09/25/the-mobile-web-part-2-mobilize-your-site-the-easy-way/</link>
		<comments>https://www.webmaster-source.com/2008/09/25/the-mobile-web-part-2-mobilize-your-site-the-easy-way/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 10:29:17 +0000</pubDate>
		<dc:creator><![CDATA[Matt]]></dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[WML]]></category>

		<guid isPermaLink="false">http://www.webmaster-source.com/?p=858</guid>
		<description><![CDATA[There are many ways to create a mobile version of your website. You can do it manually, use a WordPress plugin, or let MoFuse do it for you. Today I will cover the easy option, MoFuse, and follow-up this post with the more advanced option tomorrow. MoFuse allows you to &#8220;Mobilize your blog&#8221; in about [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><a href="http://mofuse.com/"><img style=' float: right; padding: 4px; margin: 0 0 2px 7px;'  class="alignright" title="MoFuse Logo" src="http://i37.tinypic.com/15odjjb.jpg" alt="" width="169" height="45" /></a>There are many ways to create a mobile version of your website. You can do it manually, use a WordPress plugin, or let <a href="http://mofuse.com/"><strong>MoFuse</strong></a> do it for you. Today I will cover the easy option, MoFuse, and follow-up this post with the more advanced option tomorrow.</p>
<p>MoFuse allows you to &#8220;Mobilize your blog&#8221; in about ten minutes. You simply create a free account, supply your blog&#8217;s URL, and pick a URL for your resulting mobile site. The URL will look something like <code>you.mofuse.mobi</code>, though you can map it to your own subdomain if you wish (<code>m.yourdomain.com</code> is a common convention).<span id="more-858"></span></p>
<p>You can upload a logo, customize the color scheme, and control what goes into your mobile site. You start out with a homepage consisting of just your ten most recent posts, though you can add in more RSS feeds, static pages, and links to other sites.</p>
<p>MoFuse generates both an iPhone/iPod Touch version and a WML version, and sends visitors to the correct one when they access the site. Users of computers will see previews of what it will look like on their mobile device. Take a look for yourself with <a href="http://source.mofuse.mobi/"><code>source.mofuse.mobi</code></a>.</p>
<ul>
<li><a href="http://source.mofuse.mobi/iphone/preview/">iPhone Version</a></li>
<li><a href="http://source.mofuse.mobi/">WML Version</a></li>
</ul>
<p>You can place a link to your MoFuse page on your site, or you can use a bit of PHP code they provide to automatically detect mobile users visiting your site and send them to MoFuse.</p>
<p>Mofuse is a great option for anyone looking to easily put together a mobile version of their blog (or any RSS-equipped website).</p>
<p><em>Come back tomorrow for the next post in The Mobile Web.</em></p>
]]></content:encoded>
			<wfw:commentRss>https://www.webmaster-source.com/2008/09/25/the-mobile-web-part-2-mobilize-your-site-the-easy-way/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>The Mobile Web Part 1: Why Go Mobile?</title>
		<link>https://www.webmaster-source.com/2008/09/24/the-mobile-web-part-1-why-go-mobile/</link>
		<comments>https://www.webmaster-source.com/2008/09/24/the-mobile-web-part-1-why-go-mobile/#comments</comments>
		<pubDate>Wed, 24 Sep 2008 10:19:14 +0000</pubDate>
		<dc:creator><![CDATA[Matt]]></dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[WML]]></category>

		<guid isPermaLink="false">http://www.webmaster-source.com/?p=856</guid>
		<description><![CDATA[The mobile web is growing fast. More and more people are browsing the web on the go, besides at home on their computer. Now is a good time to put together a mobile version of your site, so you don&#8217;t miss out on the extra eyes that could potentially read your site. Today, the mobile [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>The mobile web is growing fast. More and more people are browsing the web on the go, besides at home on their computer. Now is a good time to put together a mobile version of your site, so you don&#8217;t miss out on the extra eyes that could potentially read your site.</p>
<p>Today, the mobile web is split between two groups: iPhone/iPod Touch users and everybody else.</p>
<p>Plenty of people have phones now that can browse stripped-down <a href="http://en.wikipedia.org/wiki/Wireless_Markup_Language">WML</a> pages, which is painful at best, impossible at worst. Then Apple came out with the iPhone and iPod Touch, finally creating a mobile device that&#8217;s actually bearable to surf the web with. (I recently bought an iPod Touch, and I have to say it&#8217;s awesome.)</p>
<h3>iPhone and iPod Touch</h3>
<p>As great as the iPhone/i&#8217;Touch is, it&#8217;s not perfect. It&#8217;s still much easier to navigate an <a href="http://m.digg.com/">iPhone-specific page</a> than a normal page. I can read pretty much any page on the web with ease on my iPod Touch. Here I am reading a page on <a href="http://www.problogdesign.com/">Pro Blog Design</a> with the device:<span id="more-856"></span></p>
<p><img class="alignnone" title="Pro Blog Design on the iPod Touch" src="http://i34.tinypic.com/25f3s6q.jpg" alt="" width="320" height="480" /></p>
<p>Looks fairly easy to read, right? With a double-tap, you can make a portion of the page (in this case the content column) fill the screen for easy viewing. From there you can scroll in any direction by dragging your finger along the screen. Need more horizontal space? Just rotate the device, and the display will switch to landscape mode.</p>
<p>Easy enough, but iPhone-specific pages are even better. Here&#8217;s a screenshot of <a href="http://iphone.cnet.com">iphone.cnet.com</a>, which I believe to be the best-made iPhone site so far:</p>
<p><img class="alignnone" title="CNet for the iPhone" src="http://i33.tinypic.com/34dn539.jpg" alt="" width="320" height="480" /></p>
<p>Looks fairly similar to the iPhone&#8217;s menu system, doesn&#8217;t it? It works much like they do also. Want to see if the latest episode of the <a href="http://bol.cnet.com">Buzz Out Loud</a> podcast is out? Tap &#8220;Podcast Central&#8221;; the menu will slide away, being replaced with a new one. Then tap &#8220;Buzz Out Loud&#8221; and check through the results to see if there&#8217;s a new one. If there is, you can even play it right then, streaming it over the webs. (You would be advised to only try streaming web audio over WiFi, and not over 3G or EDGE phone service.)</p>
<p>You can find pretty much everythig CNET has to offer through the iPhone (thanks to the wonders of databases). You can even search, to easily find a specific product review; you can read current tech news; you can see what the CNET bloggers are talking about today. It works well. Why? Everything is put together here in an easily navigable list that can be scrolled through with the flick of a finger. No zooming or horizontal panning necessary.</p>
<p>Which is better for <em>your</em> site? Should you have a version of your site for the iPhone and iPod Touch, or should you just let them use your normal site? It depends on three factors:</p>
<ol>
<li>Is your site&#8217;s design easy to navigate on the iPhone?</li>
<li>What type of content do you have?</li>
<li>Who is your audience?</li>
</ol>
<p>To get a vague idea of what your site will look like on the iPhone, use a tool such as <a href="http://marketcircle.com/iphoney/">iPhoney</a> or <a href="http://www.testiphone.com/">TestiPhone</a>. You&#8217;ll get better results though if you try it out on an actual device (which is part of why I bought an iPod Touch). Borrow a friend&#8217;s for a couple of minutes, or walk into your local Apple store (or other consumer electronics store) and play with a demo model. (Apple stores pretty much always have open WiFi networks, so you&#8217;ll be able to test your site out there.)</p>
<p>For the second item on the list, just ask yourself a couple questions: Is my content time-oriented (such as news)? Would I want to check this site for new postings when I&#8217;m out and doing things?</p>
<p>As for your audience, think about the sort of people who use your site. (If you have no clue, run a reader survey.) Do they have any of Apple&#8217;s web-ready mobile devices? Are they g33ks? Are they the sort of people who want to keep up with online goings on no matter where they are?</p>
<p>In the end, the decision is up to you. Do you think it&#8217;s necessary to build an iPhone-specific version of your site? If you have ten minutes free (or a few hours, depending on how you want to go about it), go ahead and throw one together. The worst that can happen is no one will use it.</p>
<h3>The Watered-Down Web: WML Sites</h3>
<p>WML, or Wireless Markup Language, is a subset of XML. It&#8217;s like a stripped-down version of XHTML. There aren&#8217;t a lot of formatting options, and the syntax is very strict. A lot of phones out there can view sites formatted in WML, but it&#8217;s not a pleasant experience. I don&#8217;t happen to have a WAP device, but here&#8217;s an approximation of what it looks like:</p>
<p><img class="alignnone" title="WML Site" src="http://i34.tinypic.com/2qxq82d.jpg" alt="" width="239" height="280" /></p>
<p>I don&#8217;t happen to have a WML device, but simulators like this show a fairly good approximation of how they work. They don&#8217;t look all that great, you can&#8217;t have more than a couple of images, and navigation is a nightmare, relying on the phone&#8217;s keypad to scroll and activate links. You probably won&#8217;t find a device with a screen capable of showing more than ten lines of 25 characters either.</p>
<p>If you think your site would potentially be of value to users of WML devices, you could go ahead and put together a WML version, but keep in mind that most people with WML-capable phones don&#8217;t use them to browse the web, due to the painful navigation, slow speeds, and lack of support.</p>
<h3>Conclusion</h3>
<p>So, are you interested in putting together a mobile site? Stay tuned, part two of this series will be coming at you tomorrow.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.webmaster-source.com/2008/09/24/the-mobile-web-part-1-why-go-mobile/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/


Served from: www.webmaster-source.com @ 2026-04-29 11:34:56 by W3 Total Cache
-->