Accelerometer works only with Phonegap Build

The following example works fine on the Infocus m210 smart phone and does not work on Asus Zenfone 2 (zen kl-500).

Any ideas why?

------------------------------------------------------------------------

<! DOCTYPE html >

< html >

< head >

< title > example < /title > acceleration

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

var watchID = null;

function onLoad() {}

document.addEventListener ("deviceready", onDeviceReady, false);

}

function onDeviceReady() {}

startWatch();

}

function startWatch() {}

var options = {frequency: 1000};

watchID = navigator.accelerometer.watchAcceleration (onSuccess, onError, options);

}

function stopWatch() {}

If {(watchID)

navigator.accelerometer.clearWatch (watchID);

watchID = null;

}

}

function onSuccess (acceleration) {}

element var = document.getElementById ('accelerometer');

element.innerHTML = "Accélération X:" + acceleration.x + ' < br / > ' +

"Accélération Y:" + acceleration.y + ' < br / > ' +

"Accélération Z:" + acceleration.z + ' < br / > ' +

"Timestamp:" + acceleration.timestamp + ' < br / > '; "."

}

onError() {} function

Alert ('onError!');

}

< /script >

< / head >

< body onload = "onLoad ()" >

< div id = "accelerometer" > waiting for accelerometer... < / div >

< button onclick = "startWatch (); ' > start watching < / button >

< button onclick = "stopWatch (); "> stop watching < / button >

< script type = "text/javascript" src = "cordova.js" > < / script >

< / body >

< / html >

-------------------------------------------------------

It works after I changed to:

Thanks a lot for your help.

Tags: PhoneGap

Similar Questions

  • RoboForm does not work with your new browser. It is very fustrating and works only with Windows Explorer. I need to reinstall the old FIREFOX program?

    RoboForm does not work with your new browser. It is very fustrating and works only with Windows Explorer. I need to reinstall the old FIREFOX program?

    RoboForm has already released a version with support for the latest version of Firefox. See http://www.roboform.com/support/news. Try upgrading to the latest version of Roboform.

  • Windows 7 works only with canon MX 340

    Canon MX 340 printer works only with windows 7.

    Canon MX 340 printer works only with windows 7.

    You mean the Canon PIXMA MX340?

    You have the following drivers installed? :
    http://www.USA.Canon.com/nw3s/CanonUSA/DownloadContents/English/0100461601EN.htm
    (As of 10/23/12)

  • External speakers work only with powerpoint.

    External speakers work only with powerpoint. DVD, internet, music files, are not. They worked for the first few weeks.

    I have a HP dv7-6c27cl with intel core i5 and Windows 7.

    When I have the system check it, it finds no problem.  Apparently, I have the latest drivers. The fact that the speakers work with powerpoint, which is confusing.

    When I play a video file or music, I get an error message: "Windows Media Player has encountered a problem while playing the file."

    The headset works for internet but not DVD.

    I've installed Weatherbug a week ago and had to uninstall other garbage that come with it. I think that's when the problem started.

    Well, I set myself just now. I did a system restore to a point before that I installed Weatherbug, and now everything's fine.

  • Lightroom works only with reduced funktionality. Develop module is not available.  Adobe can not find the license associated with my Adobe why identification code? Every month I pay an amount for PS and LR...

    After the upgrade to Windows 10 Lightroom works only with reduced funktionality. Develop module is not available.  Adobe can not find the license associated with my Adobe why identification code? I bought the license more than 1 year ago. Every month I pay an amount for PS and LR, and for the past 4 months I can't work. Russian support team cannot solve this problem and sent me here.

    Thank you! I reset my password, the problem was in it.

  • DeskJet 722C works only with Windows 7

    OK, so I applied the DJ_Patch as described. (See http://h30434.www3.hp.com/t5/Printer-All-in-One-Software-and/Deskjet-710-720-810-820-100-Series-prin... ) I have Windows 7, 64-bit and a HP Deskjet 722 C printer.  Tried to print the test page, but received the error from the printer.  Tried to add a printer, you are looking for the 722C, but it is not on the list, even tried to do Windows Update to search for my printer.   Tried to restart, which did not work or the other.  Still get error printer.  I appreciate any other suggestions.  BTW, the printer is connected via a USB to parallel port cable.

    My HP Deskjet 722C now works!  I spent several hours trying different things only to find out it was the cable use to connect the printer to our new computer.  He is there not a lot of info on the package of cable but if you watched closely he said it worked only with Win XP, me and Vista.  Who would have thought that the cable wasn't working with some BONE... me!  Once we went and bought a new cable ($40, Ouch!), we were running a few minutes.  I don't know that a cheaper cable is available online.

    I wanted to post this in the hope of saving someone money, time and frustration on the other.

  • Adobe Acrobat dc works only with Microsoft office 2016

    Adobe Acrobat dc works only with Microsoft office 2016

    Hey Nick Villani,

    Desktop stand 2016 for Windows and MAC OS versions of Acrobat DC will be available in the next major update quarterly Acrobat, tentatively scheduled for October.

    Kind regards

    Ana Maria

  • CS6 Production Premium supports AMD graphics cards? Specifically over-pants M6100. If so, all the features work with the M6100, or are there features that work only with nVidia video cards?

    CS6 Production Premium supports AMD graphics cards? Specifically over-pants M6100. If so, all the features work with the M6100, or are there features that work only with nVidia video cards?

    CS6 does support OpenCL and OpenGL?

    Are all features that CS6 supports for NVidia Cuda available for the M6100 OpenCL?

    Bill supposed to first Pro CC (not CS6) response. Windows of Premiere Pro CS6 version does not support OpenCL for accelerating GPU of MPE. Therefore, there is no "opencl_supported_cards.txt" file in the folder of Premiere Pro, and the code to OpenCL is disabled permanently in all versions of Windows from Premiere Pro CS6. So, for your over-pants M6100 Premiere Pro CS6 will be permanently locked to only software MPE mode. (Acceleration GPU of MSES in the Windows of Premiere Pro CS6 version is limited to the CUDA only, which means that only NVIDIA for GPU - no AMD over-pants or GPU Radeon support CUDA at all.)

  • I have the code for an Adobe Creative Cloud, it is alphanumeric, but the registry works only with numeric codes ¿where I can use my code?

    Hi, I have a problem with code for my Adobe Creative cloud, it is alphanumeric, but the registry works only with numeric codes ¿where I can use my code? is a subscription to creative cloud of throughout the year.

    Probably you have a redemption code... especially if you did not purchase directly from Adobe

    Redemption Code http://helpx.adobe.com/x-productkb/global/redemption-code-help.html

    -or https://forums.adobe.com/thread/1572504

  • This calculator works only with round numbers

    I need help,

    This calculator works only with the numbers series, but is this 1.9 * 6 the result is 11.399999999999999 instead of 11.4

    Ware is the problem, can it be resolved?

    Theanks in advace.

    <? XML version = "1.0" encoding = "utf-8"? >

    < mx:Application ' xmlns:mx = ' http://www.Adobe.com/2006/MXML "layout =" " vertical " >

    < mx:Script >

    <! [CDATA]

    private function getTotal():Sub

    {

    var myInt:int = parseInt (input.text);

    var myFloat:Number = parseFloat (input.text);

    var myNumber:Number = new Number (Input.Text);

    var myInt2:int = parseInt (input2.text);

    var myFloat2:Number = parseFloat (input2.text);

    var myNumber2:Number = new Number (INPUT2. (Text);

    total. Data = (myNumber) * (myNumber2);

    }

    []] >

    < / mx:Script >

    < mx:TextInput id=" entry " />

    < mx:TextInput id=" INPUT2 " />

    < mx:TextInput id=" total " />

    < mx:Button " label = ' Button "click ="getTotal ();" />

    < / mx:Application >

    Welcome to the joys of IEEE 754 floating-point arithmetic. For more fun, try ".1 + 1 - 1»

    The simplest answer is probably to limit your result with Number.toFixed (). The answer is not so easy is to write your own class BigDecimal (in Java).

    --
    Maciek Sakrejda
    Truviso, Inc..
    www.truviso.com
    Truviso recruiting: http://www.truviso.com/company-careers.php?i=87

  • Is - this calculation Manager works only with EPMA?

    It seems calculation Manager works only with EPMA for the application of the classic plsnning, I cannot use the module of business rule and cannot use the Manager of computing to work on business rules, is good? correct me and advise, thank you!

    Sorry I disagree

    You can use the calc for classic version 11.1.1.3 planning
    When you create a planning application in 11.1.1.3 classic, you have the option to choose if you use business rules or calc for the app Manager.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • SplashScreen works only on Android only when built with Phonegap Build

    If I build my application locally, the splashscreen works well. However, if I build by Phonegap Build, it is not. In fact, this happens only if I use guidance in the density attribute such as:

    <splash src="resources/android/splash/drawable-land-ldpi-screen.png" density="land-ldpi"/>
    

    or

    <splash src="resources/android/splash/drawable-port-ldpi-screen.png" density="port-ldpi"/>
    

    Remove the parts of 'land -' or '-port' direction makes the splashscreen working again. But why this happens only when compiled by Phonegap Build? How can I treat the different directions this problem?

    I tried to downgrade the splashcreen plugin, change the resources folder names, file names, places, remove some preferences related to the splashscreen, but none worked. I tried Android 5.0 and 6.0 devices. Below is part of my config.xml file:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <widget id="aaa" version="1.1.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
      <name>aaa</name>
      <description>aaa</description>
      <author email="[email protected]" href="https://aaa.com/"></author>
    
      <content src="index.html"/>
      <access origin="*"/>
      <allow-navigation href="*"/>
      <allow-intent href="*"/>
    
      <preference name="permissions" value="none"/>
      <preference name="webviewbounce" value="false"/>
      <preference name="UIWebViewBounce" value="false"/>
      <preference name="DisallowOverscroll" value="true"/>
      <preference name="android-minSdkVersion" value="16"/>
      <preference name="BackupWebStorage" value="none"/>
    
      <!-- Splashscreen config -->
      <preference name="SplashScreen" value="screen"/>
      <preference name="SplashScreenDelay" value="4000"/>
      <preference name="FadeSplashScreenDuration" value="1000"/>
      <preference name="SplashMaintainAspectRatio" value="true"/>
      <preference name="SplashShowOnlyFirstTime" value="false"/>
      <!-- End of splashscreen config -->
    
      <preference name="phonegap-version" value="cli-6.1.0"/>
      <plugin name="cordova-plugin-splashscreen" spec="~3.2.2"/>
      <plugin name="cordova-plugin-inappbrowser" spec="~1.4.0"/>
      <plugin name="cordova-plugin-whitelist" spec="~1.2.2"/>
      <plugin name="cordova-plugin-dialogs" spec="~1.2.1"/>
    
      <feature name="StatusBar">
        <param name="ios-package" value="CDVStatusBar" onload="true"/>
      </feature>
      <platform name="android">
        <icon src="resources/android/icon/drawable-ldpi-icon.png" density="ldpi"/>
        <icon src="resources/android/icon/drawable-mdpi-icon.png" density="mdpi"/>
        <icon src="resources/android/icon/drawable-hdpi-icon.png" density="hdpi"/>
        <icon src="resources/android/icon/drawable-xhdpi-icon.png" density="xhdpi"/>
        <icon src="resources/android/icon/drawable-xxhdpi-icon.png" density="xxhdpi"/>
        <icon src="resources/android/icon/drawable-xxxhdpi-icon.png" density="xxxhdpi"/>
        <splash src="resources/android/splash/drawable-land-ldpi-screen.png" density="land-ldpi"/>
        <splash src="resources/android/splash/drawable-land-mdpi-screen.png" density="land-mdpi"/>
        <splash src="resources/android/splash/drawable-land-hdpi-screen.png" density="land-hdpi"/>
        <splash src="resources/android/splash/drawable-land-xhdpi-screen.png" density="land-xhdpi"/>
        <splash src="resources/android/splash/drawable-land-xxhdpi-screen.png" density="land-xxhdpi"/>
        <splash src="resources/android/splash/drawable-land-xxxhdpi-screen.png" density="land-xxxhdpi"/>
        <splash src="resources/android/splash/drawable-port-ldpi-screen.png" density="port-ldpi"/>
        <splash src="resources/android/splash/drawable-port-mdpi-screen.png" density="port-mdpi"/>
        <splash src="resources/android/splash/drawable-port-hdpi-screen.png" density="port-hdpi"/>
        <splash src="resources/android/splash/drawable-port-xhdpi-screen.png" density="port-xhdpi"/>
        <splash src="resources/android/splash/drawable-port-xxhdpi-screen.png" density="port-xxhdpi"/>
        <splash src="resources/android/splash/drawable-port-xxxhdpi-screen.png" density="port-xxxhdpi"/>
      </platform>
    
      <icon src="resources/android/icon/drawable-xhdpi-icon.png"/>
    </widget>
    

    Maybe your projections are simply not found.

    You can post a screenshot of your zip file directory structure, please?

    Also, if you use any BMP, you need not include an element in your config file.

    Finally, BMP requires your icon by default to the root (with index and config), does not in some resources/.../-directory.

  • LabVIEW 2009 .exe works only with windows 2000

    I created a simple vi with Labview 2009 for resetting a counter in the registry key. I changed it to an exe. The program works well on any machine with XP, but it does not work on the machine, that I need on which is running Windows 2000 SP4. I have installed the runtime of 2009, but I keep getting an error when it starts the vi is not executable and I need the full development to correct errors. But like I said it works everywhere else. I tried other exe wrote in LV2009 on this machine and they work. Is there something in my vi which is not compatible with Windows 2000?

    Thank you

    dkfire wrote:

    If you build an exe on a XP machine, then it will work only on XP.

    You need generate the exe on a Windows 2000 machine to make it work.

    Simply not true - even close to not being not right.

    Chris,

    My guess is that the .NET component is not present on the pc of w2k.

  • How can I sign an application made with PhoneGap Build?

    Hello

    I set up the service of PhoneGap Build and created an account in order to make an application and download it in my cell phone.

    Now I've reached the point where I want to sign it and upload it to Google game.

    I have a developer account and I filled out all the data, do some screenshots and icons and a description for the app, etc.

    When I try to download on Google game it says "Upload failed...". "and I have to disable debugging.

    I tried to find information on how to do it and I installed the SDK package and even with success put in place the path in the settings for PhoneGap Build without any protest...

    Now what?

    I read trhe documentation on how to make a key with keytool using the cmd in windows one private key was transferred on my account on the phonegap construction site.

    Now according to the doc in phonegap to build this key must be used to signing the app I did in dreamweaver. So I recreated the app in Dreamweaver and uploaded and then tried to download Google game.

    Always the same problem that the application is in debug mode. This means that generation gap phone does not work as it should, or maybe that my key does not work.

    So my question is, first of all how can we see if the key is correctly generated with keytool?

    My next step is to manually sign the file app.apk with the jarsigner tool so I tried to do what therefore to the sample in the android documentation.

    This a screenshot of my attempt and the error message in the command line:

    error_jarsigner.png

    It feels like I've done everything by the book, but still my app is not signed and not valid for download on Google game files.

    Please give me a help in the creation of this last stage little but so difficult.

    Thank you!

    Micke

    Post edited by: MickeBergman

    I solved it...

    If someone else made the same mistake that I had then look here.

    Just create the key with the keytool utility using the command line (cmd.exe)

    Here is the how to guide (scroll down to "1." Obtain a suitable private key")

    Use the example, it works very well.

    Then upload it to your PhoneGap Build account by logging in at build.phonegap.com

    Under your account settings, download the yourkey.keystore file, and then unlock it.

    Then under Apps on your downloaded App title to get into the details of the application.

    Then (and this is what I missed and therefore have not signed and published) choose the key that you downloaded in the fold to the bottom of the menu to the right hanbd of the android logo

    Then click on rebuild and when it's done rebuild you just download and there a Yourapplication release added the file name and you are ready!

    Pheeeww it is a terrifying experience and yet so simple solution... Another strange noone has experienced this before me.

    In the end, I really welcome Dreamweaver which is also a great tool to easily make your own applications.

  • DeskJet F4180: F4180 driver works only with Windows 10

    Printer prints all bad, except the dark colors. Turns red magenta, green is dark blue etc.

    Printer worked fine with win xp.

    Test page prints perfectly without error

    Using the prints to photocopy an exact color copy - it's just data coming directly from the computer which is incorrect, so the work of does'nt driver properly with win 10. I checked that I have the latest version of the driver 6.1.7600.16385.

    I have noted this problem has already been spotted upward - when a new driver is available?

    or can anyone suggest a work around.

    Printer I tried with my laptop win10 and the fault has been the same.

    Printer I tried with my old desktop winxp and the rift was healed - perfect impression of a jpeg file.

    Reconnected printer back on my desk win10 and printed on the same jpeg file and printing was perfect!

    Have you tried a few other files that I had problems with and prints are very well - can only be assumed that the problem was down to the usb connector.

    Thanks for the help

    Concerning

Maybe you are looking for

  • HP 15-d054se laptop

    I have a laptop HP 15-d054se and wanted to install an operating system windows 7 32 bit for a large number of applications that I use. the drivers are not available, but can you please list all the drivers for a 32-bit operating system for my laptop.

  • Events in Subvi works does not as expected

    Hi, I'm reposting this question because my previous one did not lead to a satisfactory conclusion. I enclose my Vi which do not work as expected. If I remove a Subvi and its controls of 3 partners and two indicators, it works fine, but when I add two

  • Service of re-installing Softrware

    Hello I help a friend who has a laptop HP running Windows 7. Due to a malware infection, it can run only its Office 2010 Starter Edition because the icons produce errors of click 2 Run Configuration failed. There is no mention of the office in the Pa

  • Am I eligible for the student of cloud Creative price?

    Question 1: I am currently student part-time (8 semester hours) at the Community College of Denver; am I eligible for the student of cloud Creative price?Question 2: If I have student price right now, what happens when I graduate; will be my monthly

  • Create the guide lines on the selected object

    Is there a quick way to create landmarks on a selected text box?Thank youInDesign CC, Windows 7