Start PyS60 Tutorials PyS60 Talks Applications Buzz Us Blog

 

Notification, Menus and Forms. Canvas, Content Handler and Queries. Set application title, tabs and set application body. Application screen size and Application Orientation. Text to speech, Playing and Recording sounds and setting volume. Taking a Photo, Recording Video and Using Viewfinder. Accessing Contacts and Adding - Deleting Contact entries. Using the e32 Module. Drawing, Opening and Editing an Image. Checking the Inbox, Reading SMS, Deleting SMS and Waiting for a SMS. Setting Logs, Retrieving Last missed calls, Retrieving Last SMS. Sending SMS, MMS, Email. Battery and Signal, Free Ram and Free Space, IMEI and firmware, phones, display, etc. Making a call, Hanging up calls, Waiting for a call. Displaying Text and showing an Image on a Window. Avoiding Python to be terminated by Red Key and Hiding the shell. Global Notifications and Queries.

 

 

      ADVERTISEMENT

 

 

 

 

Accessing Contacts:

 

#Copyright (c) 2008 Pankaj Nathani

#Getting the number and email address of a certain contact

import contacts


#Open the contacts database
c=contacts.open()

#Find the contact by name
person=c.find("Eric")[0]

#Get the number
no=person.find('mobile_number')[0].value #The first number only
print "Number: "+str(no)

#And the email address
eaddress=person.find('email_address')[0].value
print "Email: "+str(eaddress)

 

 

Adding - Deleting Contact entries:

 

#Copyright (c) 2008 Pankaj Nathani

#Adding and deleting contacts

import contacts


#Open the contacts database
c=contacts.open()

#Add new contact's details
n=c.add_contact()
n.add_field('first_name', 'Angelina')
n.add_field('mobile_number', '0123456789')
#And save the changes
n.commit()

#Now we delete it:
#Get its ID
d=c.find('Angelina')[0]
id=d.id
#Delete it
c.__delitem__(id)

 

 

       Copyright © Croozeus.com All rights reserved.                                                                                                                        Webdesign: Jackson Productions