How do I best use forms in iOS firemonkey apps?

Sorry for asking a daft question, but the demos I have seen seem to have a kind of tab/page control with invisible tabs. Hence the form never actually changes. (Just the active tabitem)

Should I do like that? Or should I create a separate form for each window/form/activity? (e.g. for memory usage?)

Can anyone recommend any demo apps I cam use as a starting point for a simple info app?
0
Thomas
6/19/2013 3:14:33 PM
embarcadero.delphi.ios 412 articles. 0 followers. Follow

8 Replies
1251 Views

Similar Articles

[PageSpeed] 8

The choice is really yours as to whether you want to use tab controls or forms for subsequent pages. 

Tab controls can be set to give the users the additional tabs to navigate through.
0
Edwin
6/19/2013 10:49:42 PM
Thomas Schulz wrote:

> Should I do like that? Or should I create a separate form for each
> window/form/activity? (e.g. for memory usage?)

I'm not sure of the increase in memory overhead, as I've not profiled
either scenario. But one advantage you get when using a TTabControl is
that you can apply a slide transition when changing tabs. I'm not aware
of a way that this can be achieved when using forms, unless you resort
to embedding a form in a tab page.

-- 
Cheers,
David Clegg
dclegg@gmail.com
http://cc.embarcadero.com/author/72299
QualityCentral. The best way to bug Embarcadero about bugs.
http://qc.embarcadero.com

"Vampires are make believe, just like elves and gremlins and eskimos."
- Homer Simpson
0
David
6/20/2013 1:58:52 AM
> I'm not sure of the increase in memory overhead, as I've not profiled
> either scenario. But one advantage you get when using a TTabControl is
> that you can apply a slide transition when changing tabs. I'm not aware

I guess this is advantage to the tabcontrol solution. My app will be pretty standard having a peg with map, another with a listview, another with a gallery etc. I will keep watching this thread incase someone has further information :) Until then I will probably try go the tabcontrol route since my app won't be huge.
0
Thomas
6/20/2013 10:37:14 AM
> {quote:title=Thomas Schulz wrote:}{quote}
> Sorry for asking a daft question, but the demos I have seen seem to have a kind of tab/page control with invisible tabs. Hence the form never actually changes. (Just the active tabitem)
> 
> Should I do like that? Or should I create a separate form for each window/form/activity? (e.g. for memory usage?)
> 
> Can anyone recommend any demo apps I cam use as a starting point for a simple info app?

I don´t recommend you use a lot of forms in your firemonkey application.

Problems using forms:

1º You can't show them with an iOS animation, so you loose the "iOS feeling"
2º You can´t create/destroy forms in run-time because
   a) It's slow if the form is complex
   b) The free command doesn´t really "free" the memory:

{code}
   with TClassOfYourForm.Create(self) do
     begin
     ...
        ShowModal;
        Free; <-------- This is useless in iOS (I don´t know why)
     ...

     end;
{code}

If you create/destroy a form in runtime several times... you will find that you have run out all your RAM and I think Apple wouldn´t approve your app.
0
Diego
6/20/2013 6:55:03 PM
Thomas Schulz wrote:

> I guess this is advantage to the tabcontrol solution. My app will be
> pretty standard having a peg with map, another with a listview,
> another with a gallery etc. I will keep watching this thread incase
> someone has further information :) Until then I will probably try go
> the tabcontrol route since my app won't be huge.

If you want to partition your code into logical units, you may want to
investigate using Frames. That way you can stil get the iOS transition
animations. The trade off there is that frames don't have the iOS
themes applied in the form designer (although they theme correctly at
run-time).

-- 
Cheers,
David Clegg
dclegg@gmail.com
http://cc.embarcadero.com/author/72299
QualityCentral. The best way to bug Embarcadero about bugs.
http://qc.embarcadero.com

"This donut has purple in the middle. Purple is a fruit!" - Homer
Simpson
0
David
6/20/2013 8:54:36 PM
>    b) The free command doesn´t really "free" the memory:
> 
> {code}
>    with TClassOfYourForm.Create(self) do
>      begin
>      ...
>         ShowModal;
>         Free; <-------- This is useless in iOS (I don´t know why)
>      ...
> 
>      end;
> {code}
> 
> If you create/destroy a form in runtime several times... you will find that you have run out all your RAM and I think Apple wouldn´t approve your app.

You should use DisposeOf because now is a reference in FMX.Forms.Screen and this reference will be removed only in TCommonCustomForm.Destroy:

{code}procedure TCommonCustomForm.InitializeNewForm;
begin
.........
  Screen.AddForm(Self);
.........
end;

destructor TCommonCustomForm.Destroy;
begin
........
  if Assigned(Screen) then
    Screen.RemoveForm(Self);
........
end;
{code}

And there is a QC:  http://qc.embarcadero.com/wc/qcmain.aspx?d=115556

Best Regards,
Cristian Peta
0
Cristian
6/21/2013 7:28:45 AM
> {quote:title=Cristian Peta wrote:}{quote}
> >    b) The free command doesn´t really "free" the memory:
> > 
> > {code}
> >    with TClassOfYourForm.Create(self) do
> >      begin
> >      ...
> >         ShowModal;
> >         Free; <-------- This is useless in iOS (I don´t know why)
> >      ...
> > 
> >      end;
> > {code}
> > 
> > If you create/destroy a form in runtime several times... you will find that you have run out all your RAM and I think Apple wouldn´t approve your app.
> 
> You should use DisposeOf because now is a reference in FMX.Forms.Screen and this reference will be removed only in TCommonCustomForm.Destroy:
> 
> {code}procedure TCommonCustomForm.InitializeNewForm;
> begin
> ........
>   Screen.AddForm(Self);
> ........
> end;
> 
> destructor TCommonCustomForm.Destroy;
> begin
> .......
>   if Assigned(Screen) then
>     Screen.RemoveForm(Self);
> .......
> end;
> {code}
> 
> And there is a QC:  http://qc.embarcadero.com/wc/qcmain.aspx?d=115556
> 
> Best Regards,
> Cristian Peta

Thanks for the tip Cristian
0
Diego
6/21/2013 9:29:38 AM
There is even a better way to partition your code. The mainform contains a tabcontrol with the main user interface tabs. For each tab you create a separate form, on which you place a TLayout. All content of the form is put as child of this TLayout. All forms are generated upon application start. In the mainform.onshow you set the parent of each of the other forms to the correct mainform tabitem.

This way you have full strength of forms (styling, handles,...), and still nicely partitioned code.

And since you are using a tabcontrol on the mainform, you still have the slide effects.

> {quote:title=David Clegg wrote:}{quote}
> Thomas Schulz wrote:
> 
> > I guess this is advantage to the tabcontrol solution. My app will be
> > pretty standard having a peg with map, another with a listview,
> > another with a gallery etc. I will keep watching this thread incase
> > someone has further information :) Until then I will probably try go
> > the tabcontrol route since my app won't be huge.
> 
> If you want to partition your code into logical units, you may want to
> investigate using Frames. That way you can stil get the iOS transition
> animations. The trade off there is that frames don't have the iOS
> themes applied in the form designer (although they theme correctly at
> run-time).
> 
> -- 
> Cheers,
> David Clegg
> dclegg@gmail.com
> http://cc.embarcadero.com/author/72299
> QualityCentral. The best way to bug Embarcadero about bugs.
> http://qc.embarcadero.com
> 
> "This donut has purple in the middle. Purple is a fruit!" - Homer
> Simpson
0
Jan
7/4/2013 8:47:11 AM
Reply:

Similar Artilces:

Can I do this with iOS apps developed in Delphi XE4 Pro + iOS?
I still don't have XE4/iOS as I have some questions first. Do I have access to iOS "native" library/system? What do I use for internet (downloading files etc.) - Indy? *If my research is correct, Google maps is available for iOS? Can I use Google maps or Apple's maps solutions in Delphi iOS apps?* If I have XE4 Pro, can I still use database functionality? Any restrictions? (Am I allowed to use what iOS offers or connect with a database on a webserver?) Anyone here developed demo apps I can see available in Apple iTunes store? (Even simple apps is okay as I onl...

Delphi XE4 - Firemonkey
I have an application that runs fine on windows, however when running on iOS simulator the onKeyUp event for a TEdit control is not being fired? Please advise if this event should get fired when running on iOS? This problem occurs onKeyUp events created directly on the control and by assigning the event programatically. Running XE4 update 1 iPhoneOS6.1.sdk Minimac: OS X 10.9 XCode 5 iOS Simulator Version 7.0 - iPad Retina / iOS 7.0.3(11B508) ...

Using ZBar with Delphi XE4 app for iOS
I found a free SDK to scan the QR-codes (http://zbar.sourceforge.net/) and I want to use in the my app for iOS, but I can't find an example of its use in delphi xe4 applications for ios. Is there a possibility of using the SDK for ios in delphi xe4 or use static libraries (*.a) for ios is not allowed? > {quote:title=Sergey Kukharev wrote:}{quote} > I found a free SDK to scan the QR-codes (http://zbar.sourceforge.net/) and I want to use in the my app for iOS, but I can't find an example of its use in delphi xe4 applications for ios. Is there a possibility of using the SDK for i...

Creating iOS Apps Using Delphi XE2 (webinar)
Register here: http://forms.embarcadero.com/forms/AMUSCA1206RADMobileWebinar6-06 Feel free to tune in tomorrow (June 6th) at 6am, 11am or 5pm PDT. That should be 1pm UTC, 6pm UTC and 12am (June 7th) in UTC. PS: MathViz 1.1 for iOS is now free in the AppStore. Enjoy! -- Anders Ohlsson - http://blogs.embarcadero.com/ao/ Embarcadero Developer Relations "A golf course that does not have a pub after the 18th hole is like an acupuncturist who does not offer needle removal." ...

Multiple views in an iOS app using FM forms
Has anyone been able to achieve switching views using multiple forms in iOS? I'm receiving a "EXC_BAD_ACCESS" error when attempting to hide one form and show another. I'm presuming that FPC or iOS isn't allowing an app to have more than one "form". I could probably implement it using multiple TPanels on the one form, however I'd prefer to avoid that as I think it would be harder to manage. -- Dave Nottage [TeamB] > {quote:title=Dave Nottage wrote:}{quote} > Has anyone been able to achieve switching views using multiple forms in iOS? > ...

Creating iOS Apps Using Delphi XE2 (webinar)
Register here: http://forms.embarcadero.com/forms/AMUSCA1206RADMobileWebinar6-06 Feel free to tune in tomorrow (June 6th) at 6am, 11am or 5pm PDT. That should be 1pm UTC, 6pm UTC and 12am (June 7th) in UTC. PS: MathViz 1.1 for iOS is now free in the AppStore. Enjoy! -- Anders Ohlsson - http://blogs.embarcadero.com/ao/ Embarcadero Developer Relations "A golf course that does not have a pub after the 18th hole is like an acupuncturist who does not offer needle removal." > {quote:title=Anders Ohlsson wrote:}{quote} > Register here: > > http://...

Delphi app in Apple App Store for iOS
Have you guys with iPhones and iPads seen that there is a Delphi produced app, running Interbase To Go, approved for download on the Apple App Store? I can't find a link on the web, but search "Embarcadero" on the app store and it shows up. (My daughter showed me. ;-) ) -- Nick > I can't find a link on the web, but search "Embarcadero" on the app > store and it shows up. (My daughter showed me. ;-) ) There are 6 apps that shows up... which one is it? - Palo Alto - Embarcadero (Fom Scott James, mapping software or something..) - Heart of...

Will be XE2 Firemonkey apps accepted in MAC App Store and iOS App Store?
I think it is a good question before purchase XE2. -- Il Sat, 22 Oct 2011 04:10:01 -0700, Rafael Ontivero <no@mail.com> ha scritto: >I think it is a good question before purchase XE2. Hi, have a look at this thread on embarcadero.public.delphi.firemonkey. https://forums.embarcadero.com/thread.jspa?messageID=401354&tstart=0#401354 Regards. Giuliano Yesssssss!!!!! THank you very much. It is reasonable that if more restricted iOS APP Store accepts them, MAC one will do too. On Mon, 24 Oct 2011 18:51:21 +0200, Giuliano . <bidoneaspiratu...

I can to install one not delphi program foir iOS into one iOS for delphi?
For example i have one programm builded as xcode for iOS, and i build one program as delphi for iOS. I want to have only one instalation, i can to add this xcode program into my delphi installer of my ios program? I can to do the same as android? how i can to to this? > {quote:title=oscar mejia wrote:}{quote} > For example i have one programm builded as xcode for iOS, and i build one program as delphi for iOS. I want to have only one instalation, i can to add this xcode program into my delphi installer of my ios program? > > I can to do the same as android? how i can to to...

Cannot deploy IOS app to IOS simulator
After upgrading my iPhone to IOS 8, installing XCode 6.0.1 on my Mac, and downloading the SDKs in the IDE, I get the error 'Session Start Error. Simulator session timed out' when I compile and deploy a demo app. The PS Server is running on the Mac and the connection tests successfully. This was all working prior to the IOS and XCode upgrade. Any ideas? Also since there are no 'Views' for the new iPhone 6 and iPhone 6 Plus I assume there might be an update that will include them. Is that the case? Thanks > {quote:title=quinn wildman wrote:}{quote} > At ...

Forms on an IOS app
I am looking for information about the UI and forms. My application needs 4 forms ( I am thinking as desktop developer ). I can't see any information about best practice to handle them on FM-IOS, or even if I should have just one form and work with different containers on this form. On the desktop side I usually create and destroy every application form, Can I keep doing this on the IOS ? Thanks. Le 18/08/12 20:27, jose carlos cunhajr a écrit : > I am looking for information about the UI and forms. > > My application needs 4 forms ( I am thinking as...

A warning to anyone who uses verisign vip access App iOS and android app
When you first open the application up it generates a "Credential ID" and then based off that ID starts generating Security codes. Now if say with Paypal you register that Credential ID and that security code you can then use this app on your smart phone as two factor authentication Accept, there is one problem If you ever, for any reason have to reinstall the application, it gives you a COMPLETELY DIFFERENT Credential ID and thus the app will no longer generate codes that will work with your sites you already have setup. Unlike the Google and Microsoft Authenticato...

IO::Socket, or any IO
------=_Part_110935_21218926.1156438461026 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I was thinking of rewriting a little webserver program I wrote in Perl 5 using Pugs. I was wondering what the equivilent (if any) of IO::Socket is. I suppose I could use an external webserver and use CGI to get this working with IO, but my preference would be a pure Perl 6 approach. If you're wondering, the program I wrote is a simple little webpage with two buttons so my wife can play music off my Linux box (with g...

Deploy iOS app (32/64) onto iPad, the app when clicked, crashed using XE8
Hi I have upgraded XE7 to XE8. Xcode is 6.3.2 I have update the iOS Simulator patch to run on iOS 8. Now, when i deploy the app onto my iPad, the app is shown on the iPad. Once when i click on the app, it open and suddenly closes again. How to debug such problem. I created a new app with just 1 TButton and it also gives me the same crashing problem Please help on how to debug such problem BTW, could Embarcadero specify what version of Xcode it requires to use. Although the requirement states Xcode 6. but Xcode 6.3.2 may not be able to work on the new XE8 without the patch. ...

Web resources about - How do I best use forms in iOS firemonkey apps? - embarcadero.delphi.ios

Firemonkeys - GamesIndustry International
The world's leading games industry website. Get insight from todays industry leaders with news, interviews and analysis of global gaming trends. ...

Firemonkey’s Real Racing 3 To Launch At The End Of February
In September, Apple demoed Firemonkey’s Real Racing 3 at the iPhone 5 event . Three months later and the game has yet to show up in the App Store. ...

EA Games and Firemonkey Bringing Real Racing 3 to Android, Fasten your Seat Belts
Start up your engines race fans, EA Games is teaming up with Firemonkey to bring Real Racing 3 to mobile devices. If you’re a fan of more realistic ...

EA's Firemint and IronMonkey Studios Merge to Become FireMonkeys
... game development studios into one mega-studio in Australia. Firemint and IronMonkeys will be merged into a single studio now known as Firemonkeys ...

News: Firemonkeys announces Real Racing 3
Firemonkeys, a new gaming subsidiary of Electronic Arts born from the merger of FireMint and IronMonkey, has announced the coming release of ...

firemonkeys - iMore
EA has pushed out another impressive update to its equally impressive iOS racer, Real Racing 3, that for the first time brings cars from Ferrari ...

Firemonkeys on Real Racing 3 going free-to-play
... got a hands-on preview of Real Racing 3. We also spoke with Ptolemy Oberin, one of the game’s programmers and project lead at developer Firemonkeys, ...

Real Racing 3 coming in 2012 from Firemonkeys
The first game from recently merged developer Firemonkeys is Real Racing 3 , the developer revealed moments ago during EA's Summer Showcase event ...

Firemonkeys Previews Real Racing 3 for iPhone and iPad
Firemonkeys, the new combined studio from EA combining the IronMonkey and Firemint gaming studios, has announced the development of Real Racing ...

EA Mobile Moves: IronMonkey & Firemint Merge Into “Firemonkeys,” Now Have 50M Players Between
... that it is merging two top mobile game studios, IronMonkey and Firemint , which will fittingly combine to create a new company, called Firemonkeys. ...

Resources last updated: 12/5/2015 9:20:42 PM