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

 

 

 

 

Taking a Photo:

 

#Copyright (c) 2008 Pankaj Nathani

#Setting the volume and position and getting duration


import audio, appuifw


def stop():
    global s
    s.stop()
    s.close()

s=audio.Sound.open("C:\\s.mp3")
#Show the current volume and the maximum volume
appuifw.note(u"Current volume %d" % s.current_volume())
appuifw.note(u"Max volume %d" % s.max_volume())
#Ask the user for new volume
v=appuifw.query(u"New volume", "number")
s.set_volume(v)

appuifw.note(u"The duration of this song is %d seconds" % int(s.duration()/1000000))

s.set_position(3) #3 seconds

appuifw.note(u"%d seconds have been played" % int(s.current_position())) #In this case 3.4 seconds

 

 

Recording Video:

 

#Copyright (c) 2008 Pankaj Nathani

#Recording video

import camera, e32, appuifw


#Define the exit function
app_lock=e32.Ao_lock()
def quit():
    camera.stop_finder()
    camera.release()
    app_lock.signal()
appuifw.app.exit_key_handler=quit

def video_callback(err, current_state):
    global c
if(current_state==camera.EPrepareComplete):c=1
else:pass

appuifw.app.body=appuifw.Canvas()

#Define a function for the viewfinder
def v_finder(im):
    appuifw.app.body.blit(im)

camera.start_finder(v_finder, size=(240,196))

vid=camera.start_record("C:\\movie.3gp", video_callback) #Start recording the video
#Record for 5 seconds and then stop
e32.ao_sleep(5)
camera.stop_record()

app_lock.wait()

 

 

Using the Viewfinder:

 

 

#Copyright (c) 2008 Pankaj Nathani

#Using the viewfinder

import camera, e32, appuifw
from graphics import *


#Define the exit function
app_lock=e32.Ao_lock()
def quit():
    camera.stop_finder() #Close the viewfinder
    camera.release() #Release the camera so other applications may use it
    app_lock.signal()
appuifw.app.exit_key_handler=quit

appuifw.app.body=appuifw.Canvas()

#Define a function for the viewfinder
def v_finder(im):
    appuifw.app.body.blit(im)

#Start the viewfinder
camera.start_finder(v_finder, size=(240,160))

app_lock.wait()

 
 

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