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

 

 

 

 

Using the e32 Module:

 

#Copyright (c) 2008 Pankaj Nathani

#Checking Python version and whether the aplication is running on an emulator

import e32

print e32.pys60_version
#Returns a string, like "1.4.2 final"

if(e32.in_emulator()==1):
    print "Running on an emulator"
else:
    print "Running on a real device"

 

#Copyright (c) 2008 Pankaj Nathani

#Copying a file

#General form: file_copy(target_name, source_name)

import e32

e32.file_copy("C:\\myimage.JPG", "C:\\Data\\Images\\myimage.jpg")
#This copies the file myimage.jpg, located in C, to the folder C:\Data\Images

 

 

#Copyright (c) 2008 Pankaj Nathani

#Discovering the available drives

#This is how to show what drives are available in the device (phone memory and/or memory card)

import e32

print e32.drive_list() #Returns a list with "C:" for phone storage and/or "E:" for memory card

 

 

#Copyright (c) 2008 Pankaj Nathani

#Handling inactivity time and setting device's time

#After a certain period of inactivity, the device's screen becomes dark
#You can check how long it has been since the last event and reset this period

import e32

print e32.inactivity() #Seconds since the user was last active

e32.reset_inactivity() #Resets the inactivity period to 0; useful for keeping screen light on

#You can also set the phone's time (note that you need WriteDeviceData capability) using:
#e32.set_home_time(new_time) where new_time is in Unix timestamp format (seconds since 01.01.1970, 00:00:00)
#For example,
e32.set_home_time(1134742324) #sets the time to 16.12.2005, 16:12:04

 

 

#Copyright (c) 2008 Pankaj Nathani

#Waiting

#If your application needs to pause before doing something

import e32

e32.ao_sleep(10) #Does nothing for 10 seconds
print "This message appeared after 10 seconds from starting the application"

 

 

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