简体   繁体   English

Delphi和iOS文件大小

[英]Delphi and iOS File size

I created a small application in Delphi XE4 for iOS. 我在Delphi XE4 for iOS中创建了一个小应用程序。 I have 7 forms on it. 我有7个表格。 And everything is good. 一切都很好。

But I am a little bit shocked with file size! 但我对文件大小有点震惊! Its 44MB on Simulator. 它在模拟器上44MB。 The same application I made for android was almost 2MB. 我为android制作的应用程序几乎是2MB。 It has a background image which is 320kb in jpg format I didn't test it on IPhone device yet! 它的背景图像是jpg格式的320kb我还没有在iPhone设备上测试它!

What is the normal size application if you create on XCode with ListBox, texts, buttons on the forms? 如果您在XCode上使用表单上的ListBox,文本,按钮创建,那么正常大小的应用程序是什么?

Is there a way to decrease the filesize by changing any settings in Delphi? 有没有办法通过更改Delphi中的任何设置来减少文件大小?

Around 15 MB sounds to be the smallest executable size with Delphi for iOS (in Release mode with no debug info). 使用Delphi for iOS(在发布模式下没有调试信息),大约15 MB的声音是最小的可执行文件大小。 You can try to disable the RTTI generation , if you do not need it. 如果您不需要,可以尝试禁用RTTI生成 But not with a lot of hope. 但没有很多希望。

It is much bigger than ObjectiveC "native", but it embeds the whole Delphi RTL and the FireMonkey libraries to do all the rendering, therefore it is bigger. 它比ObjectiveC“native”大得多,但它嵌入了整个Delphi RTL和FireMonkey库来完成所有渲染,因此它更大。

A " plain Objective Pascal " executable using native iOS controls, compiled with FPC, should be smaller. 使用FPC编译的本机iOS控件的“ 普通Objective Pascal ”可执行文件应该更小。 Or when compiled with " Oxygene for Cocoa ", it should be much smaller. 或者使用“ Oxygene for Cocoa ”编译时,它应该小得多。

But do not look only at executable size, think at the memory used during execution, and general speed. 但是,不要只考虑可执行文件大小,考虑执行期间使用的内存和一般速度。 You may have to compare with HTML5 apps embedded with PhoneGap. 您可能需要与嵌入PhoneGap的HTML5应用进行比较。 FireMonkey may be slower at rendering on screen, but native code with ARC memory handling should be more powerful than JavaScript. FireMonkey在屏幕上渲染时可能会变慢,但使用ARC内存处理的本机代码应该比JavaScript更强大。

Do not forget that your smartphone has now a lot of memory. 不要忘记你的智能手机现在有很多内存。 ;) ;)

Sadly, it is not possible to share some code with external libraries (.so) under iOS, so you won't be able to use something like Delphi packages to reduce the executable size. 遗憾的是,在iOS下无法与外部库(.so)共享一些代码,因此您将无法使用Delphi软件包来减少可执行文件的大小。

Of course, Apple has always done everything in its power to force developers to use its own tools and language. 当然,Apple始终竭尽全力迫使开发人员使用自己的工具和语言。 As does Microsoft, especially for Windows 8. Delphi for iOS does not claim to be better than XCode + Objective C, but to be cross platform so that you can share as much code as possible with your server or Windows / Mac OSX apps: you can not use your Objective C code outside the Mac world... but you can share your Delphi code among platforms, even if the UI has to be rewritten for mobiles. 与Microsoft一样,特别是对于Windows 8. Delphi for iOS并不声称比XCode + Objective C更好,但是要跨平台,以便您可以与服务器或Windows / Mac OSX应用程序共享尽可能多的代码:不能在Mac世界之外使用你的Objective C代码...但你可以在平台之间共享你的Delphi代码,即使必须为移动设备重写UI。 This is why a more fair comparison would be with JavaScript/PhoneGap, MonoDroid/MonoTouch or AppCelerator . 这就是为什么与JavaScript / PhoneGap, MonoDroid / MonoTouchAppCelerator进行更公平的比较。

Some data, retrieved from StackOverflow : StackOverflow检索的一些数据:

One concern: AFAIK the size limit for 3G download in the AppStore is about 20 MB. 一个问题:AFAIK AppStore中3G下载的大小限制大约是20 MB。

To add to Arnaud's answer: 添加到Arnaud的答案:

You can use Native controls instead of the Firemonkey ones. 您可以使用Native控件而不是Firemonkey控件。
Babak Yaghoobi has written a library to let Delphi use the OS's native controls. Babak Yaghoobi编写了一个库,让Delphi使用操作系统的本机控件。

See here for iOS: http://sourceforge.net/projects/dpfdelphiios/files/?source=navbar 在这里查看iOS: http//sourceforge.net/projects/dpfdelphiios/files/? source = navbar
And here for Android: http://sourceforge.net/projects/dpfdelphiandroid/ 这里是Android: http//sourceforge.net/projects/dpfdelphiandroid/

Firemonkey renders using 100% Delphi code, the native controls use the internal code in your phone's ROM. Firemonkey使用100%Delphi代码渲染,本机控件使用手机ROM中的内部代码。

We have an iOS application with 6 forms and many controls. 我们有一个iOS应用程序,包含6个表单和许多控件。 The release ipa clocks in just over 11 mb and that includes all of those required application icons (28 total measuring a little over 1 mb). 发布的ipa时钟刚刚超过11 mb,其中包括所有必需的应用程序图标(总共28个,测量值超过1 mb)。

In my opinion, that is not that large so I do not see an issue here. 在我看来,这不是那么大,所以我在这里看不到问题。

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

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