PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV Mobile 2024 → Android. ThreadPersistent exiting with uncaught exception (group=0x41708930)
Android. ThreadPersistent exiting with uncaught exception (group=0x41708930)
Started by Alfons, Apr., 01 2014 10:27 AM - No answer
Posted on April, 01 2014 - 10:27 AM
Hi,

I'm developing a GPS tracking application with WinDev Mobile for Android. The iea is that by GPSFollowMovement can capture
positions regularly and with a ThreadPersistent the costs to a server on a regular basis, even if you close all application windows.

The problem is that occasionally, when you close the main application window (WIN_Start), The ThrenPersistent is stopped due to an exception.

I have added below the basic code and the log of Android.

If anyone can offer some suggestions, I would really appreciate it.

Thanks!:)
Alfons
--> Code

//Start getting positions
GPSFollowMovement(_GetPosition, nGPSFollowMovement_TimeOutSeconds_S,grGPSFollowMovement_MinimumDistanceMeters)

//Start sending positions
IF ThreadState("SendLocalization_PERSISTENT_TH") = threadUnknown THEN
ThreadExecute("SendLocalization_PERSISTENT_TH", threadGlobalContext, SendLocalization_PERSISTENT)
ThreadPersistent("SendLocalization_PERSISTENT_TH",gNotif)
END

PROCEDURE SendLocalization_PERSISTENT()
WHILE gbLocalizationActive
dbgStandardOutput("SendLocalization_PERSISTENT ---> START")

SendLocalizationTIMER()
// Wait during the periodicity
ChronoStart(1)
WHILE gbLocalizationActive _AND_ ((ChronoValue(1) / 1000) < gnGPSFollowMovement_TimeOutSeconds)
Multitask(50)
END
ChronoEnd(1)
dbgStandardOutput("SendLocalization_PERSISTENT ---> END")
END

PROCEDURE SendLocalizationTIMER()
dbgStandardOutput("SendLocalizationTIMER ---> START ")

IF ThreadState("SendLocalization_TH") = threadRunning OR ThreadState("SaveLocalizations_TH") = threadRunning THEN

ELSE
ThreadExecute("SendLocalization_TH",threadGlobalContext,"SendLocalizationV2")

END
dbgStandardOutput("SendLocalizationTIMER ---> END ")




---> LogCat
03-31 11:07:43.537: E/EnterpriseContainerManager(2258): ContainerPolicy Service is not yet ready!!!
03-31 11:07:43.537: D/EnterpriseDeviceManager(2258): ContainerId: 0
03-31 11:07:43.537: W/LicenseLogService(2258): log() is called by non admin
03-31 11:07:43.547: W/ContextImpl(2258): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1332 com.android.server.InputMethodManagerService$5.run:2461 java.lang.Thread.run:856 <bottom of call stack> <bottom of call stack>
03-31 11:07:43.582: V/TaskCloserActivity(4649): TaskCloserActivity onReceive()
03-31 11:07:43.627: D/dalvikvm(3313): GC_CONCURRENT freed 1265K, 50% free 7817K/15360K, paused 8ms+15ms, total 189ms
03-31 11:07:43.627: V/MediaPlayer-JNI(3313): native_finalize
03-31 11:07:43.627: V/MediaPlayer-JNI(3313): release
03-31 11:07:43.632: D/dalvikvm(3313): WAIT_FOR_CONCURRENT_GC blocked 21ms
03-31 11:07:43.632: D/dalvikvm(3313): WAIT_FOR_CONCURRENT_GC blocked 33ms
03-31 11:07:43.912: D/dalvikvm(3313): GC_CONCURRENT freed 1539K, 51% free 7579K/15360K, paused 2ms+4ms, total 48ms
03-31 11:07:43.912: D/dalvikvm(3313): WAIT_FOR_CONCURRENT_GC blocked 23ms
03-31 11:07:43.922: I/power(2258): *** release_dvfs_lock : lockType : 1
03-31 11:07:43.922: D/CustomFrequencyManagerService(2258): releaseDVFSLockLocked : Getting Lock type frm List : DVFS_MIN_LIMIT frequency : 1100000 uid : 1000 pid : 2258 tag : ACTIVITY_RESUME_BOOSTER@5
03-31 11:07:43.922: W/ActivityManager(2258): mDVFSHelper.release()
03-31 11:07:43.992: I/SurfaceFlinger(1828): id=62 Removed HWDFWIN_Sta (5/7)
03-31 11:07:43.992: I/SurfaceFlinger(1828): id=62 Removed HWDFWIN_Sta (-2/7)
03-31 11:07:44.057: D/GpsLocationProvider(2258): TTFF: 28533
03-31 11:07:44.067: D/(3313): _GetPosition ---> START
03-31 11:07:44.067: W/ContextImpl(2258): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1346 com.android.server.StatusBarManagerService.sendNotification:179 com.android.server.StatusBarManagerService.updateNotification:796 com.android.server.NotificationManagerService.enqueueNotificationInternal:1285 com.android.server.NotificationManagerService.enqueueNotificationWithTag:1145
03-31 11:07:44.067: D/STATUSBAR-StatusBarManagerService(2258): sendNotification(2) - 252119
03-31 11:07:44.077: D/(3313): _GetPosition ---> 1
03-31 11:07:44.082: D/(3313): ArrayAddLocalization ---> START
03-31 11:07:44.137: D/(3313): ArrayAddLocalization ---> END
03-31 11:07:44.167: D/dalvikvm(3313): GC_CONCURRENT freed 1146K, 51% free 7600K/15360K, paused 3ms+5ms, total 55ms
03-31 11:07:44.407: D/SensorService(2258): AutoRotationSensor::process: Ar_SensorChanged oldrotation = [1], rotation = [255]
03-31 11:07:44.407: V/WindowOrientationListener(2258): Rotation Sensor : x=255.0
03-31 11:07:44.417: D/dalvikvm(3313): GC_CONCURRENT freed 1234K, 51% free 7594K/15360K, paused 2ms+5ms, total 42ms
03-31 11:07:44.417: D/dalvikvm(3313): WAIT_FOR_CONCURRENT_GC blocked 26ms
03-31 11:07:44.502: D/STATUSBAR-NetworkController(2416): refreshSignalCluster: data=-1 bt=false
03-31 11:07:44.662: D/dalvikvm(3313): GC_CONCURRENT freed 1234K, 51% free 7587K/15360K, paused 4ms+5ms, total 41ms
03-31 11:07:44.662: D/dalvikvm(3313): WAIT_FOR_CONCURRENT_GC blocked 16ms
03-31 11:07:44.672: D/(3313): SendLocalization_PERSISTENT ---> END
03-31 11:07:44.672: D/(3313): SendLocalization_PERSISTENT ---> START
03-31 11:07:44.682: D/(3313): SendLocalizationTIMER ---> START
03-31 11:07:44.687: D/SensorService(2258): AutoRotationSensor::process: Ar_SensorChanged oldrotation = [255], rotation = [1]
03-31 11:07:44.687: V/WindowOrientationListener(2258): Rotation Sensor : x=1.0
03-31 11:07:44.692: D/(3313): SendLocalizationTIMER ---> END
03-31 11:07:44.907: D/dalvikvm(3313): GC_CONCURRENT freed 1195K, 51% free 7597K/15360K, paused 1ms+6ms, total 46ms
03-31 11:07:45.162: D/dalvikvm(3313): GC_CONCURRENT freed 1217K, 51% free 7608K/15360K, paused 2ms+4ms, total 46ms
03-31 11:07:45.162: D/dalvikvm(3313): WAIT_FOR_CONCURRENT_GC blocked 32ms
03-31 11:07:45.347: D/SensorService(2258): AutoRotationSensor::process: Ar_SensorChanged oldrotation = [1], rotation = [255]
03-31 11:07:45.347: V/WindowOrientationListener(2258): Rotation Sensor : x=255.0
03-31 11:07:45.422: D/dalvikvm(3313): GC_CONCURRENT freed 1236K, 51% free 7603K/15360K, paused 2ms+6ms, total 54ms
03-31 11:07:45.422: D/dalvikvm(3313): WAIT_FOR_CONCURRENT_GC blocked 13ms
03-31 11:07:45.502: D/STATUSBAR-NetworkController(2416): refreshSignalCluster: data=-1 bt=false
03-31 11:07:45.667: D/dalvikvm(3313): GC_CONCURRENT freed 1302K, 51% free 7530K/15360K, paused 2ms+5ms, total 43ms
03-31 11:07:45.667: D/dalvikvm(3313): WAIT_FOR_CONCURRENT_GC blocked 34ms
03-31 11:07:45.907: D/SensorService(2258): AutoRotationSensor::process: Ar_SensorChanged oldrotation = [255], rotation = [1]
03-31 11:07:45.907: V/WindowOrientationListener(2258): Rotation Sensor : x=1.0
03-31 11:07:45.952: D/dalvikvm(3313): GC_CONCURRENT freed 1109K, 51% free 7614K/15360K, paused 2ms+5ms, total 60ms
03-31 11:07:45.967: I/(2258): OnGpsExtensionMessage: MSG_REQUEST_LOCATION_ID
03-31 11:07:46.107: D/DisplayPowerController(2258): [DAB] updateAutoBrightnessSEC : 206(206.0) 46.0 < 476.5 < 1390.0 (1.0)
03-31 11:07:46.107: D/DisplayPowerController(2258): [DAB] mAmbientLux = 476.5, newScreenAutoBrightness = 206
03-31 11:07:46.107: D/DisplayPowerController(2258): animation target = 206(false, (-1 ~ -1), ( < -1)
03-31 11:07:46.112: D/lights(2258): lcd : 160 +
03-31 11:07:46.112: D/lights(2258): lcd : 160 -
03-31 11:07:46.132: D/lights(2258): lcd : 169 +
03-31 11:07:46.137: D/lights(2258): lcd : 169 -
03-31 11:07:46.142: D/LocationManagerService(2258): getProviders()=[]
03-31 11:07:46.142: D/LocationManagerService(2258): getProviders()=[passive, gps, network]
03-31 11:07:46.142: D/lights(2258): lcd : 177 +
03-31 11:07:46.142: D/lights(2258): lcd : 177 -
03-31 11:07:46.142: D/LocationManagerService(2258): getBestProvider(Criteria[power=MEDIUM acc=HIGH], true)=gps
03-31 11:07:46.162: D/lights(2258): lcd : 186 +
03-31 11:07:46.162: D/lights(2258): lcd : 186 -
03-31 11:07:46.162: D/(3313): _GetPosition ---> END
03-31 11:07:46.177: D/lights(2258): lcd : 194 +
03-31 11:07:46.177: D/lights(2258): lcd : 194 -
03-31 11:07:46.197: D/lights(2258): lcd : 203 +
03-31 11:07:46.197: D/lights(2258): lcd : 203 -
03-31 11:07:46.197: D/dalvikvm(3313): GC_CONCURRENT freed 1305K, 51% free 7542K/15360K, paused 4ms+5ms, total 51ms
03-31 11:07:46.197: D/dalvikvm(3313): WAIT_FOR_CONCURRENT_GC blocked 34ms
03-31 11:07:46.197: D/dalvikvm(3313): WAIT_FOR_CONCURRENT_GC blocked 35ms
03-31 11:07:46.212: D/lights(2258): lcd : 206 +
03-31 11:07:46.212: D/lights(2258): lcd : 206 -
03-31 11:07:46.212: D/RampAnimator(2258): Light Animator Finished currentValue=206
03-31 11:07:46.277: W/WindowManager(2258): Attempted to add application window with unknown token Token{424a7aa8 ActivityRecord{42355b28 u0 antay.cfsatv30/.wdgen.GWDFWIN_Start$WDActiviteFenetre}}. Aborting.
03-31 11:07:46.297: D/dalvikvm(3313): GC_CONCURRENT freed 386K, 46% free 8365K/15360K, paused 3ms+5ms, total 45ms
03-31 11:07:46.297: D/dalvikvm(3313): WAIT_FOR_CONCURRENT_GC blocked 19ms
03-31 11:07:46.297: D/dalvikvm(3313): WAIT_FOR_CONCURRENT_GC blocked 20ms
03-31 11:07:46.297: D/AndroidRuntime(3313): Shutting down VM
03-31 11:07:46.297: W/dalvikvm(3313): threadid=1: thread exiting with uncaught exception (group=0x41708930)
03-31 11:07:46.327: W/WindowManager(2258): Attempted to add application window with unknown token Token{424a7aa8 ActivityRecord{42355b28 u0 antay.cfsatv30/.wdgen.GWDFWIN_Start$WDActiviteFenetre}}. Aborting.
03-31 11:07:46.337: I/Process(3313): Sending signal. PID: 3313 SIG: 9
03-31 11:07:46.337: E/AndroidRuntime(3313): Error reporting crash
03-31 11:07:46.337: E/AndroidRuntime(3313): android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@42156f38 is not valid; is your activity running?
03-31 11:07:46.337: E/AndroidRuntime(3313): at android.view.ViewRootImpl.setView(ViewRootImpl.java:783)
03-31 11:07:46.337: E/AndroidRuntime(3313): at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:265)
03-31 11:07:46.337: E/AndroidRuntime(3313): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
03-31 11:07:46.337: E/AndroidRuntime(3313): at android.app.Dialog.show(Dialog.java:282)
03-31 11:07:46.337: E/AndroidRuntime(3313): at fr.pcsoft.wdjava.framework.dialogue.i.a(Unknown Source)
03-31 11:07:46.337: E/AndroidRuntime(3313): at fr.pcsoft.wdjava.framework.dialogue.i.a(Unknown Source)
03-31 11:07:46.337: E/AndroidRuntime(3313): at fr.pcsoft.wdjava.framework.dialogue.h.a(Unknown Source)
03-31 11:07:46.337: E/AndroidRuntime(3313): at fr.pcsoft.wdjava.framework.exception.WDException.a(Unknown Source)
03-31 11:07:46.337: E/AndroidRuntime(3313): at fr.pcsoft.wdjava.framework.exception.WDException.getCause(Unknown Source)
03-31 11:07:46.337: E/AndroidRuntime(3313): at android.util.Log.getStackTraceString(Log.java:395)
03-31 11:07:46.337: E/AndroidRuntime(3313): at android.util.Slog.e(Slog.java:151)
03-31 11:07:46.337: E/AndroidRuntime(3313): at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:80)
03-31 11:07:46.337: E/AndroidRuntime(3313): at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
03-31 11:07:46.337: E/AndroidRuntime(3313): at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
03-31 11:07:46.337: E/AndroidRuntime(3313): at dalvik.system.NativeStart.main(Native Method)
03-31 11:07:46.347: D/LocationManagerService(2258): Location listener died
03-31 11:07:46.347: I/LocationManagerService(2258): remove 4257ed38
03-31 11:07:46.347: D/LocationManagerService(2258): provider request: gps ProviderRequest[OFF]
03-31 11:07:46.347: I/ActivityManager(2258): Process antay.cfsatv30 (pid 3313) (adj 2) has died.
03-31 11:07:46.347: D/PowerManagerService(2258): [api] handleWakeLockDeath : release WakeLock : PARTIAL_WAKE_LOCK 'fr.pcsoft.wdjava.framework.service.WDServiceLocal' (uid=10165, pid=3313, ws=null) (elapsedTime=91541)
03-31 11:07:46.347: W/ContextImpl(2258): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1346 com.android.server.StatusBarManagerService.sendNotification:179 com.android.server.StatusBarManagerService.removeNotification:812 com.android.server.NotificationManagerService.cancelNotificationLocked:1615 com.android.server.NotificationManagerService.cancelNotification:1688
03-31 11:07:46.347: W/ContextImpl(2258): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1332 com.android.server.am.ActivityManagerService.cleanUpApplicationRecordLocked:12436 com.android.server.am.ActivityManagerService.handleAppDiedLocked:3616 com.android.server.am.ActivityManagerService.appDiedLocked:3720 com.android.server.am.ActivityManagerService$AppDeathRecipient.binderDied:992
03-31 11:07:46.347: D/STATUSBAR-StatusBarManagerService(2258): sendNotification(3) - 525
03-31 11:07:46.347: D/LightsService(2258): [SvcLED] turnOff:: id = 4mIsIDUsingPatternLED = true
03-31 11:07:46.347: D/LightsService(2258): [SvcLED] setSvcLedStateLocked:: id = 4, color = 0, mode = Off, set = Off
03-31 11:07:46.352: D/GpsLocationProvider(2258): setRequest ProviderRequest[OFF]
03-31 11:07:46.352: D/GpsLocationProvider(2258): stopNavigating
03-31 11:07:46.352: D/libgps(2258): proxy_gps_status_cb: called. status(2)
03-31 11:07:46.352: V/GpsLocationProvider(2258): reportStatus status: 2
03-31 11:07:46.352: D/GpsLocationProvider(2258): send an intent to notify that the GPS has been enabled or disabled mNavigating = false
03-31 11:07:46.352: D/LightsService(2258): [SvcLED] ForcedSvcLEDTask is running.
03-31 11:07:46.352: D/LightsService(2258): [SvcLED] setSvcLedLightLocked : mSvcLedState : 0x0 priority : 6 mSvcLedMode : 0
03-31 11:07:46.357: I/InputReader(2258): Touch event's action is 0x0 (deviceType=0) [pCnt=1, s=0.37 ] when=152631637000
03-31 11:07:46.357: I/InputDispatcher(2258): Delivering touch to: action: 0x0
03-31 11:07:46.362: D/libgps(2258): proxy_gps_status_cb: called. status(4)
03-31 11:07:46.362: V/GpsLocationProvider(2258): reportStatus status: 4
03-31 11:07:46.362: D/libgps(2258): proxy_gps_status_cb: called. status(2)
03-31 11:07:46.362: V/GpsLocationProvider(2258): reportStatus status: 2
03-31 11:07:46.362: D/GpsLocationProvider(2258): getSKAFEnable : false
03-31 11:07:46.372: W/ContextImpl(2258): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1346 com.android.server.StatusBarManagerService.sendNotification:179 com.android.server.StatusBarManagerService.removeNotification:812 com.android.server.NotificationManagerService.cancelNotificationLocked:1615 com.android.server.NotificationManagerService.cancelNotification:1688
>03-31 11:07:46.372: D/STATUSBAR-StatusBarManagerService(2258): sendNotification(3) - 252119