我有VS 2015社区版并安装了Xamarin来创建Android应用程序,我安装了Android SDK和模拟器并设置它们,我有两个问题:
谢谢
答案 0 :(得分:0)
1。)否。您不需要先启动模拟器。如果没有运行仿真器,VS将启动当前选定的仿真器。
2.。)Xamarin.Forms和Android / iOS / WinPhone项目是不同的方法。
制作Xamarin.Forms app
时,您会创建一个用户界面并为每个平台自定义(例如,填充到顶部边缘)。所以你分享UI和yor cross plattform代码(例如自定义数据服务,如获取feed / database entries /...).
Crossplattform App
(新项目 - > Visual C# - >跨平台 - >空白应用程序(原生可移植))旨在为每个平台创建项目并创建您的项目每个目标的UI。此外(与Xamarin.Forms
一样)您可以将它们作为PCL(portable class libary
)分享您的商业代码。因此,如果您必须从Web服务请求一些数据,那么您可以在PCL中实现它们并从Android,WinPhone和iOS应用程序访问它。
在Xamarin.Forms
中,您可以通过继承现有控件并通过yourselfe为每个平台制作渲染器来设计自己的自定义控件,或者尝试Xamarin Component Store
。
在跨平台方法中,您可以/必须由yourselfe在每个平台上进行设计。
在Xamarin.Forms中你有
- 多个平台的一个用户界面
- 您可以增加的代码部分
- UI看起来绝对是原生的
<强> BUT 强>:
- 您只能使用最不常见的分母(因为iOS和WinPhone不支持Android,因此可以在Android下使用Android的东西
- 有时UI无法正常工作
使用Crossplatform方法创建应用时:
- 您可以完全控制事物以及它们在每个设备中的工作方式
<强> BUT 强>:
- 您必须了解应用程序的生命周期以及操作系统的真正运作方式。
查看xamarin的开发者页面:Xamarin.Forms
Xamarin.Forms is best for:
- Data entry apps
- Prototypes and proofs-of-concept
- Apps that require little platform-specific functionality
- Apps where code sharing is more important than custom UI
Xamarin.iOS & Xamarin.Android are best for:
- Apps that require specialized interactions
- Apps with highly polished design
- Apps that use many platform-specific APIs
- Apps where custom UI is more important than code sharing