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 8768539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:05:43+00:00 2026-06-13T17:05:43+00:00

Im trying to write information about my phone to my app screen. What am

  • 0

Im trying to write information about my phone to my app screen. What am i doing wrong below here?
I have the proper permissions set in my manifest. Im using Phonegap to develope the app. With Jquery.
The app lanuches it jsut doesn not display the phone information.

<p id="deviceProperties">Loading device properties...</p>

Full page code

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="jquery.mobile-1.2.0.css" />
<script type="text/javascript" src="jquery-1.8.2.js"></script>
 <script type="text/javascript" charset="utf-8" src="cordova-2.1.0.js"></script>
<script type="text/javascript" src="jquery.mobile-1.2.0.js"></script>
<script type="text/javascript">

    $(document).on("pageinit", "#newpage", function () {
        $('#saveButton').click(function () {
            localStorage.setItem("name", $('#name').val());
        });

    });
    var wID = navigator.accelerometer.watchAcceleration(onSucess, onerror, { frequency: 1000 });
    function onSucess(a) {
        $('#aX').html(a.x);
        $('#aY').html(a.y);
        $('#aZ').html(a.z);
        $('#aTime').html(a.timestamp);
    }
    function onError() {

    }

    $(document).on('pageshow', '#newpage', function () {
        var personName = localStorage.getItem("name");
        if (personName.length > 0) {
            $('#name').val(personName);
        }
    });

</script>
<script type="text/javascript" charset="utf-8">

// Wait for Cordova to load
//
document.addEventListener("deviceready", onDeviceReady, false);

// Cordova is ready
//
function onDeviceReady() {
    var element = document.getElementById('deviceProperties');

    element.innerHTML = 'Device Name: '     + device.name     + '<br />' + 
                        'Device Cordova: '  + device.cordova  + '<br />' + 
                        'Device Platform: ' + device.platform + '<br />' + 
                        'Device UUID: '     + device.uuid     + '<br />' + 
                        'Device Version: '  + device.version  + '<br />';
}

</script>

<title>Hello World 2</title>
</head>
<body>

<div id="home" data-role="page">

    <div data-role="header">
        <h1>Home Page2</h1>
    </div>

    <div data-role="content">
        hello Phone Gap and JQuery Mobile! 
        <a href="#newpage" data-role="button">new page</a>
        <br>
    <p id="deviceProperties">Loading device properties...</p>
         <p id="ax">  </p>
        <p id="ay">  </p>
        <p id="az">  </p>
        <p id="aTime">  </p>
    </div>

    <div data-role="footer" data-position="fixed">
    <a href="#dialogpage" data-rel="dialog" data-icon="plus">Add Something</a>

    </div>
</div>


<div id="newpage" data-role="page">

    <div data-role="header">
    <a href="#home" data-icon="delete">Cancel</a>
        <h1>New Page</h1>
        <a href=#home" data-icon="save">save</a>
    </div>

    <div data-role="content">
        <label for="name">what is your name?</label>
        <input id="name" type="text" name="name" value="" />
        <a id="saveButton" href="" data-role="button">Save</a>
    </div>

    <div data-role="footer" data-position="fixed">
        <h4>
            footer</h4>
    </div>

</div>

<div id="dialogpage" data-role="page"> 
 <div data-role="header">
        <h1>Dialog</h1>
    </div>
     <div data-role="content">
        this is a dialog
     </div>
</div>

<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript">
    app.initialize();
</script>
</body>
</html>
  • 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-13T17:05:44+00:00Added an answer on June 13, 2026 at 5:05 pm

    You need to wait until you get the deviceready event from PhoneGap, otherwise you are requesting it before PhoneGap is actually initialized and ready to return data. See the docs/example here: http://docs.phonegap.com/en/2.1.0/cordova_device_device.md.html#Device

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

Sidebar

Related Questions

Hi I'm trying to write a query to get information about the author, title,
I'm trying to write date information use a Spring 3 JdbcTemplate. I have something
I am trying to write a program to collect security information about a file
I am trying to write an app that will have a web interface for
I've tried looking for some information about a query I'm trying to write and
I'm trying to write a kernel module, which prints some information about the objects
I am trying to write a monitoring tool to monitor some information It will
I am trying to write a MSBuild logger module which logs information when receiving
I'm trying to write some code to extract Exif information from a JPG. Exif
I've been trying to write code that loads a .png file, attaches hotspot information,

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.