Archived:How read SMS in the inbox using PySymbian
Aquivado: Este artigo foi arquivado, pois o conteúdo não é mais considerado relevante para se criar soluções comerciais atuais. Se você achar que este artigo ainda é importante, inclua o template {{ForArchiveReview|escreva a sua justificativa}}.
All PySymbian articles have been archived. PySymbian is no longer maintained by Nokia and is not guaranteed to work on more recent Symbian devices. It is not possible to submit apps to Nokia Store.
All PySymbian articles have been archived. PySymbian is no longer maintained by Nokia and is not guaranteed to work on more recent Symbian devices. It is not possible to submit apps to Nokia Store.
Article Metadata
Tested with
Devices(s): Nokia N96
Compatibility
Platform(s): S60 3rd Edition
Article
Keywords: inbox, SMS
Created: cyke64
(19 Mar 2007)
Last edited: hamishwillee
(08 May 2013)
Contents |
Code
Read Message
# import module
import inbox
i = inbox.Inbox()
m = i.sms_messages() # all message ID's
content_m=i.content(m[0]) # first message
print i.time(m[0]) # arrive time
print i.address(m[0]) # Only name is given :(
Notification on New Message
- The following function will five a note whenever a new message will arrive. If we use globalui module then we will have a global notification, irrespective of our application being in background.
# import modules
import inbox
import appuifw
import e32
# Give note on new message
def message(msgid):
box = inbox.Inbox()
appuifw.note(u"A new message:\n %s" % box.content(msgid))
app_lock.signal()
# bind inbox to new message event
box = inbox.Inbox()
box.bind(message)
# Wait for Exit
app_lock = e32.Ao_lock()
app_lock.wait()


23 Sep
2009
23 Sep
2009