使用javascript构建本机应用程序的最佳方式? [英] Best way to build native applications with javascript?

查看:133
本文介绍了使用javascript构建本机应用程序的最佳方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用phonegap玩了一会儿,
在我的机器上做了一些测试...



这很不错。



我的问题是:

使用Web客户端(html \javascript\css)开发本机移动应用程序的最好的(您最喜欢的)框架是什么?



在多平台(iOS \Android\BlackBerry)中并行构建和维护这些应用程序有多容易?
在不同平台之间有很多异常(iOS \Android\BlackBerry)?



为iOS开发我的应用程序有什么要求?
我应该需要一个特殊的IDE和特殊的SDK?我必须有mac?



非常感谢:]

解决方案

使用 React Native 的本机iOS应用程式。



优点:




  • React将DOM视为实现细节。这使得过渡到本机UI非常自然。在编写本机应用程序时,它也不再需要HTML / CSS。所有你需要的是用JavaScript编写的本地组件。

  • 本地组件!基本的本地组件已经被桥接到JavaScript,并且有一个社区忙于工作,把一切都结束。事情是,如果你知道或愿意学习一些Objective C或Java,有一个 easy process to add any native module(or third-party module)to React Native。

  • 快速迭代。

  • 您将获得正常React的所有优点:虚拟视图图层,差异化,声明式UI创建

  • 您可以从同一个存储库构建多个平台,重用大部分相同的代码库(大多数是应用程序逻辑)。



缺点:




  • 有一些功能需要jimmy-rigging,第三方库或自定义的Objective-C / Java才能正常工作。

  • 一些很好的第三方库DOM或浏览器API仍然不能在React Native上工作,包括React Router。

  • 最大的痛苦与XCode和Apple的开发程序有关,但是没有办法解决
  • $

    b
    $ b

    React Native for Android是在2015年9月14日开源的。我还没有使用它,但这里是我迄今为止学到的。 更新10/21/16: Windows通用平台的React Native已于今年早些时候公布。这意味着你现在可以使用React Native为Windows桌面,Windows手机甚至Xbox!构建应用程序。



    React Native不是 写一次,运行在任何地方心态。他们采取学习一次,写任何范式。 iOS是一个与Android非常不同的平台,所以真诚的努力需要投入到任一平台的设计。原生API也会有所不同。



    因此,你最终会为本地组件和API重新编写代码。但是,您的许多应用程序逻辑可以重用。实际上,React-Native是组织起来的,因此您可以将Android和iOS应用程序保存在同一个存储库中,以便在可能时重复使用相同的代码。我认为它是辉煌,但只有时间会告诉。 根据他们,它的工作到目前为止。



    顺便说一下,Facebook上的一个小组使用React Native构建了一个iOS应用,然后在三个月内使用87%的相同代码库翻转并构建Android版本。



    为iOS开发我的应用程序有哪些要求? / em>



    目前,您需要一个Mac和XCode才能部署。目前有很少的方法。根据此问题和Slack上的对话,一旦部署,您就可以开发从Windows或Linux机器。 Facebook还正在开源开发所有的 Nuclide 软件包,根据他们在F8的演示,将包括无需XCode打包和构建的工具。



    总体来说,React Native已经是一个辉煌的经验。这是,在我看来,头和肩膀以上任何东西当前在那里。社区的感觉也很积极。我只能假设它会随着时间而变得更好。


    I've been playing for a while with phonegap, did some tests on my android...

    It's pretty nice.

    My questions are:
    What is the best(your favorite) framework to develop native mobile applications with web client side(html\javascript\css)?

    How easy is to build and maintain those applications in multi-platforms(iOS\Android\BlackBerry) parallel? Does it has many exceptions between different platforms(iOS\Android\BlackBerry) ?

    What are the requirements to develop my app for iOS ? should I need a special IDE with special SDK ? I must have mac ?

    Many thanks :]

    解决方案

    We're currently building a native iOS application using React Native. It would be a shame if it wasn't included here.

    Pros:

    • React treats the DOM as an implementation detail. This made the transition over to native UI very natural. It also removes the need for HTML/CSS when writing a native app. All you need is native components, written in JavaScript.
    • Native components! The fundamental native components have already been bridged over to JavaScript, and there is a community busy at work bringing everything else over. The thing is, if you know or are willing to learn some Objective C or Java, there is an easy process to add any native module (or third-party module) to React Native.
    • Quick iteration. There have been over 2600 commits to the master branch since it was open-sourced in March.
    • You get all of the benefits of normal React: a virtual view layer, diffing, declarative UI creation, fantastic developer experience, and a stellar community.
    • You can build for multiple platforms from the same repository, reusing much of the same codebase (application logic, mostly).

    Cons:

    • It's still young. There are a few features that require jimmy-rigging, a third-party library, or custom Objective-C/Java to get working.
    • Some great third-party libraries that are tied to the DOM or Browser API still don't work on React Native, including React Router.
    • The biggest pains have had to do with XCode and Apple's developer program, but there's no way to get around that.

    How easy is to build and maintain those applications in multi-platforms?

    React Native for Android was open-sourced on September 14th, 2015. I haven't used it yet, but here's what I've been able to learn so far. Update 10/21/16: React Native for the Windows Universal Platform was announced earlier this year. That means you can now use React Native to build apps for Windows desktop, Windows phones, and even Xbox!

    React Native is not intended to be a write once, run anywhere mentality. They adopt a learn once, write anywhere paradigm instead. iOS is a very different platform than Android, so sincere effort needs to be put into the design for either platform. The native APIs will also be different.

    So, you will end up re-writing code for native components and APIs. However, much of your application logic can be re-used. In fact, React-Native is organized so that you can keep both your Android and iOS applications in the same repository, so that you can re-use the same code when possible. I think it's brilliant, but only time will tell. According to them, it works well so far.

    By the way, a team at Facebook built an iOS app using React Native, then turned around and built the Android version in three months using 87% of the same code base.

    What are the requirements to develop my app for iOS?

    Currently, you need a Mac and XCode in order to deploy. Currently there are very few ways around this. According to this issue and from conversations on Slack, once deployed, you can actually develop from a Windows or Linux machine. Facebook is also working on open-sourcing all of their Nuclide packages, which, according to their presentation at F8, will include tools to package and build without XCode.

    Overall, React Native has been a stellar experience. It is, in my opinion, head and shoulders above anything else currently out there. The feeling within the community is also very positive. I can only assume it will get better with time.

    这篇关于使用javascript构建本机应用程序的最佳方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆