简体   繁体   English

Delphi XE5 Firemonkey:用于移动/ Win / OSX的单一代码库?

[英]Delphi XE5 Firemonkey: Single code base for mobile/Win/OSX?

Just starting to play with FM after almost 20 years of VCL, so please bear with me... What makes an XE5 application mobile vs. FM HD? 经过近20年的VCL,才刚刚开始使用FM播放,所以请忍受...是什么使XE5应用程序相对于FM HD具有移动性? I cannot add OSX target to a mobile project (even though Win32 works), and I cannot add iOS/Android target to a Win32/Win64/OSX project. 我无法将OSX目标添加到移动项目中(即使Win32可以工作),也无法将iOS / Android目标添加到Win32 / Win64 / OSX项目中。 From what I can tell the same units are referenced, so why can't I have a single project for all supported platforms? 从我可以知道引用的是相同的单元,为什么我不能为所有受支持的平台提供一个项目?

Thanks! 谢谢!

You cannot add desktop mobile target to mobile. 您无法将台式机移动终端添加到移动终端。 The main reason, because desktop platform have more space of screen and has another ideom of building UI. 主要原因是因为桌面平台具有更大的屏幕空间,并且具有构建UI的另一个思想。 So, of course, you can make window UI on mobile device, but it is not conveniently for using and doesn't respond mobile UI Guildline doc. 因此,您当然可以在移动设备上创建窗口UI,但是使用起来并不方便,并且不会响应移动UI Guildline文档。 Also Apple guaranteed doens't apply your application into App Store. 此外,Apple保证不会将您的应用程序应用到App Store。

However, you can create two project with one code base. 但是,您可以使用一个代码库创建两个项目。

  1. Create Mobile project 创建移动项目
  2. Create Desktop project 创建桌面项目
  3. Separate buisness logic from UI 将商务逻辑与UI分开
  4. You can create custom form for each projects or use exists (Only add your common form to mobile or desktop projects). 您可以为每个项目创建自定义表单或使用现有表单(仅将常规表单添加到移动或桌面项目中)。

Thank you 谢谢

I cannot add OSX target to a mobile project (even though Win32 works), and I cannot add iOS/Android target to a Win32/Win64/OSX project. 我无法将OSX目标添加到移动项目中(即使Win32可以工作),也无法将iOS / Android目标添加到Win32 / Win64 / OSX项目中。

Different project types have different backend dependences. 不同的项目类型具有不同的后端依赖性。 It does not make sense to allow OSX in a mobile project, so it is disabled. 在移动项目中允许OSX没有意义,因此将其禁用。 It does not make sense to allow iOS/Android in a desktop project, so they are disabled. 在桌面项目中允许iOS / Android没有意义,因此将其禁用。 The only reason Win32 is allowed in a mobile app is to help facilitate local testing without using a device/emulator, but you should not deploy without doing some device/emulator tests first. 允许在移动应用程序中使用Win32的唯一原因是有助于在不使用设备/仿真器的情况下促进本地测试,但是在不首先进行某些设备/仿真器测试的情况下不应部署。

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

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