my app isfrozen sometimes

Discussion in 'Questions (Windows Mobile)' started by Georg, Nov 11, 2008.

  1. Georg

    Georg Member Licensed 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?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Does it eventually recover from the freeze?
    What is the interval of Timer1?
     
  3. Georg

    Georg Member Licensed User

    The Timer intervall is 1000
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Does it just freeze until you close the application (with task manager)?
     
  5. Georg

    Georg Member Licensed 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.
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    GPS.Close only calls the native method 'GPSCloseDevice' which probably freezes your device.
    Which device are you using? Maybe it is a problem with this specific model.
     
  7. Georg

    Georg Member Licensed 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
     
  8. Erel

    Erel Administrator Staff Member Licensed User

    It is possible that the low level process that manages the GPS hangs for some reason.
    You should try:
    Code:
    timer1.enabled = false
    sleep(
    5000)
    gps.close
     
  9. Georg

    Georg Member Licensed User

    Thanks i will check it and give you a message
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice