跨平台移动应用开发框架_为您的下一个项目选择正确的移动应用程序开发框架

news/2024/11/24 7:30:25/

跨平台移动应用开发框架

开始之前 (Before We Get Started)

本文适用于谁? (Who is this article for?)

So you have a cool idea, a new project you want to start, but you don’t know what framework would be best for your needs and the resources you have at your disposal.

因此,您有一个很不错的主意,想开始一个新项目,但是您不知道哪种框架最适合您的需求和可用的资源。

You may be:

你可能会:

  • a beginner who wants to learn mobile application development.

    想学习移动应用程序开发的初学者。
  • a developer using one mobile application development framework who wants to try a different one.

    使用一种移动应用程序开发框架的开发人员想要尝试另一种。
  • a team member on a project who needs help directing this new project.

    需要指导该新项目的团队成员。

This article will help all of you!

本文将为大家提供帮助!

单挑 (A heads-up)

There are other frameworks out there, like Xamarin and ionic, which are not as popular and new as Flutter, React Native and Native apps, so I will not be covering them.

还有其他框架,例如Xamarin和ionic,它们并不像Flutter,React Native和Native应用程序那样流行和新颖,因此我将不介绍它们。

Also, another big reason is that I have no experience with those frameworks and I’m here to share what I’ve learned from three years of experience in mobile application development.

另外,另一个重要原因是,我对这些框架没有任何经验,我在这里分享我从三年的移动应用程序开发经验中学到的知识。

Image for post

混合还是本机应用程序? (Hybrid or Native Apps?)

The short answer would be to use native apps, always (if feasible).

简短的答案是始终(如果可行)使用本机应用程序。

好的 (The good)

Nothing can beat the performance of a native Android and a native iOS application. Nothing can beat the level of control you have over the phone with native applications.

没有任何东西可以击败原生Android和原生iOS应用程序的性能。 没有什么能超过您对本机应用程序对电话的控制水平。

Facebook, the creators of the React/React Native Framework, rewrote their whole messenger app in the native application from a React native app, because it beats the power of a native app. Read more about this here:

作为React / React Native Framework的创建者,Facebook从React本机应用程序重写了其整个Messenger应用程序在本机应用程序中,因为它具有本机应用程序的强大功能。 在这里有关此的内容:

You’ll always be able to easily add complex new features to your native application and performance will be top-notch.

您将始终能够轻松地向本机应用程序添加复杂的新功能,并且性能将是一流的。

It has a very mature community. Its development has been going on for a long time and it has evolved and improved. Over the years it has become more powerful and efficient — so you can be sure that no other mobile framework will come along and kill native apps.

它有一个非常成熟的社区。 它的发展已经进行了很长时间,并且已经发展和完善。 多年来,它变得更加强大和高效-因此,您可以确定不会出现其他移动框架并杀死本地应用程序。

不好 (The bad)

1. The biggest downside to native apps are the skills/resources required. Because of this, it will cost you a lot more than a hybrid platform.

1.本机应用程序的最大缺点是所需的技能/资源。 因此,与混合平台相比,它将花费更多。

You need to learn Kotlin/Java for Android Application Development and Swift/Objective-C for iOS application development. You also need a Mac machine to build the iOS application. This is one of the reasons why so many self-taught developers start with Android over iOS — they don’t have access to a mac.

您需要学习Android应用程序开发的Kotlin / Java和iOS应用程序开发的Swift / Objective-C。 您还需要一台Mac机器来构建iOS应用程序。 这就是为什么这么多自学成才的开发人员从iOS开始使用Android的原因之一-他们无权访问Mac。

So, you need more developers and resources to build and maintain the application for both Android and iOS.

因此,您需要更多的开发人员和资源来构建和维护适用于Android和iOS的应用程序。

2. Also, if you need to extend your application to web or desktop in the future, you would need to hire or learn skills for them separately — the existing codebase won’t help at all in targeting these platforms.

2.此外,如果将来需要将应用程序扩展到Web或台式机,则需要分别雇用或学习它们的技能-现有的代码库根本无法帮助定位这些平台。

3. Lower developer productivity. It will take developers longer to achieve the same requirement for just their particular platforms they are working on as compared to the hybrid platforms. Hence, if you want to prototype faster and hit the market more quickly, native apps will take far more effort than hybrid applications.

3.降低开发人员生产力。 与混合平台相比,开发人员只需要花费较长的时间就可以对他们正在使用的特定平台实现相同的要求。 因此,如果您想更快地制作原型并更快进入市场,则本机应用程序将比混合应用程序花费更多的精力。

Don’t even ask how much developer time it takes to build and run the native application at the time of development. In some places, the devs do have the bad habit of running the app more frequently, which leads to further loss of productivity.

甚至不问开发人员在开发时构建和运行本机应用程序需要花费多少开发人员时间。 在某些地方,开发人员确实习惯于更频繁地运行该应用程序,这导致生产力进一步下降。

Don’t even get me started on fixing those weird Gradle errors that come-in Android from time to time. They have improved a lot over the years but still, they are miles behind the build time for frameworks like Flutter and RN.

甚至不让我开始解决不时出现在Android中的怪异Gradle错误。 多年来,它们已经有所改进,但仍然比Flutter和RN等框架的构建时间晚了几英里。

如何在混合和本机之间进行选择 (How to choose between Hybrid and Native)

  • Understand the requirements: If your mobile app has complex features that require you to access the smartphone’s full potential and capabilities then you will, in any case, have to go for a native app, just to be on the safe side.

    了解要求:如果您的移动应用程序具有复杂的功能,需要您充分利用智能手机的全部潜能和功能,那么在任何情况下,为了安全起见,您都必须选择本机应用程序。

  • Understand the constraints: If you have enough Android and iOS developers/resources, enough time, and budget at your disposal then you can always go for the native app.

    了解限制:如果您有足够的Android和iOS开发人员/资源,足够的时间和可支配的预算,那么您始终可以使用本机应用程序。

  • If you can afford to focus on only one platform to begin with, taking on another platform in the future, then also you can go with native apps.

    如果您可以只专注于一个平台,以后再使用另一个平台,那么您也可以使用本机应用程序。
  • If your app is simpler — focused on getting and displaying data from different sources, taking user inputs, and things like that (a data-driven app) — then look into the option of hybrid applications. You could save a lot of time and money.

    如果您的应用程序更简单-专注于从不同来源获取和显示数据,获取用户输入以及类似的东西(一个数据驱动的应用程序),则可以考虑使用混合应用程序。 您可以节省很多时间和金钱。
  • In short, native apps are always going to cost you more time and money. But the capabilities, confidence, and flexibility they offer to make your project scalable in the long run make the investment worth it.

    简而言之,本机应用程序总是会花费您更多的时间和金钱。 但是它们提供的功能,信心和灵活性使您的项目从长远来看可扩展 使投资值得。

So, if you know there’s a complex feature that you have to build, or if native application development is feasible even for your simple projects and you want to enjoy the power and scalability, then go with native application development.

因此,如果您知道必须构建一个复杂的功能,或者即使对于简单项目也可以进行本机应用程序开发,并且希望享受强大的功能和可伸缩性,则可以进行本机应用程序开发。

If you’re still reading then you’re still not satisfied with native application development and want to explore and understand Hybrid applications. So let’s look at our final question.

如果您仍在阅读,那么您仍然对本机应用程序开发不满意,并希望探索和理解混合应用程序。 因此,让我们看看我们的最后一个问题。

Image for post

最后一个问题-Flutter还是React Native? (Final Question — Flutter or React Native?)

Flutter and React Native are almost opposites as frameworks and in how they approach mobile application development.

Flutter和React Native在框架以及它们如何进行移动应用程序开发方面几乎是相反的。

One started as a web framework and now has moved into the mobile space (React) while the other started as a Mobile Application framework but is now moving into Web and other platforms (Flutter).

一个作为Web框架开始,现在已经进入移动领域(React),而另一个作为Mobile Application框架开始,但是现在正在迁移到Web和其他平台(Flutter)。

This approach is reflected in how developers think, write, and maintain the codebase of these projects.

这种方法体现在开发人员如何思考,编写和维护这些项目的代码库中。

有正确的心态 (Have the right mindset)

Neither framework is better than the other one, at least as of now.

至少到目前为止,这两个框架都不比另一个框架更好。

There have been many varied opinions online since Flutter came in and you’re not expected to blindly follow any of them!

自Flutter进来以来,在线上已经有许多不同的意见,并且您不应该盲目地关注其中的任何意见!

Image for post
Youtube Search Results for “Flutter or React Native”
在YouTube上搜索“ Flutter或React Native”的结果

I won’t tell you which one to follow either, but you should understand what these frameworks offer, what their strengths and weaknesses are, and see what trade-offs you or your organization can make while adapting them to your projects. It’s you who has to decide which is better based on your requirements and constraints.

我不会告诉您要遵循哪种框架,但是您应该了解这些框架提供了什么,它们的优点和缺点是什么,并了解您或您的组织在根据项目进行调整时可以做出哪些取舍。 您必须根据自己的要求和约束条件来决定哪个更好。

Image for post

React本机 (React Native)

React Native is a cross-platform mobile application development framework created by Facebook.

React Native是Facebook创建的跨平台移动应用程序开发框架。

善良 (The Good)

1. Popular Tech: Flutter’s weakness is React Native’s strength. It’s been here for a while, so there’s a bigger community to support you and almost all SDKs provide support for React Native, including AWS.

1.流行技术: Flutter的弱点是React Native的强项。 它已经存在了一段时间,因此有一个更大的社区来为您提供支持,几乎所有SDK都为React Native提供支持,包括AWS。

2. Good support: You have a good number of third party packages and libraries for doing most of the things in react which applies to mobile and web are available for you to use.

2.良好的支持 :您拥有大量的第三方软件包和库,可用于执行大多数适用于移动设备和Web的响应操作。

3. No learning curve for experienced devs: If you have developers who have experience with building the web app in React, they can straight away get started with React Native and start working on React Native.

3.没有经验丰富的开发人员的学习曲线:如果您有在React中构建Web应用程序的经验的开发人员,他们可以立即开始使用React Native并开始使用React Native。

坏人 (The Bad)

1. Dependency on third-party libraries: The RN third-party packages also come from the open-sourced community. At times they are poorly maintained and some developers who have used these packages in the production environment caused a lot of problems and eventually were fired (true story).

1.对第三方库的依赖: RN第三方软件包也来自开源社区。 有时它们的维护不力,一些在生产环境中使用过这些软件包的开发人员引起了很多问题,最终被解雇了(真实的故事)。

2. Inconsistency in the UI elements: You have coded your mobile app for Android and now when you run the same app in iOS simulator, you may find inconsistencies that will need your additional attention to fix.

2. UI元素中的不一致:您已经为Android编写了移动应用程序的代码,现在,当您在iOS模拟器中运行相同的应用程序时,可能会发现不一致的地方,需要您特别注意解决。

3. Bad backward compatibility: When you upgrade your React Native version, unfortunately, there’s a high risk of breaking your existing running project, which is a dev nightmare.

3.糟糕的向后兼容性:不幸的是,升级React Native版本时,存在破坏现有运行项目的高风险,这是开发者的噩梦。

4. Poorer performance compared to Flutter: The React native runs on a JavaScript bridge on top of the device, while Flutter, which is developed in C and C++, compiles to the device’s Native ARM code which performs equivalent to native apps.

4.与Flutter相比性能更差: React本机运行在设备顶部JavaScript桥上,而Flutter(使用C和C ++开发)则编译为设备的本机ARM代码,其性能相当于本机应用程序。

5. Hot Reloading is not perfect: While Flutter Hot Reloading works perfectly as expected, sometimes, RN hot reload just doesn’t do the job and you need to do a full restart of the application.

5.热重加载并不完美:尽管Flutter热重加载可以按预期正常运行,但有时RN热重加载无法完成工作,您需要完全重新启动应用程序。

Image for post

(Flutter)

Flutter is an open-sourced cross-platform application development framework developed by Google.

Flutter是Google开发的开源跨平台应用程序开发框架。

善良 (The Good)

1. Performance: No other hybrid application framework can beat the performance of Flutter Applications. You will build the most performant apps with Flutter.

1.性能:没有其他混合应用程序框架可以胜过Flutter应用程序的性能。 您将使用Flutter构建性能最高的应用程序。

2. Developer Productivity: One of the Flutter flagship offerings is “Hot-Reload” which instantly deploys the changes in the code in the application saving hours of development and debugging time.

2.开发人员的生产力: Flutter的旗舰产品之一是“热重装”,它可以立即在应用程序中部署代码更改,从而节省了开发和调试时间。

Also, the developers don’t need to be on a mac system to build Flutter apps for iOS, they can use tools like Codemagic to build the iOS app in Cloud for them.

同样,开发人员无需在Mac系统上构建iOS的Flutter应用,他们可以使用Codemagic之类的工具为他们在Cloud中构建iOS应用。

3. Faster Prototyping: This faster development time also means you can reach your goals faster, hit the market to get user feedback sooner, and improve faster.

3.更快的原型制作:更快的开发时间也意味着您可以更快地达成目标,进入市场以更快地获得用户反馈并更快地改进。

4. Batteries Included: Flutter framework helps you minimize your dependency on third-party packages. You can build all the basic features of an application without needing to install any external packages (the code can become a bit complex, but it’s possible).

4.随附的电池: Flutter框架可帮助您最大程度地减少对第三方软件包的依赖。 您可以构建应用程序的所有基本功能,而无需安装任何外部软件包(代码可能会变得有些复杂,但是有可能)。

5. Platforms: Single codebase is deployable to Android, iOS, web (as of today) and is coming soon for Desktop applications as well. The UI elements will look the same across all the platforms you run your code on.

5.平台:单个代码库可部署到Android,iOS,Web(到目前为止),并且即将在桌面应用程序中推出。 UI元素在您运行代码的所有平台上看起来都一样。

6. Easy learning curve — Yes it’s completely new but all you have to do is learn Dart and get a basic understanding of how Flutter works and this little bit of investment will give huge returns in the future.

6.轻松学习曲线 -是的,它是全新的,但是您要做的就是学习Dart,对Flutter的工作原理有基本的了解,而这笔投资将在未来带来巨大的回报。

7. Flexibility to do Native Application Development: Sadly this is also one of its most overlooked strengths. Let’s see how amazing this is.

7.进行本机应用程序开发的灵活性:可悲的是,这也是其最被忽视的优势之一。 让我们看看这有多神奇。

  • For example, you have a feature in the project where you need to access the user’s smartwatch from their device. So far, you have built all the other features using the core Flutter Framework but now you don’t have that support (just imagine) to access the user’s Android or Apple Watch, what would you do?

    例如,您在项目中具有一项功能,需要从用户的设备访问其智能手表。 到目前为止,您已经使用核心Flutter Framework构建了所有其他功能,但是现在您不具备(仅想像一下)访问用户的Android或Apple Watch的支持,您会怎么做?

  • You know you can do them through the native Android and iOS SDKs. Now all you have to do is to use “Flutter Channels” and write the native Android and iOS code just to implement this feature, while the rest of the app still works flawlessly as a Flutter App. So, for just one feature you don’t have to slow down the whole project with native projects.

    您知道可以通过本机Android和iOS SDK来实现。 现在,您所要做的就是使用“ Flutter Channels”并编写原生的Android和iOS代码来实现此功能,而该应用程序的其余部分仍然可以像Flutter App一样完美地工作。 因此,仅使用一项功能,您就不必使用本地项目来减慢整个项目的速度。

8. Amazing backward compatibility: If the flutter version is upgraded in your existing apps, your app will stay the same without any crashes which sadly is not the case with Native apps and React Native.

8.惊人的向后兼容性:如果在现有应用程序中升级了flutter版本,则您的应用程序将保持不变而不会发生崩溃,可悲的是,本机应用程序和React Native并非如此。

9. Already loved more than React Native: Flutter is newer in the market and has already become a more loved framework amongst dev community as shown in the Stackoverflow survey so that shows a strong future ahead.

9.已经比React Native更受喜爱: Flutter在市场上是更新的,并且已经成为开发社区中最受欢迎的框架,如Stackoverflow调查所示,这表明了未来的强劲前景。

坏人 (The Bad)

1. It’s an emerging tech — this is important to understand: It’s just been around two years since Flutter was released and a lot of SDKs for mobile applications are still not available from their official sources.

1.这是一项新兴技术-必须理解这一点很重要: Flutter发行仅两年左右,其官方来源仍未提供许多用于移动应用程序的SDK。

For example, AWS has no official support for Flutter as of today. You can still make things work with the help of community developed SDKs but they might not give you that confidence in production.

例如,到目前为止,AWS还没有对Flutter的官方支持。 您仍然可以在社区开发的SDK的帮助下使一切正常运行,但是它们可能无法使您对生产充满信心。

AWS (Amplify) recently did reply to a 2-year-old active thread on Github that their team is actively working to bring the official SDKs for Flutter:

AWS(Amplify)最近确实在Github上回复了一个已有2年历史的活跃线程,他们的团队正在积极努力为Flutter带来官方SDK:

There are many useful packages that have been created by the ever-growing young Flutter community, which you can use to build awesome applications today. But you may have to wait for some SDKs.

不断增长的年轻Fl​​utter社区已经创建了许多有用的软件包,您现在可以使用它们来构建出色的应用程序。 但是您可能必须等待一些SDK。

So, do your research and see check your requirements to see whether you have sufficient SDKs available before you decide to use Flutter.

因此,请进行研究并查看您的要求,以确定在决定使用Flutter之前是否有足够的SDK。

2. Fewer third-party packages supporting Flutter on multiple platform: While Flutter can support multiple platforms from a single code base, there are a lot of packages out there that also have to be upgraded to support these platforms.

2.在多个平台上支持Flutter的第三方软件包:尽管Flutter可以从单个代码库支持多个平台,但仍有许多软件包需要升级以支持这些平台。

For example, there are many packages that you can easily use in both Android and iOS but that same package might not be available for the web or macOS, hindering you from using Flutter to its full potential.

例如,您可以在Android和iOS中轻松使用许多软件包,但同一软件包可能不适用于Web或macOS,从而阻碍了您充分发挥Flutter的潜能。

These two points will hopefully go away as Flutter and its community progress over time.

随着Flutter及其社区的发展,这两点有望消失。

3. Freedom and flexibility: The freedom and flexibility to write the code in any way are seen as a strength in Flutter, but that flexibility also leaves room for bad decisions, which can leave your project code messy and unmaintainable in the longer run.

3.自由和灵活性:以任何方式编写代码的自由和灵活性被认为是Flutter的优势,但是这种灵活性也为错误的决策留下了空间,从长远来看,这可能会使您的项目代码混乱且难以维护。

4. Learning a new framework: This can be a challenge for people who’ve been working in web or some other tech before. The way Flutter forces you to think and write code is different, so there’s a different style that the developer has to understand and think through. It requires you to learn some new things which can be a challenge for some people.

4.学习新的框架:对于以前使用Web或其他技术的人们来说,这可能是一个挑战。 Flutter迫使您思考和编写代码的方式是不同的,因此开发人员必须理解和思考另一种风格。 它要求您学习一些新事物,这对某些人可能是一个挑战。

在React Native和Flutter之间进行选择 (Choosing between React Native and Flutter)

  • If you’re a single developer or have a small team of developers and want to build beautiful, performing apps faster, and you want to release to web and other desktop platforms in the future, then go with Flutter.

    如果您是一个开发人员,或者只有一个开发人员小组,并且想要构建美观,性能更快的应用程序,并且希望将来发布到Web和其他桌面平台,请使用Flutter。
  • If you are coming from a web background, perhaps you already have a web app, then go with React Native to hit the market faster.

    如果您来自网络背景,也许您已经有一个网络应用程序,那么可以使用React Native来更快地投放市场。
Image for post

结论 (Conclusion)

  • Nothing beats native mobile app development and if you have the money and time to take on projects in native frameworks then that’s the best option. You get full control and flexibility at your disposal to scale your project in the future.

    没有什么比本地移动应用程序开发更胜一筹了,如果您有足够的金钱和时间在本地框架中进行项目,那是最好的选择。 您可以获得完全的控制权和灵活性,可以随时扩展您的项目。
  • Flutter is new but it’s growing rapidly, has great promise, and has delivered on its initial promise already. You and your team might be a little uncomfortable while you’re learning it, but then you’ll be seduced by the efficiency and developer experience.

    Flutter是新产品,但发展Swift,前景广阔,并且已经兑现了最初的承诺。 您和您的团队在学习过程中可能会有些不舒服,但是您会被效率和开发人员经验所吸引。
  • React Native has been around a while. It has great demand and great support to help you fulfill those demands. It has almost no learning curve for web developers and will help you quickly jump into building cross platforms mobile apps.

    React Native已经存在了一段时间。 它有巨大的需求和强大的支持来帮助您满足这些需求。 对于Web开发人员来说,它几乎没有学习曲线,它将帮助您快速进入跨平台移动应用程序的构建。

翻译自: https://medium.com/better-programming/choosing-the-right-mobile-app-development-framework-for-your-next-project-8159c8bbd5bc

跨平台移动应用开发框架


http://www.ppmy.cn/news/534716.html

相关文章

evil神器

还纠结是使用emacs,还是使用vim吗。在emacs中装上evil插件即可。 一、概述 Emacs作为一个操作系统,在大型项目的开发上确实体验要比vim好,所有的事情都可以在上面完成,但是没有像vim中的 . ; * 这种重复命令,当进行重…

Transformer4

其实发了好多了啊 清华也来一直卷他 就又发了 该工作提出了首个深度展开式的Transformer,在使用更低参数量和更少计算量的前提之下,性能大幅度地超过了前人的方法。 文章:https://arxiv.org/abs/2205.10102 代码:https://githu…

css3动画实现上下移动_使用CSS3实现60 FPS移动动画

css3动画实现上下移动 This article was originally published on OutSystems. Thank you for supporting the partners who make SitePoint possible. 本文最初在OutSystems上发布 。 感谢您支持使SitePoint成为可能的合作伙伴。 Animat

2021年下半年,你还可以把论文投给这 9 个国际会议

会议速览 AAAI 2022: Sep 09 2021 GMT0800ICRA 2022: Sep 15 2021 GMT0800ICASSP 2022: Oct 02 2021 GMT0800ICLR 2022: Oct 06 2021 GMT0800AISTATS 2022: Oct 15 2021 GMT0800WWW 2022: Oct 22 2021 GMT0800ACL 2022: Nov 16 2021 GMT0800CVPR 2022: Nov 17 2021 GMT0800LREC…

SAP Customer Experience数字创新空间 基于 SAP Sales Cloud 的世界杯创新案例

为全新客户体验而设计的SAP C/4HANA WHEN WE TALK ABOUT THE NEW CUSTOMER EXPERIENCE? WHAT ARE WE TALKING ABOUT? •We mean that your customers are taking charge of the relationships they have with you. •Your customers do not think in terms of B2B or B2C –…

科技创业:实验室走向市场------导论(下)

科技创业:实验室到市场 导言(第二部分)[^2]企业家精神与企业管理那些成功人士怎么说?那么,它到底是什么?来源 思考 导言(第二部分)1 什么是创业精神?这是不是只有你的老…

EMA:基于跨空间学习的高效多尺度注意力模块

文章目录 摘要1、 简介2、相关工作3、高效多尺度注意力机制3.1、回顾坐标注意力(CA)3.2、多尺度注意力(EMA)模块 4、实验4.1、CIFAR-100上的图像分类4.2、ImageNet-1k上的图像分类4.3、MS COCO上的目标检测4.4、基于VisDrone的目标检测 5、消融实验6、 结论 摘要 https://arxi…

IDEA 正式版终于支持中文版和 JDK 直接下载了(太方便了)附介绍视频

IDEA 2020.1 经过了漫长的打磨终于发布正式版了,而这次的版本不止直接支持 Java 14,还带来了两个重量级的功能,官方中文版支持和 JDK 直接下载。 在之前的开发中,当我们需要下载 JDK 时,通常的步骤是这样的&#xff1…