I use SMM 1.12 to obtain a weather cam image from a remote server using the code below. I use a timer to repeat the image download every minute. The image is ftp'd to the server from the cam every 2 minutes.
Mostly this works fine but occasionally my app crashes - with this error:
Fatal Exception: java.lang.RuntimeException: Object should first be initialized (B4XBitmap).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:67)
at com.volcanex.brunyislandlocalguide.simplemediamanager$ResumableSub_PrepareMedia.resume(simplemediamanager.java:1059)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:267)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:207)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.keywords.Common$14.run(Common.java:1770)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8167)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
I note a recent update of SMM says " - v1.11 - Fixes an issue where a corrupted image can crash the app." However I suspect this is still happening - perhaps when the app is trying to download the cam image during a ftp update on the server?
Is there a way to catch corrupt image file errors with SMM?
Mostly this works fine but occasionally my app crashes - with this error:
Fatal Exception: java.lang.RuntimeException: Object should first be initialized (B4XBitmap).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:67)
at com.volcanex.brunyislandlocalguide.simplemediamanager$ResumableSub_PrepareMedia.resume(simplemediamanager.java:1059)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:267)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:207)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.keywords.Common$14.run(Common.java:1770)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8167)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
I note a recent update of SMM says " - v1.11 - Fixes an issue where a corrupted image can crash the app." However I suspect this is still happening - perhaps when the app is trying to download the cam image during a ftp update on the server?
Is there a way to catch corrupt image file errors with SMM?
B4X:
Dim MediaManager1 As SimpleMediaManager
MediaManager1.Initialize
MediaManager1.SetMedia( pnWeatherCam, weatherCam_URL )
Last edited: