Seasonal Savings: 20% off selected memberships for a limited time. Give now

Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Creating full-screen web apps

From: Mobile Web Design & Development Fundamentals

Video: Creating full-screen web apps

In this example, we are going to see how to create a full-screen web app on iOS devices. By doing this, you can make a web page look and act like a native application because the page can use the full-screen real estate available to it and hide the browser chrome. So it will hide the address bar, it will hide the status bar, and use the entire page, and look like a native, built-in application. You can also do some really cool things, like specify start-up images, sometimes called splash screens. So when user is starting up your web page it will show this graphic to the user, again giving it more of a native application kind of feel.

Creating full-screen web apps

In this example, we are going to see how to create a full-screen web app on iOS devices. By doing this, you can make a web page look and act like a native application because the page can use the full-screen real estate available to it and hide the browser chrome. So it will hide the address bar, it will hide the status bar, and use the entire page, and look like a native, built-in application. You can also do some really cool things, like specify start-up images, sometimes called splash screens. So when user is starting up your web page it will show this graphic to the user, again giving it more of a native application kind of feel.

You can also specify the icons that will represent the app on the device's home screen if the user pins your application to the home screen. So you can customize how that looks. So the way that you do this is by specifying certain tags that the iPhone and other iOS devices will recognize that indicate that this particular web page, or collection of web pages, are capable of running in the full-screen mode. The first of these is the apple-mobile- web-app-capable meta tag and if you set the content tag to true then that tell the iOS device that this web page should be run in full-screen mode and is capable of looking like a native web app.

The second one is the apple-mobile-web- app-status-bar-style and if you set the content of that to black, that will hide the status bar and give your web app page access to the full screen. The next one is a link tag which has a rel attribute which is set to the value of apple-touch-startup-image, and you give the path to the image you want in the href attribute. And this image has to be 320x460 pixels in portrait mode, and if it fits those dimensions and you specify the path here then the iOS device will use this image as the startup image while your page is loading.

Finally, your JavaScript code can tell whether the page is running in full- screen mode--and this only works in iOS--by looking at window.navigator.standalone. The cool thing is that Android, starting with version 2.2, supports most of these properties. So if you specify apple-mobile-web-app-capable and apple-mobile-web-app-status-bar-style and so on, it will also run your web pages in full-screen mode. You can also specify homepage icons, like I said earlier, and there are two ways to do this. Option one, which you will use if you want to specify the same icon for all the pages in the web app, is to create a file named apple-touch-icon.png at the root of the site.

Alternatively, you can use a file named apple-touch-icon-precomposed. And the main difference between these two files is that if you use the apple-touch-icon name then when the icon is displayed on the home screen, the iOS device will sort of enhance the icon a little bit. It will give it a glossy look. It will round the edges a little bit. It will perform some enhancements on the icon that you provide. If you don't want that to happen then you add the precomposed keywords to the file name and the device will just leave the icon alone and use it as you've designed it.

The second option is to specify an icon for a particular page. And this will override any icon that you specified using option one, and that is to use a link tag with a rel attribute of apple-touch-icon and the href set to the path to the icon that you want to use for this particular page. So if you do this and you have an apple-touch-icon or precomposed one at the root of the site, like you have an option one there, then it will override the icon that you specified using that option.

So let's see how this works in real code. I am going to switch over to Xcode, and you can see here that I've got my ExampleSnippets file open, and I am going to scroll down to the Creating Full-Screen Web Apps section, and I am going to go over to my fullscreen_start example file. What we are going to do is you can see that this is the page that we are going to use as the full-screen example. It's a very simple page. It just has a title and some text in it. So let's go back to the snippets, and I am going to copy these tags.

So I'll copy these, and I'll paste them into my fullscreen_start here. So you can see here that I've specified a viewport tag with the width equal to device-width, setting user-scalable to no, and the initial-scale to 1.0. I have my apple-mobile-web-app-capable tag and the content is set to yes. I've got my apple-mobile-web-app-status- bar-style and the content is to black. So that's going to tell the iPhone simulator to give me control of full screen. And I've got an apple-touch-icon specified to the icon contained in the images folder for myappicon, and I've got the apple-touch-startup-image set to startup image.

So now I am going to save this. Saved. And let's go back to the finder. So I am going to copy my fullscreen_start file, and I am going to copy that, and I am going to go to the folder over here, and I am going to go ahead and paste that. And we'll repaste it. Now let's go to the simulator, and we are going to fire up Safari, and we are going to send Safari to localhost.

So when we load the page in the browser you can see that I still have the chrome here and I've got the status bar down here. So what I am going to do is click on the Add to Home Screen, and you can see that here's my little custom icon. And because I am not using the precomposed version, it's putting this little glossy effect on here. And I am going to go ahead and add an extra p, and I am going to click Add. So when I click that you can see that my icon has now been added to the iPhone's home screen.

And when I click on this you can that there is my startup page image, and then here is my full-screen app. It's now running in full-screen mode. You see that the URL bar is gone, the address bar is gone, and the experience that the user is getting is that this looks like a native, built-in application. So just by specifying those meta tags and link tags, you can give your web pages a native app look and feel on the iPhone.

Show transcript

This video is part of

Image for Mobile Web Design & Development Fundamentals
Mobile Web Design & Development Fundamentals

46 video lessons · 25749 viewers

Joe Marini
Author

 
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

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
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.


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.

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 preferences from 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.

Learn more, save more. Upgrade today!

Get our Annual Premium Membership at our best savings yet.

Upgrade to our Annual Premium Membership today and get even more value from your lynda.com subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

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.