简体   繁体   English

html5和xamarin有什么区别?

[英]What is the difference between html5 and xamarin?

I'm a C# .NET developer. 我是C#.NET开发人员。

I want to develop mobile apps that can run on iphone, android, and windows phone. 我想开发可以在iphone,android和windows手机上运行的移动应用程序。

As far as now, I found that www.xamarin.com provides a solution that can develop iphone and android using C#. 到目前为止,我发现www.xamarin.com提供了一个可以使用C#开发iphone和android的解决方案。

What is the difference between html5 and xamarin? html5和xamarin有什么区别?

Which technology should I use that I can develop once and run on all platform? 我应该使用哪种技术,我可以开发一次并在所有平台上运行?

The main difference is that HTML5 works on a browser and xamarin does not (for as far as I researched it). 主要区别在于HTML5适用于浏览器,而xamarin则不适用(就我研究而言)。 With HTML5 it is easier to develop on multiple devices. 使用HTML5,可以更轻松地在多个设备上进行开发。 But xamarin who makes native apps, can access native functions on your device (like notifications and so on). 但是制作本机应用程序的xamarin可以访问设备上的本机功能(如通知等)。 But the downside is that xamarin is a bit harder to make it work on multiple devices. 但缺点是xamarin在多个设备上运行起来有点困难。 Also a native app has to be installed, a HTML5 app does not. 还必须安装本机应用程序,而HTML5应用程序则不需要。 So what you should be asking yourself is, what kind of app do I want to make. 所以你应该问自己的是,我想做什么样的应用程序。 Furthermore something as an app that runs on all platforms does not exist yet. 此外,作为在所有平台上运行的应用程序的东西还不存在。 Some HTML5 frameworks offer a large support (like JQmobile) but all platforms is nearly impossible. 一些HTML5框架提供了大量支持(如JQmobile),但所有平台几乎都不可能。

I think that a better description of your choice would be between MonoTouch (created by Xamarin) and PhoneGap (which provides a native wrapper to HTML5). 我认为更好地描述您的选择将介于MonoTouch(由Xamarin创建)和PhoneGap(它为HTML5提供本机包装)之间。 Both generate native applications. 都生成本机应用程序。 Both work on multiple platforms. 两者都在多个平台上工作。 Both permit external Objective-C libraries to be linked in. 两者都允许链接外部Objective-C库。

If there's external libraries needed - I think that PhoneGap might be more platform-independent than MonoTouch - I've only done iOS development but I believe that the Android Mono libraries are structured a bit differently so it's not reasonable to have the same codebase for the UI portion of your app. 如果需要外部库 - 我认为PhoneGap可能比MonoTouch更独立于平台 - 我只进行了iOS开发,但我相信Android Mono库的结构有点不同,所以为它们提供相同的代码库是不合理的。应用的UI部分。 But in this case you might just stick to HTML5 and put all the code on a server. 但在这种情况下,您可能会坚持使用HTML5并将所有代码放在服务器上。

If you need to link in external libraries - I found PhoneGap much easier than MonoTouch. 如果你需要链接外部库 - 我发现PhoneGap比MonoTouch容易得多。 I can create a PhoneGap project in the same Xcode workspace as the rest of my code and everything just compiles and debugs nicely. 我可以在与我的其余代码相同的Xcode工作区中创建一个PhoneGap项目,所有内容都可以很好地编译和调试。 With MonoTouch I have a number of script files that make universal static libraries and then they are linked in via awkward gcc flags. 使用MonoTouch,我有许多脚本文件可以创建通用静态库,然后通过笨拙的gcc标志链接它们。

If you can stay in the HTML5 world I would recommend hosting all your files on a server so you avoid all the deployment headaches associated with native apps. 如果您可以留在HTML5世界中,我建议您在服务器上托管所有文件,这样可以避免与本机应用程序相关的所有部署难题。 But if you need a native app you can make amazing applications in either environment. 但如果您需要原生应用程序,则可以在任一环境中创建出色的应用程序。

well, they are two COMPLETELY different things. 好吧,它们是两个完全不同的东西。

briefly: 简述:

-HTML5 is a standard for web pages, still under review (this means that it is not final and may vary ANYTIME) -HTML5是网页的标准,仍在审核中(这意味着它不是最终的,可能会随时变化)

-xamarin is a framework to develop cross-platforms applications. -xamarin是一个开发跨平台应用程序的框架。 This means that it is a set of tools that will allow you (in this case) to code from C# and .net and get a mobile application ( yeah most probably it will be a set of HTML5 with js webpages, but i have never actually used it ) 这意味着它是一组工具,允许你(在这种情况下)从C#和.net编码并获得一个移动应用程序( 是的,它可能是一组带有js网页的HTML5,但我实际上从未实际用过它

So you can say that xamarin (probably) uses HTML5 for the final output, but that's it. 所以你可以说xamarin (可能)使用HTML5作为最终输出,但就是这样。 has pratically nothing in common with html5 和html5没什么共同之处

Below link will give more insight about Monodroid (which is Xamarin's solution to develop Android applications by using .NET): 下面的链接将提供有关Monodroid的更多信息(这是Xamarin使用.NET开发Android应用程序的解决方案):

http://monodroyd.wordpress.com/2011/12/04/introduction-to-mono-for-android/ http://monodroyd.wordpress.com/2011/12/04/introduction-to-mono-for-android/

Hope this helps! 希望这可以帮助!

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

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