×
Namespaces

Variants
Actions
(Difference between revisions)

Archived:Alarm at specified cell id using PySymbian

From Nokia Developer Wiki
Jump to: navigation, search
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot change of template (Template:CodeSnippet) - now using Template:ArticleMetaData)
hamishwillee (Talk | contribs)
m (Hamishwillee - Replace Python with PySymbian in categories)
Line 1: Line 1:
[[Category:Location]][[Category:Python]]
+
[[Category:Location]][[Category:Code Examples]][[Category:PySymbian]]
 
__NOTOC__
 
__NOTOC__
 
__NOEDITSECTION__
 
__NOEDITSECTION__
Line 8: Line 8:
 
|platform=S60  
 
|platform=S60  
 
|devices= N95, N96
 
|devices= N95, N96
|category=Python
+
|creationdate=20080728
|subcategory=Location
+
|creationdate=July 28, 2008
+
 
|keywords= cellid, gsm ,audio
 
|keywords= cellid, gsm ,audio
  
Line 86: Line 84:
 
== Related Wiki Links ==
 
== Related Wiki Links ==
  
[[How to get info on cell location]][[Category:Code Examples]]
+
[[How to get info on cell location]]

Revision as of 08:10, 30 November 2011



{{{width}}}
Article Metadata
Tested with
Devices(s): N95, N96
Compatibility
Platform(s): S60
Platform Security
Capabilities: )
Article
Keywords: cellid, gsm ,audio
Created: shubhendra (28 Jul 2008)
Last edited: hamishwillee (30 Nov 2011)


Overview

Sometimes, it happens that you are traveling and you know the "destination's cell id", but want to sleep for while. Just enter the cell id of the destination and you will be woken up by the alarm.

Preconditions

The user of this script should know the cellid of the destination place where the user wants to set the alarm.


Proposed Solution

Just use this code, it will trigger alarm as soon as cell id of the location matches with the cell id you input,

import appuifw
import e32
import location
from graphics import *
from audio import *
import globalui
 
 
 
def run():
abc=0
f = "e:\\Python\\Alarm.mp3" # Could be changed, this is what you will hear
data=appuifw.query(u"enter the cell id","number")
 
while abc == 0:
xyz=location.gsm_location()
if(xyz[3] == data):
 
abc = 1
globalui.global_note(u"Alarm Activated please wake up",'wait')
s = Sound.open(f)
s.play(KMdaRepeatForever) # Alarm will play until Network is available.
 
def loc():
 
l = location.gsm_location()[3]
print l
globalui.global_msg_query(u""+str(l),u"your Cellid is:",7)
 
def quit():
app_lock.signal()
appuifw.app.set_exit()
 
 
appuifw.app.title = u"location Mode"
appuifw.app.menu = [(u"Set Alarm",run),(u"Cellid",loc),(u"Back",quit)]
appuifw.app.exit_key_handler = quit # Press "Quit" to quit application.
app_lock = e32.Ao_lock()
app_lock.wait()

Postconditions

Cellid1.jpg Cellid2.jpg Cellid3.jpg


Related Wiki Links

How to get info on cell location

76 page views in the last 30 days.