I started down the "Dropbox" path as an "easy way" to "simulate" data file input from a remote source to my application. (I think something like RDC to a file on my local PC is probably a better "simulation" method - but Dropbox appeared like an easier route for testing - as I don't have any experience (yet) with RDC.)
When I initially set up the "Dropbox" link - I spent many hours trying to get it to work only to find out (THANKS to Erel) that the DropboxSync API would not run on the Genymotion emulator... Which was the emulator I've used to develop all of my "test" apps so far.
Erel suggested using B4A Bridge instead - and that seemed to work fairly well. But the device I used to test is also the source of my "internet connection" - so I can't use the device for B4A Bridge service and be connected to the internet at the same time.
So I created another emulated device - this time using the Android AVD Manger. Using this emulator (with the same Dropbox test application) the results are highly inconsistent.
Sometime (perhaps 2 out of 10 attempts) when "LinkAccount" executes - the "approve connection validation prompt" appears on the emulator screen, you respond to it and my application works exactly as expected. You can modify code, reload the app, etc. and it works flawlessly.
The other 8 out of 10 times, the "validation prompt" never appears. Instead you get a JAVA NullPointerException.
When the emulated device is launched each time, I choose "Wipe User Data" so the device should "look" to B4A exactly the same each time I begin working in B4A.
So, my question is... Is there "reference material" somewhere that specifies why various emulators behave differently - and how one should chose the "best" one - for consistent results...
When I initially set up the "Dropbox" link - I spent many hours trying to get it to work only to find out (THANKS to Erel) that the DropboxSync API would not run on the Genymotion emulator... Which was the emulator I've used to develop all of my "test" apps so far.
Erel suggested using B4A Bridge instead - and that seemed to work fairly well. But the device I used to test is also the source of my "internet connection" - so I can't use the device for B4A Bridge service and be connected to the internet at the same time.
So I created another emulated device - this time using the Android AVD Manger. Using this emulator (with the same Dropbox test application) the results are highly inconsistent.
Sometime (perhaps 2 out of 10 attempts) when "LinkAccount" executes - the "approve connection validation prompt" appears on the emulator screen, you respond to it and my application works exactly as expected. You can modify code, reload the app, etc. and it works flawlessly.
The other 8 out of 10 times, the "validation prompt" never appears. Instead you get a JAVA NullPointerException.
B4X:
java.lang.RuntimeException: java.lang.NullPointerException
at anywheresoftware.b4a.dropbox.DbxAccountManagerWrapper.LinkAccount(DbxAccountManagerWrapper.java:91)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:520)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:235)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:174)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:93)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:154)
at b4a.example.processingservice.onCreate(processingservice.java:45)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2363)
at android.app.ActivityThread.access$1600(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1277)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
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:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at anywheresoftware.b4a.dropbox.DbxAccountManagerWrapper.LinkAccount(DbxAccountManagerWrapper.java:89)
... 21 more
When the emulated device is launched each time, I choose "Wipe User Data" so the device should "look" to B4A exactly the same each time I begin working in B4A.
So, my question is... Is there "reference material" somewhere that specifies why various emulators behave differently - and how one should chose the "best" one - for consistent results...