×
Namespaces

Variants
Actions

Archived:How to display unread messages using PySymbian

From Nokia Developer Wiki
Jump to: navigation, search


Article Metadata
Tested with
Devices(s): Nokia N96
Compatibility
Platform(s): S60 3rd Edition
Article
Keywords: inbox, SMS
Created: bogdan.galiceanu (09 Apr 2008)
Last edited: hamishwillee (14 Jun 2013)

Overview

Following code shows how to display the content of an unread SMS messages in PySymbian.

Code

# import modules
import e32, appuifw, inbox
 
# Define exit function
def quit():app_lock.signal()
appuifw.app.exit_key_handler=quit
 
i=inbox.Inbox()
 
# Defune text area as application body
t=appuifw.Text()
appuifw.app.body=t
 
p=0
 
for mes_id in i.sms_messages(): #Checks all the ids
#If the message has not yet been read it is written on the screen
if(i.unread(mes_id)<>0):
p+=1
t.color = 0xFF0000
t.style = appuifw.STYLE_BOLD
t.add(u"Message %d:\n\n" % p)
t.color = 0x0000FF
t.add(i.content(mes_id)+"\n\n")
 
# Wait for exit
app_lock=e32.Ao_lock()
app_lock.wait()


Related Links

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