Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8239351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:07:04+00:00 2026-06-07T20:07:04+00:00

——Index.html <!DOCTYPE HTML> <html> <head> <title>AmmoAmmo</title> <meta name=viewport content=width=device-width, initial-scale=1> <link rel=stylesheet href=http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css />

  • 0

——Index.html

<!DOCTYPE HTML>
<html>
<head>
<title>AmmoAmmo</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet"
    href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" />
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script
    src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>
<script type="text/javascript" charset="utf-8" src="cordova-1.9.0.js"></script>
<script type="text/javascript" charset="utf-8" src="samin.js"></script>
<script type="text/javascript" charset="utf-8">

function onLoad() {
    console.log("1.......onLoad()..........."); 
    document.addEventListener("deviceready", onDeviceReady(), false);
}

    // Cordova is loaded and it is now safe to make calls Cordova methods
    //
    function onDeviceReady() {
        console.log("2. -------------onDeviceReady--------------------");
        // Now safe to use the Cordova API
        alert('3. _____________onDeviceReady()-DONE!_____________');
    }

    function saveAmmo(value){

        //testAlert();
        window.localStorage.setItem("selectedAmmo", value);
        alert(value,'_top');

    }
    </script>

</head>
<body onload="onLoad()">
    <div data-role="page" id="homePage" data-theme="a">

        <div data-role="header">
            <a href="index.html" data-icon="info">Help</a>
            <h1>Testing</h1>
            <a href="contact.html" data-icon="info">Contact</a>
        </div>

        <div data-role="content">
            <p>
                <label for="select-choice-0" class="select"></label>
                 <select name="select-choice-0" id="select-choice-0"
                    data-mini="true" onchange="saveAmmo(this.options[this.selectedIndex].value)">
                    <option value='null' SELECTED>Select a Ammo</option>
                    <option value='1' >111</option>
                    <option value='2' >222</option>
                </select>
            </p>


        </div>
        <div class="ui-grid-a">
            <div class="ui-block-a" align="center">
                <img src="images/22-250_rem_1.jpeg" data-theme="c"/>
            </div>
            <div class="ui-block-b" align="center">
                <img src="images/22-250_rem_1.jpeg" data-theme="c"/>
            </div>
        </div>


        <div data-role="footer" data-position="fixed">
            <div data-role="navbar">
                <ul>
                    <li><a href="index.html" class="ui-btn-
           active">Ammo</a></li>
                    <li><a href="testing1.html">Test1</a></li>
                    <li><a href="testing2.html">Test2</a></li>
                </ul>
            </div>
        </div>

    </div>


</body>

</html>

This is exactly the same situation than in Cordova docs:
http://docs.phonegap.com/en/1.9.0/cordova_events_events.md.html#deviceready

Everything else is working but this is coming to be a real showstopper, because I need this when reading data from localstorage. Should I believe the documentation or not?

——–Plugins.xml:

<plugins>
<plugin name="App" value="org.apache.cordova.App"/>
<plugin name="Geolocation" value="org.apache.cordova.GeoBroker"/>
<plugin name="Device" value="org.apache.cordova.Device"/>
<plugin name="Accelerometer" value="org.apache.cordova.AccelListener"/>
<plugin name="Compass" value="org.apache.cordova.CompassListener"/>
<plugin name="Media" value="org.apache.cordova.AudioHandler"/>
<plugin name="Camera" value="org.apache.cordova.CameraLauncher"/>
<plugin name="Contacts" value="org.apache.cordova.ContactManager"/>
<plugin name="File" value="org.apache.cordova.FileUtils"/>
<plugin name="NetworkStatus" value="org.apache.cordova.NetworkManager"/>
<plugin name="Notification" value="org.apache.cordova.Notification"/>
<plugin name="Storage" value="org.apache.cordova.Storage"/>
<plugin name="Temperature" value="org.apache.cordova.TempListener"/>
<plugin name="FileTransfer" value="org.apache.cordova.FileTransfer"/>
<plugin name="Capture" value="org.apache.cordova.Capture"/>
<plugin name="Battery" value="org.apache.cordova.BatteryListener"/>
<plugin name="SplashScreen" value="org.apache.cordova.SplashScreen"/>

——-Manifest.xml———

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mycordova.hellocordova"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="14" />

<supports-screens
    android:anyDensity="true"
    android:largeScreens="true"
    android:normalScreens="true"
    android:resizeable="true"
    android:smallScreens="true" />

<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".HelloCordovaActivity"
        android:label="@string/title_activity_hello_cordova" 
        android:configChanges="orientation|keyboardHidden|screenSize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

    </activity>
</application>

——-Activity.java———-

package com.mycordova.hellocordova;

import android.R;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.MenuItem;
import android.support.v4.app.NavUtils;
import org.apache.cordova.*;

public class HelloCordovaActivity extends DroidGap {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.loadUrl("file:///android_asset/www/index.html");
    }

}

——–Log:

07-16 10:23:12.878: D/DroidGap(637): onMessage(onPageStarted,file:///android_asset/www/index.html)
07-16 10:23:13.848: D/chromium(637): Unknown chromium error: -6
07-16 10:23:22.388: D/CordovaLog(637): 1.......onLoad()...........
07-16 10:23:22.388: D/CordovaLog(637): file:///android_asset/www/index.html: Line 16 : 1.......onLoad()...........
07-16 10:23:22.398: I/Web Console(637): 1.......onLoad()........... at file:///android_asset/www/index.html:16
07-16 10:23:22.398: D/CordovaLog(637): 2. -------------onDeviceReady--------------------
07-16 10:23:22.408: D/CordovaLog(637): file:///android_asset/www/index.html: Line 23 : 2. -------------onDeviceReady--------------------
07-16 10:23:22.408: I/Web Console(637): 2. -------------onDeviceReady-------------------- at file:///android_asset/www/index.html:23
07-16 10:23:22.789: I/Choreographer(637): Skipped 44 frames!  The application may be doing too much work on its main thread.
07-16 10:23:31.608: E/CordovaWebView(637): CordovaWebView: TIMEOUT ERROR!
07-16 10:23:31.608: D/Cordova(637): CordovaWebViewClient.onReceivedError: Error code=-6 Description=The connection to the server was unsuccessful. URL=file:///android_asset/www/index.html
07-16 10:23:31.638: D/DroidGap(637): onMessage(onReceivedError,{"errorCode":-6,"url":"file:\/\/\/android_asset\/www\/index.html","description":"The connection to the server was unsuccessful."})
07-16 10:23:31.869: I/Choreographer(637): Skipped 55 frames!  The application may be doing too much work on its main thread.
07-16 10:23:31.869: D/SoftKeyboardDetect(637): Ignore this event
07-16 10:23:31.995: D/dalvikvm(637): GC_CONCURRENT freed 236K, 4% free 8186K/8519K, paused 27ms+64ms, total 279ms
07-16 10:23:32.788: I/Choreographer(637): Skipped 128 frames!  The application may be doing too much work on its main thread.
07-16 10:26:00.398: D/DroidGap(637): onDestroy()
07-16 10:26:00.398: D/CordovaWebView(637): >>> loadUrlNow()
07-16 10:26:00.398: D/CordovaWebView(637): >>> loadUrlNow()
07-16 10:26:00.489: E/WindowManager(637): Activity com.mycordova.hellocordova.HelloCordovaActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@41232338 that was originally added here
07-16 10:26:00.489: E/WindowManager(637): android.view.WindowLeaked: Activity com.mycordova.hellocordova.HelloCordovaActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@41232338 that was originally added here
07-16 10:26:00.489: E/WindowManager(637):   at android.view.ViewRootImpl.<init>(ViewRootImpl.java:374)
07-16 10:26:00.489: E/WindowManager(637):   at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:292)
07-16 10:26:00.489: E/WindowManager(637):   at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:224)
07-16 10:26:00.489: E/WindowManager(637):   at android.view.WindowManagerImpl$CompatModeWrapper.addView(WindowManagerImpl.java:149)
07-16 10:26:00.489: E/WindowManager(637):   at android.view.Window$LocalWindowManager.addView(Window.java:547)
07-16 10:26:00.489: E/WindowManager(637):   at android.app.Dialog.show(Dialog.java:277)
07-16 10:26:00.489: E/WindowManager(637):   at android.app.AlertDialog$Builder.show(AlertDialog.java:932)
07-16 10:26:00.489: E/WindowManager(637):   at org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:120)
07-16 10:26:00.489: E/WindowManager(637):   at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:572)
07-16 10:26:00.489: E/WindowManager(637):   at android.os.Handler.dispatchMessage(Handler.java:99)
07-16 10:26:00.489: E/WindowManager(637):   at android.os.Looper.loop(Looper.java:137)
07-16 10:26:00.489: E/WindowManager(637):   at android.app.ActivityThread.main(ActivityThread.java:4745)
07-16 10:26:00.489: E/WindowManager(637):   at java.lang.reflect.Method.invokeNative(Native Method)
07-16 10:26:00.489: E/WindowManager(637):   at java.lang.reflect.Method.invoke(Method.java:511)
07-16 10:26:00.489: E/WindowManager(637):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
07-16 10:26:00.489: E/WindowManager(637):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
07-16 10:26:00.489: E/WindowManager(637):   at dalvik.system.NativeStart.main(Native Method)

Cheers,
Sami

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T20:07:06+00:00Added an answer on June 7, 2026 at 8:07 pm

    It looks like it is taking too long to load the main page. You should pull those 3 jQuery files and package them with your app instead of having them loaded remotely.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

&mdash; or &#8212; Is there a difference between these? Is one better-supported than the
I'm using a DatePicker ( org.apache.wicket.extensions.yui.calendar.DatePicker — Javadoc ) in a form. The form
I need to stack two tables on top of each other with content before
string formIdList = 8256, 8258, 8362, 8120, 8270, 8271, 8272, 8273, 8257, 8279, 8212,
I've an ASCII file that contains an EM Dash (— or &mdash; in HTML).
I am using JSoup to parse a gb2312 charset page: http://vars.sinaapp.com/u/t/jsoup_output_encoding_issue.html source code: String
I have a directory structure like this: node_modules/mymodule/index.js : module.exports = require('./lib/mymodule'); node_modules/mymodule/lib/mymodule.js var
I'm using some of Firefox's specially-defined values for cursor, in particular -moz-zoom-in -moz-zoom-out -moz-grab
Basically, is there a way to write a.children('.outer').children('.inner') without the intermediate selector? I can't
So to start, I have an array of XML files. These files need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.