Hey Hi,
How to make standalone application from this and also it shows one drawback i.e. if I leave this application running and do other things.The Message is not displayed to the front and I need to go into python to stop the sound.Can anybody suggest something to counter this.Code:import appuifw import inbox import e32 import logs import audio nbr="+4916097089179" nbr_rec=0 app_lock = e32.Ao_lock() def message_recieved(msg_id): global app_lock,nbr box = inbox.Inbox() sms_text = box.content(msg_id) l=logs.sms(mode='in') nbr_rec = l[0]["number"] print (u"Number Recieved is "+str(nbr_rec)) if((nbr_rec==nbr) and (sms_text=="Test")): e32.ao_sleep(3) A = audio.Sound.open("C:\smsalertpolices03.mid") j=None A.play(audio.KMdaRepeatForever) while j is None: j=appuifw.query(u"Danger!!!","query") A.stop() A.close() app_lock.signal() box = inbox.Inbox() box.bind(message_recieved) print (u"Waiting for new SMS messages.....") app_lock.wait() print(u"Message handled!")
Rishabh

Reply With Quote



