You Are Here:

Community: Wiki

This page was last modified on 23 September 2009, at 15:16.

How read SMS in the inbox

From Forum Nokia Wiki

Reviewer Approved   
Reviewer Approved   



ID Creation date March 19, 2007
Platform S60 3rd Edition Tested on devices Nokia N96
Category Python Subcategory Messaging


Keywords (APIs, classes, methods, functions): inbox, SMS

Overview

Python provides inbox module to read SMS from your phone Inbox. It can also notify you when a new message arrives in your Inbox.

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

Related Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
User Rating: qfnZuserE5FratingQNx4E2E0000X