Python
  Home arrow Python arrow Page 4 - Mobile Programming in Python using PyS...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
Moblin 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
IBM developerWorks
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PYTHON

Mobile Programming in Python using PyS60: Getting Started
By: A.P.Rajshekhar
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 8
    2007-10-17

    Table of Contents:
  • Mobile Programming in Python using PyS60: Getting Started
  • Dynamically loadable libraries or extensions
  • Accessing Services, Step By Step
  • PyS60 Programming in the Real World

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now!

    Mobile Programming in Python using PyS60: Getting Started - PyS60 Programming in the Real World


    (Page 4 of 4 )

    The application to be developed will have the following functionalities:

      1. An Input box to accept the path for the file to be played.

      2. The ability to play a selected file when entered by the user.

    Here we go. First comes the imports. Since both UI and Sound are required, the appuifw and audio modules need to be imported.

    from appuifw import *

    import audio

    Next we need to show the entry box to the user and get the path entered by him or her. To display the text box, we can use the query component. The first argument is the prompt to be shown and the second argument is the type of query. The type can be ‘text’, ’date’, ’time’, ’float’ etc. Here the type will be text as we need textual data i.e. a string. The value returned by the query component will be stored in a variable named data. 

    from appuifw import *

    import audio

    data=query(u’Enter the path of the file to be played’, ‘text’)

    Now we need to load the file. For that we need to call the load method of sound. As discussed in the previous section every method in the sound module is static. We will also check whether the user clicked cancel. If cancel has been clicked, then data will contain null.

    from appuifw import *

    import audio

    data=query(u’Enter the path of the file to be played’, ‘text’)

    if data is not Null:

    Sound.load(data)

    else:

    note(u’Give the path name’, ‘info’)

    Next let us tell Symbian to play it.

    from appuifw import *

    import audio

    data=query(u’Enter the path of the file to be played’, ‘text’)

    if data is not Null:

    Sound.load(data)

    Sound.play()

    else:

    note(u’Give the path name’, ‘info’)

    That completes our application. Though it is small, it introduces several important concepts of PyS60. In the coming discussions, I will go into more depth on each module. Till then…


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · in this discussion I have introduced the basic concepts of PyS60 programming. Please...
       · Good article and a nice kick start for programming with PyS60. Waiting for this for...
       · Dear Sir: This is Raghu from E-security team , C-DAC .. Nice to see ur...
     

       

    PYTHON ARTICLES

    - SSH with Twisted
    - Mobile Programming in Python using PyS60: UI...
    - Python: Count on It
    - Python Strings: Spinning Yarns
    - Python: More Fun with Strings
    - Python: Stringing You Along
    - Python Operators
    - Bluetooth Programming in Python: Network Pro...
    - Python Sets
    - Python Conditionals, Lists, Dictionaries, an...
    - Python: Input and Variables
    - Introduction to Python Programming
    - Mobile Programming in Python using PyS60: Ge...
    - Bluetooth Programming using Python
    - Finishing the PyMailGUI Client: User Help To...




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway