my app isfrozen sometimes

Georg

Member
Licensed User
Longtime User
Hi

i have an app that saved the tracks(lat,lon,alti) with GPS

Sub Timer1_Tick
gps.GetDeviceData
If gps.GetGpsData(6000) = True Then trackauf
End Sub

Sub trackauf
FileOpen (ctrack,"Track.txt",cWrite,cAppend,cASCII)
FileWrite (ctrack,gps.longtitude & "," & gps.latitude & "," & gps.SeaLevelAltitude)
FileClose(ctrack)
End Sub

sub stop
Timer1.Enabled = False
gps.Close
end sub

the Track.txt will be bigger and bigger till 1 MB or 2, that is ok, but when i press the Stopp Button sometimes the app is frozen but only sometimes. How to fix it?
 

Georg

Member
Licensed User
Longtime User
The stop button closed only GPS, the app runs and i can press the button Start and the GPS starts again. The app freeze, when i press the Stop Button after the GPS was running a longer time.
 

Georg

Member
Licensed User
Longtime User
I use TytnII, MDA Pro, HTC P3300 always the same problem. Could it be that i interrupt a process which is not finished, when i press the Button Stop? It will not be happen so often, when i use

sleep(1000)
timer1 = false
gps.Close
 
Top