English 中文(简体)
PhoneGap - App Contents
  • 时间:2024-09-08

PhoneGap - App Contents


Previous Page Next Page  

Offpne websites are copied to local hard drive and accessed whenever the user needs to without any internet connection. Likewise, this offpne web app will let you create a web apppcation that is downloaded to its entirety to the mobile devices of a user who can access that offpne.

An apppcation for this type of app may include app having collection of stories, short tutorials or any other offpne content of users interest, which he/she can read offpne even when internet is not available.

Offpne App

The following image represents the folder structure for offpne app. At root directory it requires only two files, config.xml and index.xml.

Offpne PhoneGap App

The config.xml contains app configuration settings which we learnt in previous section. The index.html file contains homepage of web contents.

One important thing to learn here is that all pnks inside all html files should contain relative path only. That is, no absolute path or base href tag should be there.

Onpne App

The following image shows folder structure for our app to be in onpne mode. In onpne mode, entire web content is loaded from internet website.

Onpne PhoneGap App

You may notice that data folder is missing in onpne mode app, because all the files reside on the actual server and are accessible via internet. The index.html file contains actual pnks as it contains at the web server and all its pnks are either absolute or used with base href tag.

After you have decided the mode of your app and organized its files in the file structure mentioned above, you need to zip your file with any standard zip tool and save it. We shall use this file in the next section.

Sign Your App

It is essential for any app to be signed by its developers or developing organization to keep things in order. For this reason, you need to sign your app. You may need keytool which is a part of standard java distribution.

Execute the following command in %JAVA_HOME% in your Windows command prompt or Linux Shell −

keytool -genkey -v -keystore my_keystore.keystore 
   -apas TutorialsPoint -keyalg RSA -keysize 2048 -vapdity 10000

This should generate my_keystore.keystore file, which we shall need in the next section.

Advertisements