I created a small application in Delphi XE4 for iOS. I have 7 forms on it. And everything is good.

But I am a little bit shocked with file size! Its 44MB on Simulator. The same application I made for android was almost 2MB. It has a background image which is 320kb in jpg format I didn't test it on IPhone device yet!

What is the normal size application if you create on XCode with ListBox, texts, buttons on the forms?

Is there a way to decrease the filesize by changing any settings in Delphi?

有帮助吗?

解决方案

Around 15 MB sounds to be the smallest executable size with Delphi for iOS (in Release mode with no debug info). You can try to disable the RTTI generation, if you do not need it. 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.

A "plain Objective Pascal" executable using native iOS controls, compiled with FPC, should be smaller. Or when compiled with "Oxygene for Cocoa", it should be much smaller.

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. FireMonkey may be slower at rendering on screen, but native code with ARC memory handling should be more powerful than 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.

Of course, Apple has always done everything in its power to force developers to use its own tools and language. 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. This is why a more fair comparison would be with JavaScript/PhoneGap, MonoDroid/MonoTouch or AppCelerator.

Some data, retrieved from StackOverflow:

One concern: AFAIK the size limit for 3G download in the AppStore is about 20 MB.

其他提示

To add to Arnaud's answer:

You can use Native controls instead of the Firemonkey ones.
Babak Yaghoobi has written a library to let Delphi use the OS's native controls.

See here for iOS: http://sourceforge.net/projects/dpfdelphiios/files/?source=navbar
And here for Android: http://sourceforge.net/projects/dpfdelphiandroid/

Firemonkey renders using 100% Delphi code, the native controls use the internal code in your phone's ROM.

We have an iOS application with 6 forms and many controls. 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).

In my opinion, that is not that large so I do not see an issue here.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top