×
Namespaces

Variants
Actions
(Redirected from How read SMS in the inbox)

Archived:How read SMS in the inbox using PySymbian

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngAquivado: 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.

Python provides inbox module to read SMS from your phone Inbox. It can also notify you when a new message arrives in your Inbox.
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 (14 Jun 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()

Related Links

This page was last modified on 14 June 2013, at 09:34.
89 page views in the last 30 days.