×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    61

    inbox issues (no content) in emulator

    Hi,

    I'm building an application who uses inbox. I cath the sms incoming, but when I want to print the content, it's void.
    Other info, like time, or msg_id is OK.
    I use a message I compose in the emulator (a draft), then I copy it to smsin folder. The message ca be readed right in the emulator with the messaging app, so it seems the message is OK.

    here is my code:

    Code:
    import appuifw, e32, inbox
    
    def SMS_received(msg_id):
        mybox = inbox.Inbox()
        print msg_id    # ok
        print u"content: " + mybox.content(msg_id) # no content here!
        print u"time: " + str(mybox.time(msg_id)) # ok
    
    
    def exit():
        app_lock.signal()
    
    box = inbox.Inbox()
    box.bind(SMS_received)
    appuifw.app.title = u"Receive SMS"
    appuifw.app.exit_key_handler = exit
    app_lock = e32.Ao_lock()
    
    print "waiting for sms."
    
    app_lock.wait()
    Am I doing something wrong or is it an emulator bug?

    Regards.

  2. #2
    Super Contributor
    Join Date
    Feb 2008
    Location
    Belo Horizonte, Brazil
    Posts
    744

    Re: inbox issues (no content) in emulator

    Well, I'm not sure if this should work on emulator. Don't you have a device for testing?

    Helpful links:

    Inbox Sender
    How to read SMS in the inbox

  3. #3
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    61

    Re: inbox issues (no content) in emulator

    Thanks Rafael,

    It seems like the problem is that the message content is not available at the event time. You must to wait for the message to be abailable (anyone knows why?).
    I have solved it waiting some seconds (one second seems to be enought). Any better solution?

    Here is the new code:

    Code:
    import e32, inbox, appuifw
    
    def SMS_received(msg_id):
        global message_id
        message_id = msg_id
        e32.ao_sleep(5, proccess_sms)
            
    def proccess_sms():
        mybox = inbox.Inbox()
        content = unicode(mybox.content(message_id))
        time = mybox.time(message_id)
        address = unicode(mybox.address(message_id))
        print message_id
        print time
        print content
    
    def exit():
        app_lock.signal()
    
    box = inbox.Inbox()
    box.bind(SMS_received)
    appuifw.app.title = u"Receive SMS"
    appuifw.app.exit_key_handler = exit
    app_lock = e32.Ao_lock()
    
    print "waiting for sms."
    
    app_lock.wait()
    Quote Originally Posted by Rafael T. View Post
    Well, I'm not sure if this should work on emulator. Don't you have a device for testing?

    Helpful links:

    Inbox Sender
    How to read SMS in the inbox
    Last edited by albgarse; 2009-01-14 at 15:05.

  4. #4
    Super Contributor
    Join Date
    Nov 2007
    Location
    Sertaozinho/Brazil
    Posts
    768

    Re: inbox issues (no content) in emulator

    It seems like the problem is that the message content is not available at the event time. You must to wait for the message to be abailable (anyone knows why?).
    I have solved it waiting some seconds (one second seems to be enought). Any better solution?
    I had the same problem but not inside the emulator (no solution yet). I will try your sleep hack and give some feedback to this post.

Similar Threads

  1. Content through emulator to screen
    By mobilemediafluency in forum General Development Questions
    Replies: 3
    Last Post: 2007-06-23, 01:46
  2. HTTP Connection with Series 60s emulator
    By emil02 in forum Mobile Java General
    Replies: 0
    Last Post: 2003-04-20, 22:38
  3. Replies: 0
    Last Post: 2003-04-08, 14:08
  4. Series 60 Emulator SMS issues
    By ilkas in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2002-06-25, 06:22
  5. Inbox in Series60 emulator?
    By Marw_Work in forum Symbian
    Replies: 0
    Last Post: 1970-01-01, 02:00

Posting Permissions

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