This is a B4A and B4i question. If Dropbox is not installed and my app tries to link to it the app crashes. A Try Catch around manager.LinkAccount does not work to catch the error and my app crashes. Error is:
I need a way to know to skip the dropbox code if dropbox is not installed on the device.
B4X:
java.lang.ExceptionInInitializerError
at com.dropbox.sync.android.CoreAccountManager.initNativeLib(CoreAccountManager.java:228)
at com.dropbox.sync.android.CoreAccountManager.<init>(CoreAccountManager.java:141)
at com.dropbox.sync.android.DbxAccountManager.getInstance(DbxAccountManager.java:200)
at com.dropbox.sync.android.DbxAccountManager.getInstance(DbxAccountManager.java:160)
at com.dropbox.sync.android.DbxAccountManager.getInstance(DbxAccountManager.java:107)
at anywheresoftware.b4a.dropbox.DbxAccountManagerWrapper.Initialize(DbxAccountManagerWrapper.java:53)
at com.Turbo3.Leaf_Spy_Pro.main._vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv7(main.java:14181)
at com.Turbo3.Leaf_Spy_Pro.main._timer1_tick(main.java:17026)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:187)
at anywheresoftware.b4a.objects.Timer$TickTack.run(Timer.java:105)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:155)
at android.app.ActivityThread.main(ActivityThread.java:5454)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1029)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:796)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.UnsatisfiedLinkError: Couldn't load DropboxSync: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:365)
at java.lang.System.loadLibrary(System.java:535)
at com.dropbox.sync.android.NativeLib.ensureLoaded(NativeLib.java:70)
at com.dropbox.sync.android.NativeLib.<clinit>(NativeLib.java:32)
... 21 more
I need a way to know to skip the dropbox code if dropbox is not installed on the device.