Ripple Emulator + android project using PhoneGap

I am creating an Android project using PhoneGap in the Eclipse IDE.

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

I installed the extension in my Google Chrome and enabled the "Allow access to files" option.

When I open my index.html page, I get a javascript popup like this: enter image description here

If I click OK or Cancel, the page just freezes, so I can’t turn on the mountain ash 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 know why I am getting this popup?

+4
source share
5 answers

I ran into the same call and found that if you continue to delete Cancel (or esc key) in these prompts, the ripples will load and work fine. Pressing Ok (instead of canceling) seems to make it freeze ...

+2
source

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

+7
source

I had the same problem and deleting this line

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

from index.html fixed it

+3
source

I used the instructions on this page and again got a ripple. Apparently, the Chrome extension did not sync with PhoneGap / Cordova for a while. The ripple project has moved to Apache and currently no longer works as a plugin, but rather as a command line server.

Please note that when you run ripple emulate it serves from www dir in PROJECT_ROOT/platforms , not www immediately in PROJECT_ROOT, so if you edit the latter, you will need to run phonegap build your_platform first. This is a bit inconvenient when working with the IDE, but still much better than the lack of local testing.

+1
source

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

I don’t know much Ripple, but it seems that the thin JS / CSS cover mimics mobile phones and tablet screens. On the other hand, PhoneGap is a bridge to allow access to specific functions of a mobile device (SMS, camera, gps, etc.) From JS. And this allows you to create applications that rely on JS ↔ Java (android), JS ↔ ObjectiveC, etc. Link, with HTML5 + JS pages that use additional functionality.

What you probably did was including the cordova.js file from the android / ios / blackberry platform and launching it without built-in platform support (that is, in the PC / MAC browser).

For the layout, when testing the UI itp, you probably want to remove cordova.js and not call the handset / cord in the browser.

PS. Ripple claims to support PhoneGap, and I will definitely learn it. Perhaps they have a cordova-www.js plugin that supports firefox / safari / lynx on every PC and Mac;)

0
source

Source: https://habr.com/ru/post/1500198/


All Articles