PDA

View Full Version : SKSchema Program to check for connectivity before action


prestonmcafee
11th September 2006, 08:55 AM
I wrote a program with SKSchema that check for an activesync or Lan connection, and if neither exists, shuts off GSM before running a program. The idea is to permit a program to have broadband access but not megabytes. Here it is:

#r(#chkasconnection)
#r(#iftrue) #p(1)
#r(#chkwlan)
#r(#iftrue) #p(1)
#r(#yesno) #p(Turn GSM Off?) #rmr(0) #rmt(10000)
#r(#iffalse) #p(1)
#r(#GSMOff)
#r(#label) #p(1)
#r(\Storage Card\Program Files\NewsBreak\NewsBreak.exe)

This program first checks for an activesync connection; if true jumps to the last line. Otherwise it checks for a wifi connection and if true jumps to the last line. Otherwise, it asks if the user would like to turn off the GSM, and unless the answer is no (within ten seconds) it turns off the GSM, and then runs the program.

This prevents the program from looking for the GPRS, which is slow and expensive, but permitting data access on wifi or activesync.