App size grows, but how?

Posted by on in Blogs
I must confess... I lied in my previous comments, that "app size grows non-linearly". Better late, than never.


I've tested mobile FM applications, chaning the number of FM visual controls (visual components) on a main mobile form in the project.

There is no mistake on the chart horizontal axis. I started with a project without components and ended with a form with 900 visual controls.

The last app with 900 controls comparing to no control app was 220 Kb bigger. Yes, 0.22 Mb, that means 1.3%.

The growth obeys quite a linear formula. But the coefficient a in the equation
y = a*x + c
is so low, that 900 components in design-time yields just nothing, about 1% of the app size. It's a line, but close to horizontal, if I change the chart horizontal axis scale from "growth" to absolute app size.

The test is crazy for a user, as nobody will use 900 components on a form. No developer will sit 900 components on a mobile form. I did.


I took "MobileControls" demo delivered with RAD Studio/Delphi XE5, put all the components on a TabItem and... Oh, no! I could Ctr+C and Ctrl+V em'll. Instead, I made my "fat-form-generator".


It's a VCL application, wich takes a prarmeterized *.fmx and *.pas files and generates the mobile project with the set number of copies. Not to duplicate component names I used a parameter and RegularExpressions (available in Delphi since... in XE generation they were for sure).

Why did I make a generator? A good way to know everything about some technology is to test it in code. In addition, I can use the generator in future with more tricky ways of making FM mobile project. May be, to auto-generate interfaces against some data structures. Yes, I can do this dynamically in runtime, but this pre-generator can be good, if a customer needs special fitting and tuning of GUI. It's like visual form inheritance, but "horizontally, not vertically".


I was really nervous when re-loading the auto-generated huge mobile project. But I continued to click on any of 900 components and set their properties in ObjectInspector like it was just a 9 components on a single form. No problems at all.


The last worry was the app. It works with 900 controls on Nexus 7. Plain switch between controls. No delays.

I can be accused, I'm too cruel with Delphi XE5 and Android tablet. Dont' worry, no hardware, no software were damaged during the experiments :)
Tags: public


  • Guest
    slh Thursday, 3 October 2013

    Меня, как "того самого" разработчика приложений для реального бизнеса, не волнует вопрос размера приложения. Если вы пишете об этом, значит вопрос оптимизации поставлен и будет по мере возможностей решаться. Это хорошо.

    Другой вопрос: как повторить ваше тестовое приложение? Вы, ваши иностранные коллеги, проводите презентации и вебинары. У вас есть материалы. Так почему их не выложить здесь в систематизированном виде по технологиям? Англоязычные видео-материалы снабдить субтитрами. Не в вашем блоге имею ввиду, и не как часть справки по Дельфи. А как временную замену хорошей книги и начального руководства.

  • Guest
    Akella Monday, 7 October 2013


  • Please login first in order for you to submit comments
  • Page :
  • 1

Check out more tips and tricks in this development video: