Archived:Basic PySymbian application - series1
Mobile applications we know are very interesting and attractive. This article series will help a beginner to develop a good mobile application using the Python for the S60 platform.
The first series will make us understand the structure of an application. A good mobile application developer must have a clear vision about the application structure s/he wants to design.
The figure below tells us about the application structure of a PySymbian application. A good developer at the time of designing a application should always keep this application structure in mind and should try to port his application according to the figure below.
The figure above tells most part of the story, and we will also make lesson out of it.
- At the top of the figure you can see the application title. That's the portion of our application one should set the title. In PySymbian, we can set the title by using.
appuifw.app.title = u"My First App"
- The navigation tabs are below the title. If you would like to use tabs in your application, look here.
Below navigation tabs comes the body of the application, which is indeed the most important part of the application. In PySymbian, basically four kinds of objects can be assigned to the body part:
- A canvas that handles graphics on screen.
- A form that is used to built a complex forms that include combination of various fields such as text numbers and lists.
- A text object that handles a free form text input.
- A listbox that shows a list of items with
Inside the body of the application we can see a dialog window. In a dialog window we can handle the application input and output. In PySymbian we have queries, notes and much more. Below is a code example.
Menu & Exit
After every thing there leaves the two important aspects in our application they are
Access To The Left Soft Key
Access To The Right Soft Key
We can use the the left soft key in our application to access the options or the application menus. In PySymbian, we can do as following:
The right soft key in our Python application is used to exit our application. In PySymbian, we can do it as:
appuifw.exit_key_handler = function
where function is a callback function that is called when the left key is pressed.