Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: [X10 -fmx] Programm open is too long



Permlink Replies: 16 - Last Post: Nov 8, 2015 1:37 PM Last Post By: Brian Hamilton ...
Mario Gagne

Posts: 93
Registered: 2/17/12
[X10 -fmx] Programm open is too long
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 28, 2015 12:28 PM
Hi

I work at a construction problem of my ios application (always refused by Apple too slow at startup and firm alone me ca test goes well about 8 sec to start at 2 (in Ad Hoc via installation from Itune and Ipa )

The boot image 275 k (ios image) ipa total is 15 meg one base Sqlite 2 tables 5 fields each for the first owner of the information (fields 4) 1 record, 2nd Register for the data (6 fields) flights it is empty no given.

To set up my problem I have a form with a text and a timer to launch my app (create .... which is made on form 2.

I display form 2 or it has a tabcontrole 5 pages in the first'v calculation, displays the 2 second calculations 3rd first displays a list of 10 names 4 and 5 its a small menu that opens a form to display a report. it very simple. except of page 1 for calculation.

Here are the uses of the boot on form 2 (tabcontrole)

My uses on Form 2

uses System.SysUtils,System.Types, System.UITypes, System.ImageList, System.Variants,
System.Classes, System.Actions,
FMX.ImgList, FMX.Forms, FMX.Dialogs,
FMX.ActnList, FMX.StdActns, FMX.StdCtrls,FMX.PhoneDialer,FMX.Platform,
FMX.MultiView, FMX.Types, FMX.Layouts, FMX.ListBox, FMX.ScrollBox, FMX.Memo,
FMX.ExtCtrls, FMX.Edit, FMX.DateTimeCtrls, FMX.EditBox, FMX.NumberBox,
FMX.ComboEdit, FMX.Controls.Presentation, FMX.Controls, FMX.TabControl,
FMX.Menus, FMX.MediaLibrary.Actions, FMX.SpinBox, FireDAC.Stan.Intf,
FireDAC.Stan.Option, FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS,
FireDAC.Phys.Intf, FireDAC.DApt.Intf, FireDAC.Stan.Async, FireDAC.DApt,
FireDAC.UI.Intf, FireDAC.Stan.Def, FireDAC.Stan.Pool, FireDAC.Phys,
FireDAC.Phys.SQLite, FireDAC.Phys.SQLiteDef, FireDAC.Stan.ExprFuncs,
FireDAC.FMXUI.Wait, FireDAC.Comp.UI, Data.DB, FireDAC.Comp.Client,
FireDAC.Comp.DataSet;

If you have an idea of the component that takes me to open my temp application. I can not find where the problem is. Or if you have a solution for me.

Thank you for taking a few minutes to watch it.

Mario

Markus Humm

Posts: 5,113
Registered: 11/9/03
Re: [X10 -fmx] Programm open is too long
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 28, 2015 3:05 PM   in response to: Mario Gagne in response to: Mario Gagne
Am 28.10.2015 um 20:28 schrieb Mario Gagne:
Hi

I work at a construction problem of my ios application (always refused by Apple too slow at startup and firm alone me ca test goes well about 8 sec to start at 2 (in Ad Hoc via installation from Itune and Ipa )

The boot image 275 k (ios image) ipa total is 15 meg one base Sqlite 2 tables 5 fields each for the first owner of the information (fields 4) 1 record, 2nd Register for the data (6 fields) flights it is empty no given.

To set up my problem I have a form with a text and a timer to launch my app (create .... which is made on form 2.

I display form 2 or it has a tabcontrole 5 pages in the first'v calculation, displays the 2 second calculations 3rd first displays a list of 10 names 4 and 5 its a small menu that opens a form to display a report. it very simple. except of page 1 for calculation.

Here are the uses of the boot on form 2 (tabcontrole)

My uses on Form 2

uses System.SysUtils,System.Types, System.UITypes, System.ImageList, System.Variants,
System.Classes, System.Actions,
FMX.ImgList, FMX.Forms, FMX.Dialogs,
FMX.ActnList, FMX.StdActns, FMX.StdCtrls,FMX.PhoneDialer,FMX.Platform,
FMX.MultiView, FMX.Types, FMX.Layouts, FMX.ListBox, FMX.ScrollBox, FMX.Memo,
FMX.ExtCtrls, FMX.Edit, FMX.DateTimeCtrls, FMX.EditBox, FMX.NumberBox,
FMX.ComboEdit, FMX.Controls.Presentation, FMX.Controls, FMX.TabControl,
FMX.Menus, FMX.MediaLibrary.Actions, FMX.SpinBox, FireDAC.Stan.Intf,
FireDAC.Stan.Option, FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS,
FireDAC.Phys.Intf, FireDAC.DApt.Intf, FireDAC.Stan.Async, FireDAC.DApt,
FireDAC.UI.Intf, FireDAC.Stan.Def, FireDAC.Stan.Pool, FireDAC.Phys,
FireDAC.Phys.SQLite, FireDAC.Phys.SQLiteDef, FireDAC.Stan.ExprFuncs,
FireDAC.FMXUI.Wait, FireDAC.Comp.UI, Data.DB, FireDAC.Comp.Client,
FireDAC.Comp.DataSet;

If you have an idea of the component that takes me to open my temp application. I can not find where the problem is. Or if you have a solution for me.

Thank you for taking a few minutes to watch it.

Mario


Hello,

can you do some of the initialization in a deferred way?
e.g. by parallel execution via TTask or by having a TTimer executing it
some ms after your main form's OnShow has been run?
Your app would then claim responsivenes to APple's check.

Or you might be able to split up your initialization so that the parts
can be run via timer leaving a small break in between so the app stays
responsive...

Greetings

Markus
Peter Elwell

Posts: 5
Registered: 11/8/02
Re: [X10 -fmx] Programm open is too long
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 28, 2015 5:50 PM   in response to: Mario Gagne in response to: Mario Gagne
Mario Gagne wrote:
Hi

I work at a construction problem of my ios application (always refused by Apple too slow at startup and firm alone me ca test goes well about 8 sec to start at 2 (in Ad Hoc via installation from Itune and Ipa )

The boot image 275 k (ios image) ipa total is 15 meg one base Sqlite 2 tables 5 fields each for the first owner of the information (fields 4) 1 record, 2nd Register for the data (6 fields) flights it is empty no given.

To set up my problem I have a form with a text and a timer to launch my app (create .... which is made on form 2.

I display form 2 or it has a tabcontrole 5 pages in the first'v calculation, displays the 2 second calculations 3rd first displays a list of 10 names 4 and 5 its a small menu that opens a form to display a report. it very simple. except of page 1 for calculation.

Here are the uses of the boot on form 2 (tabcontrole)

My uses on Form 2

uses System.SysUtils,System.Types, System.UITypes, System.ImageList, System.Variants,
System.Classes, System.Actions,
FMX.ImgList, FMX.Forms, FMX.Dialogs,
FMX.ActnList, FMX.StdActns, FMX.StdCtrls,FMX.PhoneDialer,FMX.Platform,
FMX.MultiView, FMX.Types, FMX.Layouts, FMX.ListBox, FMX.ScrollBox, FMX.Memo,
FMX.ExtCtrls, FMX.Edit, FMX.DateTimeCtrls, FMX.EditBox, FMX.NumberBox,
FMX.ComboEdit, FMX.Controls.Presentation, FMX.Controls, FMX.TabControl,
FMX.Menus, FMX.MediaLibrary.Actions, FMX.SpinBox, FireDAC.Stan.Intf,
FireDAC.Stan.Option, FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS,
FireDAC.Phys.Intf, FireDAC.DApt.Intf, FireDAC.Stan.Async, FireDAC.DApt,
FireDAC.UI.Intf, FireDAC.Stan.Def, FireDAC.Stan.Pool, FireDAC.Phys,
FireDAC.Phys.SQLite, FireDAC.Phys.SQLiteDef, FireDAC.Stan.ExprFuncs,
FireDAC.FMXUI.Wait, FireDAC.Comp.UI, Data.DB, FireDAC.Comp.Client,
FireDAC.Comp.DataSet;

If you have an idea of the component that takes me to open my temp application. I can not find where the problem is. Or if you have a solution for me.

Thank you for taking a few minutes to watch it.

Mario

Peter Elwell

Posts: 5
Registered: 11/8/02
Re: [X10 -fmx] Programm open is too long
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 28, 2015 5:54 PM   in response to: Mario Gagne in response to: Mario Gagne
Mario Gagne wrote:
Hi

I work at a construction problem of my ios application (always refused by Apple too slow at startup and firm alone me ca test goes well about 8 sec to start at 2 (in Ad Hoc via installation from Itune and Ipa )

The boot image 275 k (ios image) ipa total is 15 meg one base Sqlite 2 tables 5 fields each for the first owner of the information (fields 4) 1 record, 2nd Register for the data (6 fields) flights it is empty no given.

To set up my problem I have a form with a text and a timer to launch my app (create .... which is made on form 2.

I display form 2 or it has a tabcontrole 5 pages in the first'v calculation, displays the 2 second calculations 3rd first displays a list of 10 names 4 and 5 its a small menu that opens a form to display a report. it very simple. except of page 1 for calculation.

Here are the uses of the boot on form 2 (tabcontrole)

My uses on Form 2

uses System.SysUtils,System.Types, System.UITypes, System.ImageList, System.Variants,
System.Classes, System.Actions,
FMX.ImgList, FMX.Forms, FMX.Dialogs,
FMX.ActnList, FMX.StdActns, FMX.StdCtrls,FMX.PhoneDialer,FMX.Platform,
FMX.MultiView, FMX.Types, FMX.Layouts, FMX.ListBox, FMX.ScrollBox, FMX.Memo,
FMX.ExtCtrls, FMX.Edit, FMX.DateTimeCtrls, FMX.EditBox, FMX.NumberBox,
FMX.ComboEdit, FMX.Controls.Presentation, FMX.Controls, FMX.TabControl,
FMX.Menus, FMX.MediaLibrary.Actions, FMX.SpinBox, FireDAC.Stan.Intf,
FireDAC.Stan.Option, FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS,
FireDAC.Phys.Intf, FireDAC.DApt.Intf, FireDAC.Stan.Async, FireDAC.DApt,
FireDAC.UI.Intf, FireDAC.Stan.Def, FireDAC.Stan.Pool, FireDAC.Phys,
FireDAC.Phys.SQLite, FireDAC.Phys.SQLiteDef, FireDAC.Stan.ExprFuncs,
FireDAC.FMXUI.Wait, FireDAC.Comp.UI, Data.DB, FireDAC.Comp.Client,
FireDAC.Comp.DataSet;

If you have an idea of the component that takes me to open my temp application. I can not find where the problem is. Or if you have a solution for me.

Thank you for taking a few minutes to watch it.

Mario


Hi Mario,

Do you start your app with your database and tables opening automatically. Ie set active in the designer?

You might want to delay the open for them until the app has loaded a splash or start screen.

You could open them in the show event. At least your app will start quicker and hopefully wont get rejected.

Peter
Mario Gagne

Posts: 93
Registered: 2/17/12
Re: [X10 -fmx] Programm open is too long
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 29, 2015 12:03 PM   in response to: Peter Elwell in response to: Peter Elwell
Peter Elwell wrote:
Mario Gagne wrote:
Hi

I work at a construction problem of my ios application (always refused by Apple too slow at startup and firm alone me ca test goes well about 8 sec to start at 2 (in Ad Hoc via installation from Itune and Ipa )

The boot image 275 k (ios image) ipa total is 15 meg one base Sqlite 2 tables 5 fields each for the first owner of the information (fields 4) 1 record, 2nd Register for the data (6 fields) flights it is empty no given.

To set up my problem I have a form with a text and a timer to launch my app (create .... which is made on form 2.

I display form 2 or it has a tabcontrole 5 pages in the first'v calculation, displays the 2 second calculations 3rd first displays a list of 10 names 4 and 5 its a small menu that opens a form to display a report. it very simple. except of page 1 for calculation.

Here are the uses of the boot on form 2 (tabcontrole)

My uses on Form 2

uses System.SysUtils,System.Types, System.UITypes, System.ImageList, System.Variants,
System.Classes, System.Actions,
FMX.ImgList, FMX.Forms, FMX.Dialogs,
FMX.ActnList, FMX.StdActns, FMX.StdCtrls,FMX.PhoneDialer,FMX.Platform,
FMX.MultiView, FMX.Types, FMX.Layouts, FMX.ListBox, FMX.ScrollBox, FMX.Memo,
FMX.ExtCtrls, FMX.Edit, FMX.DateTimeCtrls, FMX.EditBox, FMX.NumberBox,
FMX.ComboEdit, FMX.Controls.Presentation, FMX.Controls, FMX.TabControl,
FMX.Menus, FMX.MediaLibrary.Actions, FMX.SpinBox, FireDAC.Stan.Intf,
FireDAC.Stan.Option, FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS,
FireDAC.Phys.Intf, FireDAC.DApt.Intf, FireDAC.Stan.Async, FireDAC.DApt,
FireDAC.UI.Intf, FireDAC.Stan.Def, FireDAC.Stan.Pool, FireDAC.Phys,
FireDAC.Phys.SQLite, FireDAC.Phys.SQLiteDef, FireDAC.Stan.ExprFuncs,
FireDAC.FMXUI.Wait, FireDAC.Comp.UI, Data.DB, FireDAC.Comp.Client,
FireDAC.Comp.DataSet;

If you have an idea of the component that takes me to open my temp application. I can not find where the problem is. Or if you have a solution for me.

Thank you for taking a few minutes to watch it.

Mario


Hi Mario,

Do you start your app with your database and tables opening automatically. Ie set active in the designer?

You might want to delay the open for them until the app has loaded a splash or start screen.

You could open them in the show event. At least your app will start quicker and hopefully wont get rejected.

Peter

Thamk you for your help

I created a form with a timer that starts in the background that displays a memo. x sec after

I run my program with nothing on the base is closed I just open Application.CreateForm (TFmaitre, Fmaitre) after creating my form I filled after 10 sec timer.

I dont understand what is my problem.

Thank a lot

Mario
Mario Gagne

Posts: 93
Registered: 2/17/12
Re: [X10 -fmx] Programm open is too long
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 30, 2015 9:05 AM   in response to: Mario Gagne in response to: Mario Gagne
Hi

The execution of my program is fast (I put a timer and it opens base and complete information very quickly after create) but it's loading my application that takes a long can I do not open base I just see the form. Is what one can load uses after having displayed the form. I must have a use which takes more time to load it.

Info: My programm .pas = 78 k. and IPA = 17 meg on my iPhone = 36 meg.

thanks for your help

Mario
Douglas Rudd

Posts: 314
Registered: 5/16/97
Re: [X10 -fmx] Programm open is too long
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 30, 2015 2:13 PM   in response to: Mario Gagne in response to: Mario Gagne
My interpretation:

If I don't turn on the database, the form shows quickly. If I turn on the database in the form.create then it takes a long time for the form to show.

Possible solution:
Load the database only after the form shows on the screen. Like maybe with timer.
Mario Gagne

Posts: 93
Registered: 2/17/12
Re: [X10 -fmx] Programm open is too long
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 1, 2015 11:07 AM   in response to: Douglas Rudd in response to: Douglas Rudd
Hello

Thank you for your advice I worked my program reduces my images removed the variables table, my program occupies 13.4 meg,
I check the creation of my biggest form it takes 5 seconds to create and open. and set a timer to turn the information (open SQLite databases and data transfer)

What is the best method to

Start the startup screen (Picture jpeg or png) I use png 100k or less.

after with a timer open the programm Application.CreateForm(TFmaitre, Fmaitre);

close timer 1

active timer 2 for complete information in my form...

What time is better to open software on iPhone.

Sorry for my English.

I appreciate your help and support.

Mario
Brian Hamilton ...

Posts: 556
Registered: 10/14/04
Re: [X10 -fmx] Programm open is too long
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 1, 2015 3:22 PM   in response to: Mario Gagne in response to: Mario Gagne
try
as a test
having only a place holder form (i.e simple form)
as the autocreated form (ie mainform in the project, options,forms

and then once that is shown on the mobile device, then create at run time all other forms needed to be shown ,
e.g via a button (just to test)..you could use a ttimer later once know where the bottle neck is

using tmyform:=tmyform.create(self);
myform.show

and same for database..only load with the other form creation etc
Mario Gagne

Posts: 93
Registered: 2/17/12
Re: [X10 -fmx] Programm open is too long
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 2, 2015 5:13 AM   in response to: Brian Hamilton ... in response to: Brian Hamilton ...
try
as a test
having only a place holder form (i.e simple form)
as the autocreated form (ie mainform in the project, options,forms

and then once that is shown on the mobile device, then create at run time all other forms needed to be shown ,
e.g via a button (just to test)..you could use a ttimer later once know where the bottle neck is

using tmyform:=tmyform.create(self);
myform.show

and same for database..only load with the other form creation etc
Brian Hamilton Hamilton wrote:
try
as a test
having only a place holder form (i.e simple form)
as the autocreated form (ie mainform in the project, options,forms

and then once that is shown on the mobile device, then create at run time all other forms needed to be shown ,
e.g via a button (just to test)..you could use a ttimer later once know where the bottle neck is

using tmyform:=tmyform.create(self);
myform.show

and same for database..only load with the other form creation etc

Thank you Brian

Just check my start program

Time to see first screen is arond 3 sec and more 5 sec to create
 Application.CreateForm(TFmaitre, Fmaitre);
= 8 sec

My timer is start (500) after create menu to create
 Application.CreateForm(TFmaitre, Fmaitre);


What is my problem for to start fast.

Thank again for your help

Mario

Programm.........

///********************************

program Calcultaux;
 
uses
  System.StartUpCopy,
  FMX.Forms,
  Udepart in 'Udepart.pas' {Fdepart},
  Umaster in 'Umaster.pas' {Fmaitre},
  Urapport in 'Urapport.pas' {Frapport},
  Umaj in 'Umaj.pas' {Fmaj},
  menu in 'menu.pas' {Fmenu},
  Ucoupon in 'Ucoupon.pas' {Fcoupon};
 
{$R *.res}
 
begin
  Application.Initialize;
  Application.FormFactor.Orientations := [TFormOrientation.Portrait];
   Application.CreateForm(TFmenu, Fmenu);
 
 // Application.CreateForm(TFcoupon, Fcoupon);
 
  //  Application.CreateForm(TFdepart, Fdepart);
  //  Application.CreateForm(TFmaj, Fmaj);
 //   Application.CreateForm(TFmaitre, Fmaitre);
 //  Application.CreateForm(TFrapport, Frapport);
 
   Application.Run;
end.
 

//////////////////////*************************************** form 1
unit menu;
 
interface
 
uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs,
  System.ImageList, FMX.ImgList, FMX.Controls.Presentation, FMX.StdCtrls,
  FMX.Layouts, FMX.ExtCtrls, FMX.MultiView;
 
type
  TFmenu = class(TForm)
    ImageViewer1: TImageViewer;
    Button1: TButton;
    ImageList1: TImageList;
    Button3: TButton;
    Timer1: TTimer;
    Button2: TButton;
    MultiView1: TMultiView;
    Button5: TButton;
    Button6: TButton;
    Button7: TButton;
    Button8: TButton;
    ToolBar1: TToolBar;
    Button4: TButton;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label1: TLabel;
    L_start: TLabel;
    L_end: TLabel;
    procedure Timer1Timer(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button6Click(Sender: TObject);
    procedure Button7Click(Sender: TObject);
    procedure Button8Click(Sender: TObject);
    procedure FormActivate(Sender: TObject);
  private
    { Déclarations privées }
  public
    { Déclarations publiques }
  end;
 
var
  Fmenu: TFmenu;
 
implementation
 
{$R *.fmx}
{$R *.iPhone4in.fmx IOS}
{$R *.iPhone.fmx IOS}
{$R *.iPhone47in.fmx IOS}
{$R *.iPhone55in.fmx IOS}
{$R *.Windows.fmx MSWINDOWS}
 
 uses umaster,udepart,urapport;
 
procedure TFmenu.Button1Click(Sender: TObject);
begin
  Application.CreateForm(TFdepart, Fdepart);  //  Just information form
      fdepart.show;
 
      fmenu.Hide;
end;
 
procedure TFmenu.Button2Click(Sender: TObject);
begin
    fmaitre.show;
    fmenu.Hide;
end;
 
procedure TFmenu.Button3Click(Sender: TObject);
begin
  Application.CreateForm(TFrapport, Frapport);
 
    frapport.show;
 
  fmenu.Hide;
end;
 
procedure TFmenu.Button6Click(Sender: TObject);
begin
if label3.Visible=false then
     label3.Visible:=true
     else
      label3.Visible:=false;
end;
 
procedure TFmenu.Button7Click(Sender: TObject);
begin
if label4.Visible=false then
     label4.Visible:=true
     else
      label4.Visible:=false;
end;
 
procedure TFmenu.Button8Click(Sender: TObject);
begin
if label5.Visible=false then
     label5.Visible:=true
     else
      label5.Visible:=false;
end;
 
procedure TFmenu.FormActivate(Sender: TObject);
begin
   timer1.Enabled:=true;
end;
 
procedure TFmenu.Timer1Timer(Sender: TObject); //  timer to create form  is too long 5 sec
var
debut:string;
begin
 
   debut:=timetostr(now);
 
  Application.CreateForm(TFmaitre, Fmaitre);
   l_start.Text:=debut;
  l_end.Text:=timetostr(now);
 
     timer1.Enabled:=false;
 
   button1.Visible:=true;
  button2.Visible:=true;
  // button3.Visible:=true;
end;
 
end.
Markus Humm

Posts: 5,113
Registered: 11/9/03
Re: [X10 -fmx] Programm open is too long
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 2, 2015 1:04 PM   in response to: Mario Gagne in response to: Mario Gagne
Hello,

can the loading of your data from the db be done in a separate thread so
your main thread stays responsive?

There is the system.threading unit now to help you with such things.
You can use TTask for instance and that also has a WaitFor method you
can later on use to wait until the loading has been finished.

Greetings

Markus
Mario Gagne

Posts: 93
Registered: 2/17/12
Re: [X10 -fmx] Programm open is too long
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 3, 2015 5:35 AM   in response to: Markus Humm in response to: Markus Humm
Markus Humm wrote:
Hello,

can the loading of your data from the db be done in a separate thread so
your main thread stays responsive?

There is the system.threading unit now to help you with such things.
You can use TTask for instance and that also has a WaitFor method you
can later on use to wait until the loading has been finished.

Greetings

Markus

Hello

I Thank You for your help

After reading ttask it seems a good idea to use it. I never use with windows task because the operations are very fast but I have revised my programming with IOS. I need your help to create my first task

My problem is just create

Application.CreateForm(TFmenu, Fmenu);

and
// second process replace my timer
var
debut:string;
begin
 
   debut:=timetostr(now);
 
  Application.CreateForm(TFmaitre, Fmaitre);
   l_start.Text:=debut;
  l_end.Text:=timetostr(now);
 
     timer1.Enabled:=false;
 
   button1.Visible:=true;
  button2.Visible:=true;
 button3.Visible:=true;
end;

Thank for your help

Mario
Markus Humm

Posts: 5,113
Registered: 11/9/03
Re: [X10 -fmx] Programm open is too long
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 3, 2015 9:36 AM   in response to: Mario Gagne in response to: Mario Gagne
Hello,

you need to be aware what you can do and what not with a task before
starting to use one.

1. you can load your data from the DB
2. you cannot access any FMX objects from that task, that would
be unsafe!
3. you must ensure that nobody tries to access the data structures you
load your data in at the same time you're still loading, otherwise
data corruption can occur.

Greetings

Markus
Mario Gagne

Posts: 93
Registered: 2/17/12
Re: [X10 -fmx] Programm open is too long
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 4, 2015 6:39 AM   in response to: Markus Humm in response to: Markus Humm
Markus Humm wrote:
Hello,

you need to be aware what you can do and what not with a task before
starting to use one.

1. you can load your data from the DB
2. you cannot access any FMX objects from that task, that would
be unsafe!
3. you must ensure that nobody tries to access the data structures you
load your data in at the same time you're still loading, otherwise
data corruption can occur.

Greetings

Markus

Thank you Markus

I do one test with TTask and I save + or - 2 sec

my code is:
procedure TFmenu.FormCreate(Sender: TObject);
var
 debut:string;
begin
       debut:=timetostr(now);
 
    TTask.Run(procedure
      begin
          {Some calculation that takes time}
          Sleep(1000);
 
          TThread.Synchronize(nil,
            procedure
            begin
 
             Application.CreateForm(TFmaitre, Fmaitre);
              l_start.Text:=debut;
              l_end.Text:=timetostr(now);
 
              timer1.Enabled:=false;
 
              button1.Visible:=true;
               button2.Visible:=true;
            end);
      end);
 end;


Thank a lot for your help

Mario
Markus Humm

Posts: 5,113
Registered: 11/9/03
Re: [X10 -fmx] Programm open is too long
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 4, 2015 9:51 AM   in response to: Mario Gagne in response to: Mario Gagne
Hello,

I guess you should only put some of the stuff done in the form creation
event into the task. Doing GUI work (as you mostly did) in another task
doesn't help you much, as it needs to synchronized with the main task.

You need to extract the non GUI loading parts of your app's startup code
and put that in a task.

e.g. separate loading of data from presenting it.

Greetings

Markus
Mario Gagne

Posts: 93
Registered: 2/17/12
Re: [X10 -fmx] Programm open is too long
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 8, 2015 10:02 AM   in response to: Markus Humm in response to: Markus Humm
Markus Humm wrote:
Hello,

I guess you should only put some of the stuff done in the form creation
event into the task. Doing GUI work (as you mostly did) in another task
doesn't help you much, as it needs to synchronized with the main task.

You need to extract the non GUI loading parts of your app's startup code
and put that in a task.

e.g. separate loading of data from presenting it.

Greetings

Markus

Hi

Thank you Markus

I took your advice I have made up my program into multiple files instead of a tabcontrol. I created a form of departure with an info 2 items and the other to go to the program main. The main program opens quickly.

But it is a bit slow for the startup of flights from page to open my menu I do not know why. once opened this place very well.
How to speed up the opening of my first form (menu).

Programm start

begin
  Application.Initialize;
  Application.FormFactor.Orientations := [TFormOrientation.Portrait];
  Application.CreateForm(TFmenu, Fmenu);
 
  Application.Run;
end.


My menu

uses Ugestion ,udonnees;
 
 
procedure TFmenu.Button1Click(Sender: TObject);
begin
      panel1.Visible:=true;
end;
 
procedure TFmenu.Button2Click(Sender: TObject);
begin
       Application.CreateForm(TFgestion, Fgestion);    // second menu
       Application.CreateForm(TFdonnees, Fdonnees);//   Data Base
      fgestion.show;
      fmenu.Hide;
end;


Your comments are always welcome

Thank you

Mario
Brian Hamilton ...

Posts: 556
Registered: 10/14/04
Re: [X10 -fmx] Programm open is too long
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 8, 2015 11:37 AM   in response to: Mario Gagne in response to: Mario Gagne
I do know that the same Delphi app will load much faster on Android that on Iphone
I do think there is more optmisation that can be done by EMB for iphone FMX form creation etc

what you could do though is create the form objects at run time, after the form is shown
(and add in the hooks to the code for the events to those objects)
sort of thing

Edited by: Brian Hamilton Hamilton on Nov 8, 2015 1:37 PM

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02