You Are Here:

Community: Developer Discussion Boards

#1 Old Question How to open image from within the inbox - 2007-08-28, 06:07

Join Date: Jul 2007
Posts: 16
ululazmi
Offline
Registered User
I have a code that send an image through bluetooth OBEX from a phone to another. Now i want the receiving phone to display the image received which will go into the inbox.
anybody can show me how to achieve this in python?

thanks in advance
Reply With Quote

#2 Old Re: How to open image from within the inbox - 2007-09-11, 18:21

Join Date: May 2007
Posts: 2,739
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
Hey ululazmi

By images in the inbox do u mean the mms files u receive through GPRS or do u mean a file from other device through BT?

Please Specify.

-Pankaj Nathani
Reply With Quote

#3 Old Re: How to open image from within the inbox - 2007-09-13, 10:50

Join Date: Jul 2007
Posts: 16
ululazmi
Offline
Registered User
hi croozeus,
thanks for the reply, at last
the image is from other phone through BT OBEX
Reply With Quote

#4 Old Re: How to open image from within the inbox - 2007-09-13, 15:06

Join Date: May 2007
Posts: 2,739
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
Hello ululazmi

Now u wont have to wait for replies bcoz i am here.We so u want it to be transferred through BT OBEX...
What code are u running on the server and the client?

Try this code:

For server
Quote:
# This script lets 2 phones exchange a file via OBEX.
# This is the server, the corresponding client is obex_client.py
from socket import *
import appuifw

# Create a bluetooth socket in waiting state to be connected to
s = socket(AF_BT, SOCK_STREAM)
port = bt_rfcomm_get_available_server_channel(s)
print "Binding service to port %s"%port
s.bind(("", port))
print "Service bound."

# Advertise the OBEX service, so it can be seen by other phones
service_name=u"Test OBEX service"

print "Advertising service as %s"%repr(service_name)
bt_advertise_service(service_name, s, True, OBEX)

try:
print "Setting security to AUTH."
set_security(s, AUTH)

receive_path = u"c:\\obex.txt"
print "Receiving file."
bt_obex_receive(s, receive_path)
print "File received."

import e32
e32.ao_sleep(1)
finally:
print "Stopping service advertising."
bt_advertise_service(service_name, s, False, OBEX)

print "Closing socket."
s.close()
print "Socket closed."
print "Finished."

Moreover u also Need to run the following script on the client

For Client
Quote:
# this file lets 2 phones exchange a file via OBEX
# this file is the client side
# the corresponding server side file is called obex_server.py

from socket import *
import appuifw
import e32

# JL: you don't need a socket for this!
## create socket
#s=socket(AF_BT,SOCK_STREAM)

# scan for other phones offering OBEX service
addr,services=bt_obex_discover()
print "Discovered: %s, %s"%(addr,services)
if len(services)>0:
choices=services.keys()
choices.sort()
choice=appuifw.popup_menu([unicode(services[x])+": "+x
for x in choices],u'Choose port:')
port=services[choices[choice]]
else:
port=services[services.keys()[0]]
address=(addr,port)

# create file to be sent
send_path = u"c:\\test.txt"
f=open(send_path, 'w')
f.write("hello")
f.close() # NOTE: parens were missing here before!

# send file via OBEX
print "Sending file %s to host %s port %s"%(send_path, address[0], address[1])
bt_obex_send_file(address[0], address[1], send_path)
print "File sent."
MoreOver u must have the Bluetooth devices paired befor hand and also authorized. I hope u get what all i said.

Hope that helps,


-Pankaj Nathani
Reply With Quote

#5 Old Re: How to open image from within the inbox - 2007-09-14, 06:20

Join Date: Jul 2007
Posts: 16
ululazmi
Offline
Registered User
thanks for the reply
but the question remain
is it possible to open an image from from within the inbox?,
I doubt it though
so i'll try to find another work around
thanks for the snippet
i've read the client-server BT OBEX python code in mobilenin's website as well
Reply With Quote

#6 Old Re: How to open image from within the inbox - 2007-09-14, 14:39

Join Date: May 2007
Posts: 2,739
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
Quote:
Originally Posted by ululazmi View Post
thanks for the reply
but the question remain
is it possible to open an image from from within the inbox?,
I doubt it though
so i'll try to find another work around
thanks for the snippet
i've read the client-server BT OBEX python code in mobilenin's website as well
Hey ululazmi

I got the answer to ur problem.
See the files in the inbox are stored in a folder having path

Quote:
E:/system/Mail/...
If u can get the subfolders after the mail directory i mean then u know the whole path of an image file on a Memory card (in this case as path is E.
So u can acccess a file from there.
But u got to find the whole path....I will provide u with more info when i am updated..

Hope that helps a bit,

-Pankaj Nathani
Last edited by croozeus : 2007-09-14 at 14:40. Reason: Mistype
Reply With Quote

#7 Old Re: How to open image from within the inbox - 2007-09-16, 08:36

Join Date: Jul 2007
Posts: 16
ululazmi
Offline
Registered User
croozeus,
i still didn't manage to find the
Quote:
E:/system/Mail/...
directory
Reply With Quote

#8 Old Re: How to open image from within the inbox - 2007-09-19, 10:37

Join Date: May 2007
Posts: 2,739
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
@Ululazami

What memory u use for Messages? I mean the inbox.
Is it the Phone memory or the Memory card...If u use the phone memory then lookin into folder..

Quote:
E:/system/Mail/...
Hope it helps,

-Pankaj Nathani
Reply With Quote

#9 Old Re: How to open image from within the inbox - 2007-09-23, 06:12

Join Date: Jul 2007
Posts: 16
ululazmi
Offline
Registered User
Quote:
Originally Posted by croozeus View Post
@Ululazami

What memory u use for Messages? I mean the inbox.
I use my meory card for inbox
still can't find the folder

~azmi
Reply With Quote

#10 Old Re: How to open image from within the inbox - 2007-09-23, 07:19

Join Date: May 2007
Posts: 2,739
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
@ululazmi

Seems to be getting longer..Here is a screenshot of my phone..May be that will help u to find the folder..
http://croozeus.googlepages.com/FEscr031.jpg

Hope it helps
Reply With Quote

#11 Old Re: How to open image from within the inbox - 2007-09-24, 01:02

Join Date: Jun 2005
Posts: 382
y.a.k
Offline
Regular Contributor
If he's using a 3rd edition phone than he won't have the system folder.
Reply With Quote

#12 Old Re: How to open image from within the inbox - 2007-09-24, 08:11

Join Date: May 2007
Posts: 2,739
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
Hey ululazmi

Thats Right y.a.k.
ululazmi which phone do you use? May be you are using a 3rd edition phone.
Reply With Quote

#13 Old Re: How to open image from within the inbox - 2007-09-25, 09:36

Join Date: Jul 2007
Posts: 16
ululazmi
Offline
Registered User
sorry it takes longer for me to reply
somehow i can't login to the forum from my mobile phone anymore

Quote:
Originally Posted by croozeus View Post
Hey ululazmi

Thats Right y.a.k.
ululazmi which phone do you use? May be you are using a 3rd edition phone.
and yes
i use 2 3rd edition devices: Nokia E61 and Nokia 5500

~azmi
Reply With Quote

#14 Old Re: How to open image from within the inbox - 2007-09-25, 09:51

Join Date: May 2007
Posts: 2,739
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
@ululazmi

Well then there you go.You wont have a system folder. I am wondering where will the SMS files be stored if 3rd edition phones donot have a system/mail folder.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I open an image from .mbm file? llapplecn Python 4 2005-07-19 18:50
saving jpeg image on grid list flicker82 General Symbian C++ 0 2005-01-21 05:22
open image file Rx-lee General Symbian C++ 3 2004-04-02 04:29
Image Uploader / Image Downloader / Image Server kehong General Symbian C++ 0 2003-05-12 18:38
Can we open an image stored in the images folder of the 7650? sbleriot Mobile Java Tools & SDKs 2 2003-04-01 17:42

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia