Question

I'm creating an android project with PhoneGap in the Eclipse IDE.

Now I want to use the Ripple Emulator instead of the Android Virtual Device Manager (AVD) because the AVD is very slow.

I installed the extension in my Google Chrome and enabled the 'Allow access to file URLs' option.

When I open my index.html page I get a javascript pop-up like this: enter image description here

If I click "OK" or "Cancel" the page just freezes so I can't enable the ripple emulator ... .

This is my "index.html" file:

<!DOCTYPE HTML>
<html>
 <head>
  <title>PhoneGap Testing</title>
  <meta http-equiv="Content-type" content="text/html;charset=utf-8">
  <meta name="viewport" id="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
  <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
  <script type="text/javascript" charset="utf-8">
    function onBodyLoad(){
        document.addEventListener("deviceready", onDeviceReady, false);
    }
    function onDeviceReady(){
        navigator.notification.alert("PhoneGap is ready!");
    }
  </script>
 </head>
 <body onload="onBodyLoad()">
    <h1>Hello PhoneGap</h1>
    <p>This is a sample app</p>
 </body>
</html>

Does anyone knows why I get this pop-up?

Was it helpful?

Solution 3

I ran into the same challenge, and found that if you keep hitting Cancel (or esc key) on these prompts, ripple will actually load, and work just fine. Hitting Ok (instead of cancel) seems to make it hang...

OTHER TIPS

Uninstall the Chrome extension (it is no longer needed).

I had the same problem and removing this line

<script type="text/javascript" charset="utf-8" src="cordova.js"></script>

from index.html fixed it

I used instruction on this page and got ripple working again. Apparently the Chrome extension has been out of sync with PhoneGap/Cordova for a while. The ripple project has moved to Apache and currently does not work as a plugin any more but rather as a command line server.

Note that when you run ripple emulate it serves from the www dir in PROJECT_ROOT/platforms and not the www immediately under PROJECT_ROOT, so you if you edit the latter, you'd have to run phonegap build your_platform first. That's a bit inconvenient when working with an IDE but still much better than having no local testing facility.

In short: there is no [phonegap/cordova]-[firefox/lynx/www] backend. (is there?)

I don't know Ripple too much, but it seems like a thin JS/CSS wrapper to "simulate" mobiles and tablet screens. PhoneGap, on the other hand, is a brigde to allow access to specific mobile device features (sms, camera, gps etc) from JS. And it allows for building apps that rely on JS<->Java (android), JS<->ObjectiveC etc communication, beeing HTML5+JS pages that use the extra functionality.

What you probably did is including cordova.js file from android/ios/blackberry platform and running it without native support of THE platform (that is in PC/MAC browser).

For layout, testing UI itp you would probably want to remove the cordova.js and not call any phonegap/cordova while in the browser.

PS. Ripple states it supports PhoneGap, and I will definitely look into it. Maybe they do have the cordova-www.js plugin that supports firefox/safari/lynx on every PC&Mac ;)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top