简体   繁体   English

使用PhoneGap,JQuery Mobile和AngularJS的原生Web应用程序?

[英]Native Web App with PhoneGap, JQuery Mobile and AngularJS?

I would like to develop a advanced web app for android and iOS. 我想为Android和iOS开发一个高级Web应用程序。 I tries some basics with JQuery Mobile and Phonegap and now I am looking for a good structured web application javascript framework. 我尝试使用JQuery Mobile和Phonegap的一些基础知识,现在我正在寻找一个良好的结构化Web应用程序javascript框架。 I found angular JS from google. 我从谷歌找到了角度JS。 Does anybody have experience with these 3 technologies combinated? 有没有人有这三种技术组合的经验? Can this good work together? 这可以很好地协同工作吗?

Thanks for help! 感谢帮助!

Although I haven't played around with PhoneGap too much yet, I have used angularjs in conjunction with Apache Cordova (which powers PhoneGap). 虽然我还没有玩过太多的PhoneGap,但我已经将angularjs与Apache Cordova(为PhoneGap提供动力)结合使用。

Here is a really great article, which helped me to get started: 这是一篇非常好的文章,它帮助我开始:

The Definitive Guide to Angular on Mobile 移动版角度的权威指南

Also, the last few days I've been playing around with Intel's new XDK and it is really helpful for making this type of development a bit less cumbersome (or so it seems so far). 此外,最近几天我一直在使用英特尔的新XDK,这对于使这种类型的开发变得不那么繁琐(或者到目前为止似乎是如此)非常有帮助。

edit 编辑

I've recently been using the Ionic framework and it is fantastic. 我最近一直在使用Ionic框架,这太棒了。 I like it enough that I decided to come back here and add a link to it since it brings Cordova and Angular together perfectly. 我非常喜欢它,所以我决定回到这里并添加一个链接,因为它将Cordova和Angular完美结合在一起。

Ionic Framework 离子框架

I would start with this example that uses phonegap, angularjs and topcoat: 我将从这个使用phonegap,angularjs和topcoat的例子开始:

http://coenraets.org/blog/2013/11/sample-mobile-application-with-angularjs/ http://coenraets.org/blog/2013/11/sample-mobile-application-with-angularjs/

I know this question was asked sometime back, just answering as this could help anyone bumping into this thread. 我知道这个问题有时会被问到,只是回答,因为这可以帮助任何人碰到这个线程。

Your life would be much easier if you use http://ionicframework.com/ . 如果你使用http://ionicframework.com/,你的生活会更容易。 It's still in its early stages. 它还处于早期阶段。 But it nicely gel in with Cordova and AngularJS and allows you to build apps fast. 但它很好地融入了Cordova和AngularJS,并允许您快速构建应用程序。 This also provides bootstrap like predefined css, and you can play with its SASS mixins and build your app according to your branding. 这也提供了类似预定义css的引导程序,您可以使用其SASS mixins并根据您的品牌构建您的应用程序。

Personally, I would stay away from jQuery Mobile. 就个人而言,我会远离jQuery Mobile。 Just too heavy for my linking 对我的链接来说太沉重了

First let me tell you that this is a mistake, a very big one. 首先让我告诉你,这是一个错误,一个非常大的错误。

First jQuery Mobile was never made with MVC in mind. 首先,jQuery Mobile从未考虑过MVC。 I'm talking about MVC because AngularJS uses MV-Whatever pattern. 我在谈论MVC,因为AngularJS使用MV-Whatever模式。

jQuery Mobile has its own routing solution (page handling) and it will not work if any other MVC frameworks is used (BackboneJS or AngularJS). jQuery Mobile有自己的路由解决方案(页面处理),如果使用任何其他MVC框架(BackboneJS或AngularJS),它将无法工作。 You can turn jQuery Mobile routing (you will need to turn AJAX page handling) but then you will loose page transitions. 您可以转换jQuery Mobile路由(您需要转换AJAX页面处理),但随后您将失去页面转换。

If you want something similar you should check Kendo UI . 如果你想要类似的东西,你应该检查Kendo UI It is a commercial product, but it has a non-commercial version which is way better then jQuery Mobile. 它是一个商业产品,但它有一个非商业版本,比jQuery Mobile更好。 It is similar to jQuery Mobile but much faster. 它类似于jQuery Mobile,但更快。 It has a built in MVC support or you can use it with AngularJS (if you prefer it). 它具有内置的MVC支持,或者您可以将它与AngularJS一起使用(如果您愿意的话)。

Or you can abandon jQuery based frameworks all together and choose AngularJS frameworks instead. 或者你可以放弃基于jQuery的框架,而是选择AngularJS框架。 Before you do anything you need to consider what do you want to do: 在你做任何事之前,你需要考虑你想做什么:

  1. What do you want to create; 你想创造什么; mobile site or hybrid mobile application? 移动网站或混合移动应用程序?
  2. What do you prefer as a core technology (for example: AngularJS, jQuery, vanilla JavaScript) 您更喜欢什么作为核心技术(例如:AngularJS,jQuery,vanilla JavaScript)

If you are trying to build a mobile website then AngularUI or AngularStrap are good choices. 如果您正在尝试构建移动网站,那么AngularUI或AngularStrap是不错的选择。 No matter which one you decide to use it will be a mix of two beloved and heavily used frameworks: AngularJS and Bootstrap 无论你决定使用哪一个,它都会混合使用两个心爱的框架:AngularJS和Bootstrap

Just be careful, AngularJS is not jQuery, it is not something you can learn properly in few days. 请注意,AngularJS不是jQuery,它不是你几天内可以正确学习的东西。 If you never worked with it, spend some time learning basics. 如果你从未使用它,花点时间学习基础知识。

On the other hand, if you are working on hybrid mobile application you should go the other way. 另一方面,如果您正在使用混合移动应用程序,则应该采用其他方式。 You will need to use frameworks specially made for hybrid mobile development. 您将需要使用专为混合移动开发而设计的框架。 Currently, two best-known frameworks are Ionic Framework and Onsen UI. 目前,两个最着名的框架是Ionic Framework和Onsen UI。

They are similar in nature, basically you will need to decide which one is best suited for you, read more about them here: Ionic vs OnsenUI 它们本质上是相似的,基本上你需要决定哪一个最适合你,在这里阅读更多关于它们: Ionic vs OnsenUI

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM