[jbosstools-issues] [JBoss JIRA] (TOOLSDOC-412) NeedInfo: How do Hybrid Mobile Tools and CordovaSim work?

Michelle Murray (JIRA) jira-events at lists.jboss.org
Fri Nov 8 01:16:04 EST 2013


    [ https://issues.jboss.org/browse/TOOLSDOC-412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12921628#comment-12921628 ] 

Michelle Murray commented on TOOLSDOC-412:
------------------------------------------

I wrote:
{quote}
I am trying to understand which bits of CordovaSim are unique so that I can document them.
I know it uses BrowserSim (jboss) and Ripple (apache). Does CordovaSim literally just launch these two or is there any thing specific that we have done to Ripple that makes it different from what is available elsewhere? I know very little about Ripple so am finding it hard to know the answer to my question.
{quote}

Max wrote:
{quote}
Basically cordovasim bundles ripple with browersim so you can use ripple directly from/on browsersim.
If not, you would have to use your browser, manually configure it and you would loose things like our skins and the option for easy launching it from eclipse.
Thus it is primarily to make it easier to use, no fuzz - it just works.
On top we do add a few fixes/features that are not in ripple or at least not yet - but that is somethin Yahor and co. can provide better details about than me ;)
{quote}

Ilya wrote:
{quote}
In general your understanding of the CordovaSim is right - it is based on  Ripple (https://github.com/apache/incubator-ripple ) and uses BrowserSim for displaying the result of emulation. However there are several fundamental differences between CordovaSim and Ripple:
1.       Ripple uses iframe to display the result of emulation / CordovaSim uses BrowserSim for it
2.       Ripple supports cordova 1.0.x and cordova 2.0.x (there is no cordova 3.0.x support yet but the apache team is working on it) / CordovaSim also supports cordova 3.0.x 
3.       Phonegap API consists of core API ( http://docs.phonegap.com/en/3.1.0/index.html ) + custom plugins. You can read about it in the following article http://phonegap.com/blog/2013/07/19/adobe-phonegap-3.0-released/ . Ripple supports only core API, whereas CordovaSim can handler core API + custom plugins. By now CordovaSim handles BarcodeScanner plugin (https://build.phonegap.com/plugins/261 ) and is about to support ChildBrowserPlugin (https://build.phonegap.com/plugins/2 ). Probably, in the next releases the list of the supported plugins will be stretched
4.       Ripple needs cordova.js file in the project / CordovaSim doesn't need it. If there is cordova.js in the project, CordovaSim will use it. If there is no, CordovaSim will handle it by hosting the latest version of cordova.js (now 3.1.0). It's utterly important for the hybrid projects, cause there is no cordova.js before build. So, CordovaSim supports hybrid and android (hybrid projects that were built for the android platform) projects.
5.       Both CordovaSim  and Ripple can’t  handle the following core API : “File” ( http://docs.phonegap.com/en/3.0.0/cordova_file_file.md.html#File ); “Capture” ( http://docs.phonegap.com/en/3.0.0/cordova_media_capture_capture.md.html#Capture ) captureAudio and captureVideo methods are not supported; CordovaSim can handle captureImage method, whiles Ripple can’t; “inAppBrowser” ( http://docs.phonegap.com/en/3.0.0/cordova_inappbrowser_inappbrowser.md.html#InAppBrowser )  - we are about to release it.  
6.       Ripple uses node.js to host projects / CordovaSim uses jetty server  
7.       Ripple was originally implemented as a Chrome Extension. So, Some CordovaSim features  were reimplemented due to Safari limitations. For instance, “Camera” and “Capture” API  have servlet based back-end implementation and “inAppBrowser” is implemented via browserFunction (org.eclipse.swt.browser.BrowserFunction) and SWT Browser widget
{quote}

I wrote:
{quote}
A couple of follow-up questions to Ilya's great detailed response on the differences between CordovaSim and Ripple.
1. "If there is cordova.js in the project, CordovaSim will use it. If there is no, CordovaSim will handle it by hosting the latest version of cordova.js (now 3.1.0). So, CordovaSim supports hybrid and android (hybrid projects that were built for the android platform) projects." Does CordovaSim also support Cordova-enabled iOS projects? I think the answer is no, but why? Is this because Ripple couldn't? Is it based on iOS project structure?
2. "Ripple uses node.js to host projects / CordovaSim uses jetty server " Does this make any difference from a user's perspective? Does CordovaSim's use of jetty server enable users to do things that they couldn't do with Ripple because of its use of node.js?
3. "Ripple was originally implemented as a Chrome Extension. Some CordovaSim features were reimplemented due to Safari limitations." Is this a consequence of BrowserSim using WebKit? As in BrowserSim uses WebKit/Safari so some Ripple features had to be redesigned to work well with WebKit/Safari?
{quote}

Ilya wrote:
{quote}
1.     Does CordovaSim also support Cordova-enabled iOS projects? The problem is that you can’t develop/import IOS projects via Eclipse (JBoss Studio).  AFAIK there is only one IDE you can develop applications for the iPhone / iPad, and that is Xcode IDE (only for OSX machines).
2.     Ripple uses node.js to host projects / CordovaSim uses jetty server . Does this make any difference from a user's perspective? Well, I think there is no difference from a user perspective. However, ripple can be installed via npm (“npm install ripple-emulator”).  After installation user is able to run ripple from console ( ripple emulate --path to/my/app) . In case of CordovaSim, user gets emulator out of the box,  and doesn’t care about stuff like installing node and npm.
3.     As in BrowserSim uses WebKit/Safari so some Ripple features had to be redesigned to work well with WebKit/Safari? Yep, that’s right. The last version of Safari for Windows is 5.1.7, which is pretty old (May 9, 2012). Many features that available in Chrome simply can’t be handled in Safari . I can give you for instance -  ( http://jsfiddle.net/Jyykf/6/  - this is actually how “Camera” API works in Ripple) . This snippet won’t work in Safari because of “window.webkitURL.createObjectURL” method, which is simply not supported.
{quote}

In response to Burr, Ilya wrote:
{quote}
1.      *CordovaSim should work with a Cordova-based app that targets both iOS and Android or have I mistaken something?* You are right. The main purpose of the CordovaSim is handling hybrid applications (Hybrid Mobile Tools). However, you can also create hybrid project from the command line (“cordova create myApp”), and build it for the android platform  (“cordova build android”). Now, If you have ADT installed you can import that project to Eclipse (JbossStudio) and run that project with CordovaSim. But the point is that if you build your hybrid project for the ios platform (“cordova build ios”), you won’t be able to import that project to the Eclipse , cause there is only one IDE for ios development - Xcode.  
2.      *Do we have a listing of Cordova APIs/capabilities that do not work on Windows like the Camera api mentioned?* Burr, you misunderstand my explanation. CordovaSim can handle “Camera API” on all platforms. But because of the Safari limitations we had to reimplement that feature. “Camera” API has servlet based back-end implementation in the CordovaSim and has nothing in common with Ripple implementation.  I’ve mentioned the list of unsupported features in one of the previous letters. I will forward it to you ;-)  
{quote}
                
> NeedInfo: How do Hybrid Mobile Tools and CordovaSim work?
> ---------------------------------------------------------
>
>                 Key: TOOLSDOC-412
>                 URL: https://issues.jboss.org/browse/TOOLSDOC-412
>             Project: Documentation for JBoss Tools and Developer Studio
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>          Components: User Guide - CordovaSim, User Guide - Hybrid Mobile Tools
>    Affects Versions: 4.1.1
>            Reporter: Michelle Murray
>            Assignee: Michelle Murray
>             Fix For: 4.1.1
>
>
> A JIRA in which to discuss how Hybrid Mobile Tools and CordovaSim work. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the jbosstools-issues mailing list