Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Hello, World!

As with any developer book, we’re going to start with the default HelloWorld application and then build upon it to highlight different aspects of a PhoneGap application. The following HTML content describes a simple web page that displays some text on a page.


HelloWorld1 Application

<!DOCTYPE HTML> 
<html> 
<head> 
  <title>HelloWorld1</title>   
</head> 
<body> 
  <h1>Hello World</h1>   
  <p>This is a sample PhoneGap application</p>   
</body> 
</html> 


If you package that page into a PhoneGap application and run it on a smartphone or device emulator (in this case an Android emulator), you will see something similar to what is shown in Figure 2-1.

Image

Figure 2-1 HelloWorld1 application running on an Android emulator

This is technically a PhoneGap application because it’s a web application running within the PhoneGap native application container. There is, however, nothing PhoneGap-ish about this application. It’s running in the PhoneGap native container, but it isn’t leveraging any of the APIs provided by the PhoneGap framework.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint