×
Namespaces

Variants
Actions
Revision as of 08:02, 7 February 2012 by hamishwillee (Talk | contribs)

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
Platform Security
Capabilities: )
Article
Keywords: inbox, SMS
Created: bogdan.galiceanu (09 Apr 2008)
Last edited: hamishwillee (07 Feb 2012)

Overview

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

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

40 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×