Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
266 views
in Technique[技术] by (71.8m points)

javascript - Reasons for porting a Cordova App to a Mobile Chrome App?

We got a Cordova App running and wrote ourselves a build script using Grunt which makes building the App a breeze. We don't require any of the APIs Chrome offers and are, apart from some performance issues with elderly Android devices which forced us to block some minor features on those devices, pretty much satisfied with the current status of our app.

So far we couldn't find any reason why it would make sense to transform our Cordova App into a Mobile Chrome App. Or is there something we're missing? Are there any differences in terms of JS speed, CSS support, etc.?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The primary motivation for Chrome Apps on Mobile leveraging Apache Cordova was to bring Desktop Chrome Apps to Android and iOS.

However, there are some reasons why you should/shouldn't consider using the cca toolkit, particularly if you already enjoy using cordova:

Chrome Apps APIs

If you wish to leverage some of the useful Chrome Apps APIs which we have ported to mobile, you may already be able to use them inside your vanilla cordova app, even without using our cca toolkit! (We went out of our way to try and make this work whenever possible, giving back to the community that helps us in turn).

However, for some of the APIs, you really do need to use our cca toolkit, since we may rely on the chrome app lifecycle or other specifics. (It seems our docs don't yet make this distinction clear, so I've filed an issue to address that).

Verdict: consider cca if one of the Chrome Apps API's which do not work on vanilla cordova appeal to you.

Desktop Platform

Chrome Packaged Apps run on any desktop platform chrome runs on -- which is every single mainstream Operating System in popular use today. The capabilities and native integration of these apps are rapidly improving, and are truly removing barriers to using web technologies for whole ranges of application types.

So, while the motivation for Chrome Apps on Mobile was to enable porting some of those desktop apps to mobile, you should consider if the reverse isn't actually useful for you!

This would mean adjusting your existing app to use the chrome app lifecycle and manifest, adhere to restrictions like CSP and disabled web features, and cannot rely on cordova extensions -- but in practice this is often not prohibitive for a cordova app which is already a package offline-enabled web application (thats the hard part)!

Verdict: consider cca if you would also like to also target the desktop platform, or would like to submit your app to the chrome web store.

Cordova Plugins

If your existing mobile app already leverages some cordova plugins, you can still use the cca tool, since we create a fully compatible cordova project. This comes with the caveat that those plugins will only be available on mobile -- but you can use feature detection for desktop-mobile app compatibility.

Verdict: the cca tool does not prohibit the use of cordova plugins.

Mobile Platforms that are not Android or iOS

We do not currently support some of the platforms which vanilla cordova does, such as BlackBerry, Windows Phone, or upcoming platforms like FirefoxOS, Tizen, and Ubuntu (though many of those do not yet have feature parity with Android / iOS anyway).

Verdict: don't use cca if one of these mobile platforms is important to you.

Final Words

If you are already happy with what you have, well, they say that if it aint broke, perhaps don't fix it!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...