Send a picture using Bluetooth

Description:

This example shows how to take a picture and send it using Bluetooth (OBEX).  The script uses camera, e32, socket and graphics modules.

###################################################
#Python examples for AAU Mobile Phone Programming #
#(c) Mobile Phone Group #
###################################################

import camera,e32
from graphics import *
from socket import *
def main_menu():
appuifw.app.menu = [(u"Start", Start),(u"Exit",app_exit)]
def Start():
appuifw.app.body=old_body
image= camera.take_photo()
appuifw.app.body=c=appuifw.Canvas()
c.blit(image,scale=1)
file= (u'c:\\Nokia\\Images\\pic001.jpg')
image.save(file)
device=bt_obex_discover()
address=device[0]
channel=bt_obex_discover(address)[1][u'OBEX Object Push']
bt_obex_send_file(address,channel,file)
appuifw.app.body=c=appuifw.Canvas()
c.blit(image,scale=1)

def app_exit():
appuifw.app.set_exit()
old_body=appuifw.app.body
lock = e32.Ao_lock()
appuifw.app.title = u"BT example"
main_menu()
lock.wait()

Download

ex5.py

Output:

The following screenshots are the outcome. Just click on the icons to enlarge them for a better view.

Output

Department of Electronic Systems | Aalborg University | Niels Jernes Vej 12 | DK-9220 Aalborg | Denmark
Phone: (+45) 9635 8695 | Fax (+45) 9815 1583 | E-mail ies(at)ies.aau.dk
Copyright © 2006 Department of Electronic Systems

Last update:02-10-2006