×

Discussion Board

Results 1 to 4 of 4

Thread: Send Text

  1. #1
    Regular Contributor
    Join Date
    Sep 2007
    Posts
    72

    Send Text

    Hello,

    I want to send some text (Finally from a text file) from my Mobile device to my Computer.
    How could I accomplish this?
    I have the connecctivity option as Bluetooth.

    Thanks in advance.

  2. #2
    Regular Contributor
    Join Date
    Mar 2008
    Location
    Bangalore, India
    Posts
    68

    Re: Send Text

    This is a code to connect a Mobile device to a PC using Bluetooth.
    import bluetooth
    import pyosd
    from time import sleep


    p = pyosd.osd()
    p.set_pos(pyosd.POS_MID)
    p.set_align(pyosd.ALIGN_CENTER)
    p.set_colour("green")
    p.display( "Scanning for bluetooth device")

    nearby_devices = bluetooth.discover_devices(duration=20, lookup_names = True)

    str= "found %d devices" % len(nearby_devices)

    print str
    p.display(str)
    sleep(2)

    for name, addr in nearby_devices:
    p.display( " %s - %s" % (addr, name))
    print (" %s - %s" % (addr,name))
    sleep(2)

    You can also follow the link which shows how to send a picture file over a bluetooth.

    http://wiki.forum.nokia.com/index.ph...over_bluetooth
    "Nobody will believe in you unless you believe in yourself."

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

    Re: Send Text

    Quote Originally Posted by rabaf View Post
    Hello,

    I want to send some text (Finally from a text file) from my Mobile device to my Computer.
    How could I accomplish this?
    I have the connecctivity option as Bluetooth.

    Thanks in advance.
    Hi,

    You could use the Code below to send text from your Mobile to PC using Bluetooth,

    Here it accepts text input from appuifw.query to get the input text, you can also read text from a text file on the Phone.

    Code:
    import appuifw
    import socket
    import e32
     
     
    def bt_connect():
        global sock
        sock=socket.socket(socket.AF_BT,socket.SOCK_STREAM)
        target=''
        if not target:
            address,services=socket.bt_discover()
            print "Discovered: %s, %s"%(address,services)
            if len(services)>1:
                import appuifw
                choices=services.keys()
                choices.sort()
                choice=appuifw.popup_menu([unicode(services[x])+": "+x
                                            for x in choices],u'Choose port:')
                target=(address,services[choices[choice]])
            else:
                target=(address,services.values()[0])
        print "Connecting to "+str(target)
        sock.connect(target)
        print "OK."
     
        bt_typetext()
            
     
    def bt_typetext():
        global sock
        test = appuifw.query(u"Type words", "text", u"")
        if test == None:
            exit_key_handler()
        else:
            sock.send(test)
            bt_typetext()
     
    def exit_key_handler():
        script_lock.signal()
        appuifw.app.set_exit()
     
    appuifw.app.title = u"Mob to PC"
     
    script_lock = e32.Ao_lock()
     
    appuifw.app.exit_key_handler = exit_key_handler()
     
    bt_connect()
     
    script_lock.wait()
    Best Regards,
    Croozeus
    Pankaj Nathani
    www.croozeus.com

  4. #4
    Registered User
    Join Date
    Dec 2007
    Posts
    104

    Re: Send Text

    Croozeus,

    Can I get the code for same, but to send via serial port??


    Thanks in Advance,
    Chander

Similar Threads

  1. Exit form from edit mode
    By tqchcm in forum Symbian User Interface
    Replies: 13
    Last Post: 2007-10-31, 06:06
  2. Nokia 6600 Socket Server send delay Problem
    By dicson_hu in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2005-10-31, 07:37
  3. How to send national chars via SMS in text mode
    By stabnokia in forum General Messaging
    Replies: 1
    Last Post: 2002-10-07, 06:16
  4. how to send text content as hex encoded?
    By kaanerdemir in forum Smart Messaging
    Replies: 1
    Last Post: 2002-07-22, 07:39
  5. Can I send sms messages with no body text?
    By wonderland7 in forum General Messaging
    Replies: 1
    Last Post: 2001-12-06, 18: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
  •  
×