Start learning with our library of video tutorials taught by experts. Get started

Mobile Web Design & Development Fundamentals
Illustration by

Developing mobile pages with desktop browsers


From:

Mobile Web Design & Development Fundamentals

with Joe Marini

Video: Developing mobile pages with desktop browsers

One of the neat things about developing mobile web pages is that you can use your desktop browser for mobile web page development, and this is possible because many of the common desktop browsers now have mobile counterparts. For example, IE has IE Mobile, and Mozilla has the Fennec browser on platforms like Nokia and Windows mobile, and Safari obviously works on Mac and Windows and iPhone, and the Android system has the Chrome browser.
Expand all | Collapse all
  1. 2m 48s
    1. Welcome
      1m 2s
    2. Using the exercise files
      1m 46s
  2. 29m 25s
    1. Understanding the mobile context
      8m 5s
    2. A survey of mobile sites
      11m 44s
    3. Targeting mobile browsers
      4m 31s
    4. Previewing a complete mobile site
      5m 5s
  3. 27m 20s
    1. Designing for one web
      3m 43s
    2. Using well-defined web standards
      3m 45s
    3. Designing mobile-friendly pages
      3m 40s
    4. Being crisp, clean, and succinct
      5m 45s
    5. Minimizing input where possible
      6m 47s
    6. Focusing on the core scenarios
      3m 40s
  4. 1h 13m
    1. Installing the tools
      3m 52s
    2. Setting up a local web server
      9m 13s
    3. Installing device emulators
      17m 5s
    4. Using device emulators
      13m 9s
    5. Downloading Modernizr and Mobile Boilerplate
      6m 22s
    6. Building a first mobile web page
      5m 43s
    7. Developing mobile pages with desktop browsers
      8m 6s
    8. Exploring useful mobile web development resources
      10m 23s
  5. 53m 26s
    1. Reviewing mobile markup languages
      5m 10s
    2. Understanding content adaptation approaches
      10m 32s
    3. Controlling the viewport layout
      12m 50s
    4. Designing forms
      13m 30s
    5. Using CSS media queries
      11m 24s
  6. 1h 11m
    1. Detecting client capabilities with script
      10m 8s
    2. Caching information with local storage
      9m 16s
    3. Determining position with geolocation
      12m 52s
    4. Minimizing HTTP requests with data URLs
      7m 39s
    5. Understanding user agent detection
      9m 8s
    6. Using server-side detection with PHP
      6m 52s
    7. Using server-side detection with ASP.NET
      4m 54s
    8. Using HTML5 Boilerplate for mobile
      11m 6s
  7. 39m 22s
    1. Measuring performance
      7m 41s
    2. Creating full-screen web apps
      6m 30s
    3. Customizing the user interface
      5m 14s
    4. Detecting orientation changes
      3m 58s
    5. Detecting device movement
      5m 21s
    6. Using touch events
      10m 38s
  8. 47m 14s
    1. Taking a look at the finished site
      7m 40s
    2. Examining the header and background image style on the Home page
      10m 10s
    3. Examining the hover effect and layout styles on the Tours page
      6m 42s
    4. Examining mobile forms on the Contact page
      9m 45s
    5. Viewing and testing the mobile site on emulators
      8m 11s
    6. Viewing the site on devices
      4m 46s
  9. 2m 34s
    1. Goodbye
      2m 34s

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
please wait ...
Mobile Web Design & Development Fundamentals
5h 47m Beginner Jul 20, 2011

Viewers: in countries Watching now:

This course surveys the core principles and techniques essential to building web sites for mobile devices. Author Joe Marini introduces the mobile context, sheds light on its unique coding requirements, and discusses interface design techniques that enhance existing sites for mobile viewing. The course shows how to approach designing for mobile form factors such as smaller screens and finger-based interaction, along with how to incorporate CSS3 and HTML5 capabilities, such as geolocation, local storage, and media queries.

Topics include:
  • Implementing well-defined web standards
  • Working with Modernizr and Mobile Boilerplate
  • Building a first mobile web page
  • Understanding content adaptation strategies
  • Designing forms for mobile
  • Detecting client capabilities with script
  • Using server-side detection with PHP and ASP.NET
  • Working with mobile browser capabilities
  • Viewing and testing the mobile site on device emulators
Subjects:
Developer Web Web Foundations Mobile Web
Software:
HTML
Author:
Joe Marini

Developing mobile pages with desktop browsers

One of the neat things about developing mobile web pages is that you can use your desktop browser for mobile web page development, and this is possible because many of the common desktop browsers now have mobile counterparts. For example, IE has IE Mobile, and Mozilla has the Fennec browser on platforms like Nokia and Windows mobile, and Safari obviously works on Mac and Windows and iPhone, and the Android system has the Chrome browser.

So a lot of those rendering engines are the same, or very close to the same, as they are on the desktop. So if you just simply set your user agent broadcasting from your desktop browser, you can fool your web site into sending you your mobile version of your code rather than the desktop version. The general pattern to do this is to change the user agent of the browser on the desktop to match that of a mobile device, and then you just resize the window down to be the same size as a device screen and use the browser's built-in developer tools on desktop to debug and test your web sites.

Remember, you should use the desktop browser that corresponds to the mobile one when possible, since the rendering engines will match up. So let's take a look at some of the tools you can use. Internet Explorer and Safari already have user agent switching built in, so there's nothing new to download there. For Firefox there is a user agent switcher add-on just as there is for Chrome. Opera is a little bit different because they've already got a pretty good desktop-based emulator that's basically a native application on the platform it runs on.

It's not really a hosted virtual machine like some of the emulators are. And the nice thing about that is you can use the Opera Dragonfly debugger with the Opera Mobile emulator, and Opera Dragonfly comes with the desktop version of Opera. So let's switch over to the browsers and see how you go about doing this. I am going to start with Safari, because Safari has one of the tools built in. There are a couple of things you need to do. First, here I am on Windows. Now on the Mac this is a little bit different, but essentially all you need to do is go into the Preferences for the application.

Now, on the Mac you'll do this under the Application name in the Application menu; on Windows here you go to the Edit menu, and Preferences is down here. So you are going to choose Preferences, and then you are going to go over to the Advanced tab, like I have here, and you're going to make sure that the Show Develop menu in the menu bar is checked. So once that's done the Develop menu will show up for you if you are on the Mac. If you're on Windows like me then when you hit the Alt key you will see that you now have a Develop menu. In the Develop menu, you will see that there is a menu in here called User Agent, and it defaults to whatever the default user agent for this version of Safari is, but I can choose a whole bunch of other user agents.

And you will notice that down here in the list I can choose Safari for iOS 4.1, 4.0.2, 3.2.2, and so on. So there's various user agents in here for iPhone, iPod touch, iPad, and so on. And if I am not happy with any of those, I can choose Other, and I can enter my own custom user agent string that I want the browser to pretend it's going to be. So let's just cancel this, and let's see how it works. So suppose I were to go to CNN.com.

Here is the CNN web site. So let's go back to the user agent string, and what I am going to do is I am going to choose Develop and choose User Agent > iOS 4.1 for the iPhone. And you'll notice that when I do that the page refreshes, and you can see that I'm now getting the mobile code. If this were my web site, I would be able to just simply start testing using the built-in Safari tools.

So I can bring up the Web Inspector, because this is WebKit, and just start inspecting the page. Let's go see how this works in another browser. Let's go ahead and try this in IE. Let's go to the CNN.com page. In IE it's a little bit different. You can see here that I have got the IE developer tools opened up. The way that you access those is under the Tools menu, if you go down here in the Tools menu, you will see F12 developer tools. If you just choose that option, this will show up and then under the developer tools, there is a Tools menu here with an entry for a Change user agent string.

Once again, there is a whole bunch of default ones, but I can set it to my own custom ones. So what I am going to do is go back over to my snippets code. Here in my snippets code, you can see I have provided a couple of things. First, here are some URLs to the add- ons you will need for Firefox and Chrome, and we will take a look at those in a moment. But I've also provided some user agent strings that you can use in your testing and inside these user agent switching tools to change the way that web sites present themselves to you. So for example, let's go ahead and get the IE Mobile user agent string.

I am going to copy that, and then I am going to switch back to IE. And then inside the tools, I'm going to do Change user agent string and go Custom, and I am going to call this 'IE Mobile 9' and I will paste in the user agent string and I will click Add. And now I can click Set. So now I have set the user agent string, and let's try going some place else. Let's see. Well, how about we go to southwest.com for Southwest Airlines, and you can see that now that the user agent has been changed to the IE mobile for Windows Phone, I'm now getting the mobile version of the web site.

So that's Safari and IE. Let's take a look at Firefox. For Firefox it's slightly different, because Firefox doesn't come with this ability built in. You have to download an add-on, and there's a really great add-on called the User Agent Switcher, and I have provided the URL here and in my snippets files, so you can just copy and paste this in. I've already added this to Firefox. So when I want to switch the user agent all I've got to do is hit the Alt button here on Windows, or just go to the Tools menu if you're on the Mac, and you'll see that once I have installed this add-on there is a User Agent Switcher. And once again there is one for default, but I can also change it to the iPhone--in this case they have one for the iPhone 3.0-- or I can choose Edit User Agents and in here I can add my own.

So let's go back to the snippets code. Here is the snippets code, and I can choose one for, say, Android. So I will just copy this and go back to Firefox, and here I am back in Firefox, and I will say New User Agent, and I'll just call this Android, and I'll paste in my User Agent code. I can leave these blank if I want to. There's no reason why I have to fill these in. You can if you want to, but I will click OK, and now I've got my Android one in the list.

So now if I go ahead and choose Default User Agent, I can choose Android, and let's go some place. Let's go back to CNN again. You can see that now it's being redirected to the mobile site. That's how you can do mobile development on your desktop using desktop browsers just by using some tools to help switch the user agent around. And this is pretty good for doing things like testing layout, making sure that your user agent detection logic is working correctly. You can use the built-in debugging tools to debug JavaScript and so on.

Now of course this is no substitute for testing on emulators and real devices as well, but it sure does speed up the development process when all you're trying to do is make sure that your HTML code is working correctly and your JavaScript logic is working correctly. It really saves a lot of time.

There are currently no FAQs about Mobile Web Design & Development Fundamentals.

 
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.
Upgrade now


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

join now Upgrade now

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Mobile Web Design & Development Fundamentals.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Notes cannot be added for locked videos.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.