tips (en)‎ > ‎

android

HTML5 Ajax Call Timeout and 3G Wireless Radio
Because of the 3G wireless radio state machine (see http://developer.android.com/training/efficient-downloads/efficient-network-access.html), the radio takes around 2 seconds from StandBy to Full Power state. Full Power Radio is used when a connection is active, allowing the device to transfer data at its highest possible rate.

If an Ajax Call is needed when the Android Device is in Sleeping Mode (thus, radio in StandBy state), the request timeout must account for the 2 seconds the radio needs to transition to the Full Power state. Otherwise, the Ajax Call may be finished before the data transfer is completed. For instance, my experience showed that with 3 seconds timeouts, the call was terminated before getting the answer from the server.

SECURITY_ERR: DOM Exception 18 when Opening WebSql Database in Android 4.3 WebView (API level 18)
Context:
  • Webview with myWebView.getSettings().setDatabaseEnabled(true);
  • App working fine for many years.
  • Usage of javascript instruction openDatabase("db_name", "1.0", "db_name", 50 * 1024); in WebView loaded pages.
  • As of 13/12/2016, suddenly openDatabase triggers a DOM Exception 18 and the app does not work anymore. I presume due to one of the last Android system updates.
Solution:
To solve this issue you need to do from Android 4.3 WebView:
  1. set DatabasePath
  2. override onExceededDatabaseQuota
You need to do this even if the IDE complains about this functions being overriden in API level >= 19.

More info related to this problem can be found here.
Comments