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
Share this Page URL

Chapter 20: Phonegap: Native APPS from Y... > Merging Your Web App Code


Now that you have the Xcode part of the puzzle working, you may be tempted to directly overwrite the default index.html file that is contained in the www folder with your own file and recompile. However, don’t do that. The PhoneGap template index.html file contains essential HTML/JavaScript parts of a PhoneGap app, such as a reference to a PhoneGap JavaScript library file, default event handlers used to allow your app to work within the PhoneGap environment, and advanced event handlers that you can uncomment if you want to utilize them in your app. The template index.html file is shown here:

<!DOCTYPE html>
    <meta name="viewport" content="width=device-width,
      initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
    <meta charset="utf-8">
    <!-- iPad/iPhone specific css below, add after your main css >
    <link rel="stylesheet"
      media="only screen and (max-device-width: 1024px)"
      href="ipad.css" type="text/css" />
    <link rel="stylesheet"
      media="only screen and (max-device-width: 480px)"
      href="iphone.css" type="text/css" />
    <!-- If your application is targeting IOS BEFORE 4.0 you MUST put json2.js
     from into your www directory and include
     it here -->
    <script type="text/javascript" charset="utf-8"....


You are currently reading a PREVIEW of this book.


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


Start a Free 10-Day Trial

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