Showing posts with label Dreamweaver. Show all posts
Showing posts with label Dreamweaver. Show all posts

Friday, May 04, 2012

PhoneGap and Dreamweaver CS5.5

Apps for iOS and Android mobile devices are written in the Objective-C programming language. For some time, developers have been working on technology that would convert HTML5, CSS, and JavaScript to Objective-C apps.
The most widely supported and advanced technology for doing this is PhoneGap. The apps that result from PhoneGap conversion do not have all the functionality of apps written from scratch in Objective-C. Apps developed with PhoneGap are allowed by Apple for distribution through iTunes.

In addition, Dreamweaver CS5.5 relatively seamlessly integrates PhoneGap, with one major caveat: You can generate Android apps—for Google Android mobile devices—with Dreamweaver CS5.5 for Windows or on a Mac. However, you can only generate apps for iOS using Dreamweaver CS5.5 on a Mac. This limitation is not something inherent in Dreamweaver CS5.5. It is a product of the fact that Apple does not make the required tools for converting web pages to apps available for Windows computers. However, it does mean that if creating iOS apps is important to your web develop

Default jQuery Mobile CSS

Before you start experimenting or working with the CSS file that comes with jQuery Mobile pages you might find it useful to keep the following URL handy: http://code.jquery.com/mobile/latest/jquery.mobile.css.

This URL leads to the jQuery Mobile CSS file. A version of the jQuery Mobile CSS file is included when Dreamweaver CS5.5 generates a jQuery Mobile starter page. If you look at the CSS file that opens when you generate a jQuery Mobile page in Dreamweaver CS5.5, you will see that it is 1.0a3/jquery.mobile-1.0a3.min.css. Alternatively, an updated version of the CSS file that has been released since Dreamweaver CS5.5 incorporated this CSS file.

There are two good reasons to go online and grab the latest version of the jQuery Mobile CSS if that is an option. For one thing, it is periodically updated. The other is that if you corrupt the version of the CSS file that comes with Dreamweaver, something I have found quite easy to do, you can simply go to the link above, copy and paste the CSS code, and use that to create a "clean" CSS file to use when you build jQuery Mobile pages from scratch.

The CSS file you download will have a slightly different file name than the one provided with Dreamweaver, reflecting the current version. Once you download the new CSS file, you can save that CSS file with your own name to create customized CSS for your jQuery Mobile pages.

Dreamweaver's HTML5 Pack and design elements

Now that we have introduced the key design elements of HTML5, we are almost ready to generate pages that use those elements in Dreamweaver. Before we do, however, it will be helpful to preview briefly, conceptually, how Dreamweaver generates HTML5 layouts.


The first thing to emphasize is that HTML5 elements such as <header>, <footer>, <article>, <section>, <aside>, and <nav>, do not really do much if anything "on their own." Like their DIV tag evolutionary precursors, they are more or less empty vessels. HTML5 elements take shape, literally, when connected with CSS styles.

For example, a web page might have a <header> defined as stretching the entire width of the page, at the top of the page, with a set background color, and spacing that keeps it from bumping into other page elements. All of these attributes (size, location, background color, and spacing) are defined in a CSS style sheet that includes a specific CSS style associated with the <header> element. Moreover, this symbiotic relationship between HTML5 layout elements and CSS styles is required for each HTML5 layout element.

Therefore, when Dreamweaver generates page layouts using HTML5 elements, it also generates a CSS file that has already built-in style rules for all the HTML5 elements used in the page.

Of course, you can change how HTML5 elements appear. You can edit the generic content that Dreamweaver provides with the HTML5 layouts. Alternatively, you can change the appearance of the HTML5 elements by editing the CSS styles. We will do both of these things in the next chapter of this book. Here and now, we will focus on setting up Dreamweaver so that it can generate HTML5 pages and then we will actually create those pages.

With the basic understanding of HTML5 layout elements and the way they interact with CSS under our belts, the time has come to launch into Dreamweaver and begin to create HTML5 layouts.