×
Namespaces

Variants
Actions
(Difference between revisions)

Archived:Low network signal strength notification in PySymbian

From Nokia Developer Wiki
Jump to: navigation, search
shubhendra (Talk | contribs)
(You got to a solution to a problem i faced many a times!)
 
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot update - Add ArticleMetaData)
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:Python]][[Category:Code Examples]][[Category:Location Based Services]]
+
{{ArticleMetaData <!-- v1.2 -->
 +
|sourcecode= <!-- Link to example source code e.g. [[Media:The Code Example ZIP.zip]] -->
 +
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
 +
|devices= <!-- Devices tested against - e.g. ''devices=Nokia 6131 NFC, Nokia C7-00'') -->
 +
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Qt SDK 1.1.4]) -->
 +
|platform= <!-- Compatible platforms - e.g. Symbian^1 and later, Qt 4.6 and later -->
 +
|devicecompatability= <!-- Compatible devices e.g.: All* (must have internal GPS) -->
 +
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
 +
|signing= <!-- Signing requirements - empty or one of: Self-Signed, DevCert, Manufacturer -->
 +
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
 +
|keywords= <!-- APIs, classes and methods (e.g. QSystemScreenSaver, QList, CBase -->
 +
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
 +
|translated-by= <!-- [[User:XXXX]] -->
 +
|translated-from-title= <!-- Title only -->
 +
|translated-from-id= <!-- Id of translated revision -->
 +
|review-by= <!-- After re-review: [[User:username]] -->
 +
|review-timestamp= <!-- After re-review: YYYYMMDD -->
 +
|update-by= <!-- After significant update: [[User:username]]-->
 +
|update-timestamp= <!-- After significant update: YYYYMMDD -->
 +
|creationdate= 20080330
 +
|author= [[User:Shubhendra]]
 +
}}
 +
[[Category:Location]][[Category:PySymbian]][[Category:Telephony]]
 
'''Problem Faced'''
 
'''Problem Faced'''
  
Line 6: Line 28:
 
----
 
----
  
'''Solution'''
+
'''Solution by Shubhendra Singh'''
 
   
 
   
 
Just use this code, it will trigger alarm as soon as you get even faint signals,
 
Just use this code, it will trigger alarm as soon as you get even faint signals,
Line 36: Line 58:
 
app_lock = e32.Ao_lock()
 
app_lock = e32.Ao_lock()
 
app_lock.wait()
 
app_lock.wait()
 +
 +
[[Category:Code Snippet]]

Revision as of 07:08, 27 July 2012

Article Metadata
Article
Created: shubhendra (30 Mar 2008)
Last edited: hamishwillee (27 Jul 2012)

Problem Faced

Many a times it happens that while you are traveling you need to call someone, but no network signals are available or what we call "No Network Services Available". What generally happens is that there might be a small distance in between where Network was available or some signals are there, so that you can make a call but as you might not notice that while traveling you have to wait for long time until there is Network available for prolonged time like while passing through a city.


Solution by Shubhendra Singh

Just use this code, it will trigger alarm as soon as you get even faint signals,

from audio import *
import appuifw,e32,sysinfo
from graphics import *
abc=0
f = 'Z:\\Nokia\\Sounds\\Digital\\Alarm.mid' # Could be changed, this is what you will hear.
while abc == 0:
if(sysinfo.signal()>0):
abc=1
s = Sound.open(f)
s.play(KMdaRepeatForever) # Alarm will play until Network is available.
 
def quit():
s.stop()
app_lock.signal()
appuifw.app.set_exit()
 
def handle_redraw(rect):
canvas.blit(img)
 
 
canvas=appuifw.Canvas(event_callback=None, redraw_callback=handle_redraw)
appuifw.app.body=canvas
appuifw.app.title = u"Signal Mode"
appuifw.app.exit_key_handler = quit # Press "Quit" to quit application.
app_lock = e32.Ao_lock()
app_lock.wait()
 
[[Category:Code Snippet]]
85 page views in the last 30 days.
×