| Reply | « Previous Thread | Next Thread » |
|
Hi all
I have written a small code, The purpose of the code is that if i want to get any mobile number from my mobile when it is with someone else, i can send an sms by the name of the contact as keyword via sms to my own number. The code will serach for that contact in phonebook and will create an sms, will send back to the number (here i have written that sms is to be sent to the searched number). After sending an sms it will miscall on that number too. Now the problem is: everthing works fine !!!! but when the sms is sent it should be stored in sent items but if the Messaging application is not in forground the sent item sms disappears from sent items, if the messaging application is at the forground if i m looking at outbox and then sent items the sms gets stored. Why such funny problem? Another problem is that after finishing the job my interpreter gives following error: what is the meanig of it?
The code : import messaging import appuifw import socket from messaging import * import contacts import time import e32 import string import telephone import inbox i =inbox.Inbox() m = i.sms_messages() re_number=i.content(m[0]) nam=i.content(m[0]) nam=string.upper(nam) d = i.address(m[0]) appuifw.note(u'SMS Received From ' + unicode(d)) appuifw.note(unicode(d)+u' has requested for '+ unicode(nam) +u's number') db=contacts.open() f=db.find(re_number) k=f[0] mobile=k.find('mobile_number')[0].value appuifw.note(u'Number Found:' + u'\n'+unicode(mobile)) messaging.sms_send(unicode(mobile),u'The requested number of '+ unicode(nam)+ u' is: ' + unicode(mobile)+u'\n\n\nTEST SMS: Please Ignore') e32.ao_sleep(2) appuifw.note(u'Message Sent...', u'conf') e32.ao_sleep(1) telephone.dial(mobile) e32.ao_sleep(5) telephone.hang_up() e32.ao_sleep(1) I hope i will get to run it prefectly without error and the sent items problem will also be solved Thanks Kiran trivedi
Last edited by krtrivdi : 2006-11-03 at 18:24.
Reason: needed some changes paste wrong code
|
One more thing while working with code: if i removek=f[0] then the program gives error: i refered the code provided by Nokia and add this to my code: so it works fine, what exactly this k=f[0] does? thanks Kiran |
|
hello ,
Next time use code tag for code examples Code:
import messaging
import appuifw
import socket
from messaging import *
import contacts
import time
import e32
import string
import telephone
import inbox
i =inbox.Inbox()
m = i.sms_messages()
re_number=i.content(m[0])
nam=i.content(m[0])
nam=string.upper(nam)
d = i.address(m[0])
appuifw.note(u'SMS Received From ' + unicode(d))
appuifw.note(unicode(d)+u' has requested for '+ unicode(nam) +u's number')
db=contacts.open()
f=db.find(re_number)
k=f[0]
mobile=k.find('mobile_number')[0].value
appuifw.note(u'Number Found:' + u'\n'+unicode(mobile))
messaging.sms_send(unicode(mobile),u'The requested number of '+ unicode(nam)+ u' is: ' + unicode(mobile)+u'\n\n\nTEST SMS: Please Ignore')
e32.ao_sleep(2)
appuifw.note(u'Message Sent...', u'conf')
e32.ao_sleep(1)
telephone.dial(mobile)
e32.ao_sleep(5)
telephone.hang_up()
e32.ao_sleep(1)
![]() Comments soon ![]() pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 ! pys60 extension modules on http://cyke64.googlepages.com/ |
|
thanks cyke
actually i tried but there are php tags. where is the tag for code ||Kiran || Nokia E-65 Nokia 7610 Nokia N95 8GB Nokia E90 Nokia 5110 !! Nokia 6110i !! |
|
it's the little ' # ' button
![]() Devices: Nokia E61 3rd Edition - pys60 1.4.0 Tips and modules: http://www.lfdm.net/thesis |
|
what??? where is # in the code?>
||Kiran || Nokia E-65 Nokia 7610 Nokia N95 8GB Nokia E90 Nokia 5110 !! Nokia 6110i !! |
|
Code:
oh you mean this ok ok, i thougth error in code due to # sign ||Kiran || Nokia E-65 Nokia 7610 Nokia N95 8GB Nokia E90 Nokia 5110 !! Nokia 6110i !! |
|
Hi, I found this subject very interesting. I'm also involved in writing an application which reads SMS from the inbox. I successfully tried the cyke64's example, but it also happened something wrong:
it correctly shows the sender's name/number and the message text, but finally it also says: "Python\my\sms3.py", line 22, in ? k=f[0] IndexError: list index out of range. how comes? Is there some issue in the example code or something else? thanks in advance. Antonio |
|
hi, it has been a long time but nobody has replied to this issue, i am surprised why great python developers are silent to this question? please help
||Kiran || Nokia E-65 Nokia 7610 Nokia N95 8GB Nokia E90 Nokia 5110 !! Nokia 6110i !! |
|
Hi, I did a mystake. Now it works. .. the problem was that I had no names in the address book, so the second part of the program did not find anything to search for. Anyway, now it does not give any error.
Krtrivdi, I'm sorry but I don't understand what is your question. Please explain it to me, then I will be happy to help you, if possible. Antonio |
|
Thanks Joyce for interecting with this issue: My difficulty is
the problem is: everthing works fine !!!! but when the sms is sent it should be stored in sent items but if the Messaging application is not in forground the sent item sms disappears from sent items, if the messaging application is at the forground if i m looking at outbox and then sent items the sms gets stored. Why such funny problem? Another problem is that after finishing the job my interpreter gives following error: what is the meanig of it? * SymbainError: [Errno-2] KErrGeneral ||Kiran || Nokia E-65 Nokia 7610 Nokia N95 8GB Nokia E90 Nokia 5110 !! Nokia 6110i !! |
|
Hi, sorry but I don't know what is this trouble due to.
|
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| [newbie here] Link error | xitpu | General Symbian C++ | 3 | 2007-01-24 17:53 |
| carbide build problem help please | berkcekisbas | Carbide.c++ IDE and plug-ins | 1 | 2006-09-26 20:41 |
| problem with the XML Parser SyExpat | Vitaly_iva | General Symbian C++ | 2 | 2006-06-05 12:09 |
| 新手求救!錯誤訊息! | wgarnett | Symbian | 2 | 2005-09-26 03:21 |
| sms coding error | boogieeee | Symbian Tools & SDKs | 1 | 2004-07-21 10:32 |