Bada tutorial: Meet the Containers
Hmm... "Meet the Container !" :O What will be going on today!! :)
Yes, today we will be looking on to all the containers. Because whatever application you develop you must need to deal with various types of containers. After all containers are the things that will hold all our component and show those on the screen.
Lets look at the following picture.
A total black window and a button saying "OK".
At first lets find out how many components are there. What do you say? Well would you say like following?
- A dark black window.
- A button.
is there anything else? Ok, lets look at the following one:
( Focus on "Frame" and "Form" only )
So you identified the "Frame" and "Form", right ? ( encircled ).
Yes these two are the most common companion for any BADA app developer. As you can see, your application must have a (only one) Frame on the very base. And then you need Form. An application can have multiple forms. Say your application have three screens. Then you will need three different forms. And to show a screen you just need to set the corresponding form in the frame.
If you already launched the "Basic App" from BADA Sample projects, then you will find three screens under this application. So they used three forms for these three screens and showing one at a time.
Once you have the form ready to use, you can add different controls( Button, Label etc ) over it.
Now back to our first picture ( A button on a single black window ). How many components are there? Right!!
- A Frame,
- A Form ( on the Frame ),
- A button ( on the Form )
So basically, if we try to define "What is a Frame?" then we would say that,
- it is something which holds the whole application window.
- It listens the event of changing phone orientation ( portrait or landscape ).
- It contains different forms.
And "What is a Form?",
- In the same way form is something which holds all the other controls like Button, Label, EditField, EditArea etc ).
- Even though Form itself is a Container, it can hold another Container also, like ScrollPanel, OverlayPanel etc.
Hope this article was helpful to understand the basic containers. On the next post we will be having idea on the anatomy of any BADA Application. Till then ... take care & keep tuned :)