×

Discussion Board

Results 1 to 14 of 14
  1. #1
    Registered User
    Join Date
    Jul 2007
    Posts
    16

    Question How to open image from within the inbox

    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

  2. #2
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,800

    Re: How to open image from within the inbox

    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

  3. #3
    Registered User
    Join Date
    Jul 2007
    Posts
    16

    Re: How to open image from within the inbox

    hi croozeus,
    thanks for the reply, at last
    the image is from other phone through BT OBEX

  4. #4
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,800

    Re: How to open image from within the inbox

    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
    # 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
    # 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

  5. #5
    Registered User
    Join Date
    Jul 2007
    Posts
    16

    Re: How to open image from within the inbox

    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

  6. #6
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,800

    Re: How to open image from within the inbox

    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

    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 13:40. Reason: Mistype

  7. #7
    Registered User
    Join Date
    Jul 2007
    Posts
    16

    Re: How to open image from within the inbox

    croozeus,
    i still didn't manage to find the
    E:/system/Mail/...
    directory

  8. #8
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,800

    Re: How to open image from within the inbox

    @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..

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

    -Pankaj Nathani

  9. #9
    Registered User
    Join Date
    Jul 2007
    Posts
    16

    Re: How to open image from within the inbox

    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

  10. #10
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,800

    Re: How to open image from within the inbox

    @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
    Pankaj Nathani
    www.croozeus.com

  11. #11
    Registered User
    Join Date
    Jun 2005
    Posts
    386

    Re: How to open image from within the inbox

    If he's using a 3rd edition phone than he won't have the system folder.

  12. #12
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,800

    Re: How to open image from within the inbox

    Hey ululazmi

    Thats Right y.a.k.
    ululazmi which phone do you use? May be you are using a 3rd edition phone.
    Pankaj Nathani
    www.croozeus.com

  13. #13
    Registered User
    Join Date
    Jul 2007
    Posts
    16

    Re: How to open image from within the inbox

    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

  14. #14
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,800

    Re: How to open image from within the inbox

    @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.
    Pankaj Nathani
    www.croozeus.com

Similar Threads

  1. How can I open an image from .mbm file?
    By llapplecn in forum Symbian
    Replies: 4
    Last Post: 2005-07-19, 17:50
  2. saving jpeg image on grid list
    By flicker82 in forum Symbian
    Replies: 0
    Last Post: 2005-01-21, 04:22
  3. open image file
    By Rx-lee in forum Symbian
    Replies: 3
    Last Post: 2004-04-02, 03:29
  4. Replies: 0
    Last Post: 2003-05-12, 17:38
  5. Can we open an image stored in the images folder of the 7650?
    By sbleriot in forum Mobile Java Tools & SDKs
    Replies: 2
    Last Post: 2003-04-01, 16:42

Posting Permissions

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