kopia lustrzana https://github.com/ge0rg/aprsdroid
check minimum update interval
rodzic
3247b9c570
commit
e676ce6bd2
|
|
@ -4,6 +4,7 @@
|
|||
<!-- APRSdroid activity -->
|
||||
<string name="firstrun">You need to configure APRSdroid with your callsign and passcode!</string>
|
||||
<string name="wrongpasscode">Your passcode does not match your callsign!</string>
|
||||
<string name="mininterval">Minimum update time is 1 minute!</string>
|
||||
<string name="singlelog">Single Shot</string>
|
||||
<string name="startlog">Start Logging</string>
|
||||
<string name="stoplog">Stop Logging</string>
|
||||
|
|
|
|||
|
|
@ -102,18 +102,26 @@ class APRSdroid extends Activity with OnClickListener
|
|||
true
|
||||
}
|
||||
|
||||
def openPrefs(toastId : Int) {
|
||||
startActivity(new Intent(this, classOf[PrefsAct]));
|
||||
Toast.makeText(this, toastId, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
|
||||
def checkConfig() : Boolean = {
|
||||
val callsign = prefs.getString("callsign", "")
|
||||
val passcode = prefs.getString("passcode", "")
|
||||
if (callsign == "" || passcode == "") {
|
||||
startActivity(new Intent(this, classOf[PrefsAct]));
|
||||
Toast.makeText(this, R.string.firstrun, Toast.LENGTH_SHORT).show()
|
||||
openPrefs(R.string.firstrun)
|
||||
return false
|
||||
}
|
||||
val genpasscode = AprsPacket.passcode(callsign)
|
||||
if (passcode != genpasscode.toString()) {
|
||||
startActivity(new Intent(this, classOf[PrefsAct]));
|
||||
Toast.makeText(this, R.string.wrongpasscode, Toast.LENGTH_SHORT).show()
|
||||
openPrefs(R.string.wrongpasscode)
|
||||
return false
|
||||
}
|
||||
val intval = prefs.getString("interval", "10")
|
||||
if (intval == "" || intval.toInt < 1) {
|
||||
openPrefs(R.string.mininterval)
|
||||
return false
|
||||
}
|
||||
true
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue