×
Namespaces

Variants
Actions
(Difference between revisions)

Archived:Basic PySymbian application - series1

From Nokia Developer Wiki
Jump to: navigation, search
gaba88 (Talk | contribs)
(New page: Category:S60Category:Python ==Introduction== Mobile applications we know are very interesting and attractive. And at the same time mobile application development is the again the ...)
 
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot update - Add ArticleMetaData)
(12 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Category:S60]][[Category:Python]]
+
{{ArticleMetaData <!-- v1.2 -->
 +
|sourcecode= <!-- Link to example source code e.g. [[Media:The Code Example ZIP.zip]] -->
 +
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
 +
|devices= <!-- Devices tested against - e.g. ''devices=Nokia 6131 NFC, Nokia C7-00'') -->
 +
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Qt SDK 1.1.4]) -->
 +
|platform= <!-- Compatible platforms - e.g. Symbian^1 and later, Qt 4.6 and later -->
 +
|devicecompatability= <!-- Compatible devices e.g.: All* (must have internal GPS) -->
 +
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
 +
|signing= <!-- Signing requirements - empty or one of: Self-Signed, DevCert, Manufacturer -->
 +
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
 +
|keywords= <!-- APIs, classes and methods (e.g. QSystemScreenSaver, QList, CBase -->
 +
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
 +
|translated-by= <!-- [[User:XXXX]] -->
 +
|translated-from-title= <!-- Title only -->
 +
|translated-from-id= <!-- Id of translated revision -->
 +
|review-by= <!-- After re-review: [[User:username]] -->
 +
|review-timestamp= <!-- After re-review: YYYYMMDD -->
 +
|update-by= <!-- After significant update: [[User:username]]-->
 +
|update-timestamp= <!-- After significant update: YYYYMMDD -->
 +
|creationdate= 20080717
 +
|author= [[User:Gaba88]]
 +
}}
 +
[[Category:Symbian]][[Category:PySymbian]]
  
 
==Introduction==
 
==Introduction==
Mobile applications we know are very interesting and attractive. And at the same time mobile application development is the again the most interesting thing. This series of article will help a beginner to develop a good mobile application using the Python for Series60 Platform. A good mobile application developer before designing its application or in clear words before a developer starts coding with the application he must be clear about the application structure of the application which he wants to design. As we are in the PyS60 section this article will focus on the application structure for PyS60 app.
+
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.
  
 
==Application Structure==
 
==Application Structure==
  
The figure below below will tell us about the application structure of a PyS60 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 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.
[[Image:Appli_struct.jpg]]
+
 
 +
[[File:Appli struct.jpg]]
  
 
==Explanation==
 
==Explanation==
  
The figure above tells most part of the story then also we will make lesson out of it.
+
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 that title is written. Thats the portion of our application one should set the title of the application. In PyS6o we can set the title by using.  
+
* 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.  
 
<code python>
 
<code python>
 
appuifw.app.title = u"My First App"
 
appuifw.app.title = u"My First App"
 +
 
</code>
 
</code>
  
* The next to the title is the navigation tabs we can set tabs UI if we want that kind in our application to know how to set a tabs interface  [http://wiki.forum.nokia.com/index.php/How_to_use_tabs look here].
+
* The navigation tabs are below the title. If you would like to use tabs in your application, [[How to use tabs|look here]].
  
 
==Body==
 
==Body==
  
Below navigation tabs comes the body of the application which is indeed the most important part of the application. In PyS60 we can assign the body of our application to basically four types they are;
+
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 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 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 text object that handles a free form text input.
 
 
* A listbox that shows a list of items with  
 
* A listbox that shows a list of items with  
  
 
==Dialog==
 
==Dialog==
  
Inside the body of the application we can see a dialog window. In a dialog window we can handle the input and output things of our application. In PyS60 we have queries, notes and much more to do this. Below is a code example.
+
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.
  
 
<code python>
 
<code python>
appuifw.query(u"GO","query")
+
appuifw.query(u"GO","query")
appuifw.note(u"stop","info")
+
 
 +
appuifw.note(u"stop","info")
 
</code>
 
</code>
  
Line 47: Line 72:
 
'''Access To The Right Soft Key'''
 
'''Access To The Right Soft Key'''
  
We can use the the left key in our application to access the options or the menus of our application. In PyS60 we can do as following:
+
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:
 
<code python>
 
<code python>
 
appuifw.app.menu=[(u"menu1",callback_1),
 
appuifw.app.menu=[(u"menu1",callback_1),
Line 53: Line 78:
 
</code>
 
</code>
  
The right soft key in our Python application is used to exit our application. In PyS60 we can do it as:
+
The right soft key in our Python application is used to exit our application. In PySymbian, we can do it as:
 
<code python>
 
<code python>
 
appuifw.exit_key_handler = function
 
appuifw.exit_key_handler = function
 
</code>
 
</code>
 
where function is a callback function that is called when the left key is pressed.
 
where function is a callback function that is called when the left key is pressed.
 +
 +
==Helpful Links==
 +
 +
* [[How to use tabs]]
 +
 +
* [[How to draw on canvas]]
 +
 +
* [[How to use Form in PySymbian|How to use Forms]]
 +
 +
* [[Basic PySymbian Application: Series2|Basic PySymbian Application Series2]]
 +
 +
* [[Basic PySymbian Application: Series3|Basic PySymbian Applications series3]]

Revision as of 05:39, 27 July 2012

Article Metadata
Article
Created: gaba88 (17 Jul 2008)
Last edited: hamishwillee (27 Jul 2012)

Contents

Introduction

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.

Application Structure

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.

Appli struct.jpg

Explanation

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.

Body

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

Dialog

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.

appuifw.query(u"GO","query")
 
appuifw.note(u"stop","info")

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:

appuifw.app.menu=[(u"menu1",callback_1),
(u"menu2",callback_2)]

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.

Helpful Links

69 page views in the last 30 days.