Ciaran Gallagher
Ciaran Gallagher

Reputation: 4020

PhoneGap / Apache Cordova: Stuck on "device is ready" screen

I have a PhoneGap/Apache Cordova application, and I have inserted my own index.html page into the www folder, but when I run the application it doesn't go to the index.html page, instead it launches the splash screen which has the "device is ready" message. Where do I configure the launch page?

Index.html page:

<html>
<head>
    <script src="jquery-2.1.1.js"></script>
    <link rel="stylesheet" href="jquery.mobile/jquery.mobile-1.4.4.min.css" />
    <script src="jquery.mobile/jquery.mobile-1.4.4.min.js"></script>
</head>
<body>
    <div data-role="header" data-theme="b" class="ui-bar ui-bar-b"> 
        <h1>Welcome to my app!</h1>
    </div>
    Username <input type="text" id="username" name="Username"></input><br>
    Password <input type="text" id="password" name="Password"></input>
    <button id="submit">Submit</button>
    <div data-role="footer" data-theme="b" class="ui-bar ui-bar-b"><h1>Placeholder</h1></div>
</body>
<style type="text/css">
body{
    border:0;
}
</style>
</html>

Upvotes: 6

Views: 14634

Answers (3)

CertDoctor
CertDoctor

Reputation: 101

I'm building for iOS. An had similar problems. I'm a novice but have had a cordova app on the App Store for at least 3 years so I know this has changed. There is now a WWW folder and a Staging/WWW folder the later seems to be inportant. And two Config.xml files. Additionally, its important to drag an paste you HTML files/folders directly into Xcode which helps to build a proper index... They can be in the drive file structure but still not visible in Xcodes Tree/IDE thingy; which is to say they won't be grabbed when you build and run... I find the whole thing confusing but like I said I'm a novice.

Upvotes: 0

Narendran Parivallal
Narendran Parivallal

Reputation: 1130

I think you're not editing the right index.html file. If you are building for android then there is a index.html file located in assets/www folder. This is the file you should be editing to create the first screen of your android app.

Note: The www folder will be hidden by default, to make it visible goto Project -> Properties -> Resource -> Resource Filters in Eclipse and remove the exclusion filters.

For more information check this: http://codezag.com/apache-cordova-android-stuck-device-ready-screen/

Upvotes: 8

frank
frank

Reputation: 3330

The config.xml should contain an entry like <content src="index.html" />
Below is a sample config.xml file. The entry in the config.xml file can be overwritten by your own html filename, that will be used as the startup html file.

EDIT1:
Oops. I completely forget to see your edited question.

You are missing an important entry in your index.html file.

You need to include the following in your head tag.

<head>
        <!-- Cordova Script Tag over here -->
        <script type="text/javascript" src="cordova.js"></script>

        <!-- Jquery plugin over here -->

</head>

** Sample config.xml below **

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.company.appname" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <preference name="loglevel" value="DEBUG" />
    <preference name="AndroidLaunchMode" value="singleTop" />
    <feature name="App">
        <param name="android-package" value="org.apache.cordova.App" />
    </feature>
    <feature name="Device">
        <param name="android-package" value="org.apache.cordova.device.Device" />
    </feature>
    <name>appname</name>
    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>
    <author email="[email protected]" href="http://cordova.io">
        Apache Cordova Team
    </author>
    <content src="index.html" />
    <access origin="*" />
</widget>

Upvotes: 1

Related Questions