Difference between webvm and Gears APIs
Gears maintains a centralised list of APIs, that utilised via a Gears.factory.
WebVM hopes to differentiate here by allowing 3rd parties to become API vendors.
Aplix WebVM developers want to spend less time writing APIs and more time focussing on the plugin and difficult security bindings. It’s very difficult to compete with the quality of Gears project APIs, so instead we encourage you to develop the APIs instead with the SDK.
Although Gears is an opensource project, their barrier to contribution to gears-eng is actually quite high.
- You need to be a very good C++ coder

- Your contribution needs to be BSD licensed
- Your API will come under Gears, not ‘Your Company Inc.’
- Your API needs to have a high appeal in order to be considered for inclusion into the Gears product
- Your API will probably take quite time long to be in a Gears product (deployment)
Say as example.com you have a particular API you need for your product to function. You could write your own NPAPI and ActiveX plugin (for IE), however:
- Writing an NPAPI or ActiveX plugin is very difficult
- How do you get it installed on millions of mobile devices? (deployment!)
- Oh, you also need to write some security functionality to appease stakeholders like operators
With WebVM’s ‘dynamically loaded’ native C and Java interfaces:
- Writing a browser plugin with webvm.h is much easier (a fraction of the cost)
- Deployment happens dynamically by URL e.g.
webvm.load("http://example.com/yourAPI") - You leverage our security model
Since Gears is BSD licensed you could port their C++ code to WebVM as C (or Java) APIs. For e.g. Gears Camera API could be loaded like:
`webvm.load("http://example.com/gears/camera")`
WebVM also differs from Gears with a:
- Fine grained security management to appease operators (BONDI)
- The JBlend JavaVM hookup which means that porting WebVM to older legacy mobile devices should be more readily possible. There are roughly 754 (Dec ‘07) JBlend device ports already that Gears will have a hard to catch up with.
Gears recently has JNI support with Android.
More about Gears
Note as of June 2008, it’s Gears not google-gears.
- Follow the -eng mailing list
- Issue tracker
-
svn co http://google-gears.googlecode.com/svn/trunk/ export BROWSER=NPAPI make
NPAPI support currently is still not there. I am interested on how they package up the plugin with Localized.r and that other crap seemingly required by Darwin.
Security permissions
Drafted for 0.3 in their API history.
boolean getPermission([siteName], [imageUrl], [extraMessage])
Security dialogs or dialogues
Older:
Gears as a Web testing framework
Trouble with tests like
sunspider that use
Javascript to sequentially load in tests (as HTML files in their own right) is
that can be difficult to catch errors with onerror.
The Sunspider test driver works well as the tests are performance tests that are known to work. If the test fails and Javascript stops executing, you could have a simple workaround with a button onclick to proceed to the next test. There is also several very elaborate inter-frame communication and fragile mechanisms (heartbeat) you can use.
live dom viewer works well, though I am not sure how to modify for individual tests.
Gears test seems to workaround this by using in their harness their own inbuilt httprequest & timer functions.
Converting Google’s test framework to npsimple involved:
- Disregarding the Python stuff.
- Creating a CGI to log POST results published by results_publisher.js
- Adding in the loader/init
Fixing a few paths, like
config.js:var basicSuite = new TestSuite(‘Basic’); basicSuite.addFile(‘../myowncases/foo_tests.js’, {useWorker: false, useIFrame: true});
foo_tests.js looks like:
function testFoo() {
assertEqual(42, foo.scriptSimple());
}
The published JSON results look like:
{"gears_info":"0.4.20.0;official;opt;linux;firefox","browser_info":"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071618 Iceweasel/3.0.1 (Debian-3.0.1-1)","url":"http://gears.webvm.net/test.cgi","results":[{"suitename":"Basic","filename":"../webvmcases/foo_tests.js","results":{"testFooToo":{"status":"passed","elapsed":0},"testFoo":{"status":"passed","elapsed":0}},"elapsed":0.13899993896484375}]}




