0

I have an android application which primarily uses the webview to render content. The webcode makes requests to the android app, which houses a sqlite database and a bunch of data that it syncs from my server.

I have done a lot of profiling, and there is a lot of time that is completely unaccounted for. Here is a timeline for one of our requests:

enter image description here

The first big block of stuff happening is the request itself to load some data from the application's database. The last block is our webcode receiving the response from the app and rendering everything. The middle stuff is just some background tasks happening in the webview.

There's a lot of seeming dead space here. I've profiled everything in the android app that happens when a request is made, including the query itself, and it's a minuscule amount of time, there are hundreds of milliseconds unaccounted for.

Are there known performance issues with Android in this regard?

This app is for build 21+ only.

Slims
  • 864
  • 2
  • 13
  • 31

1 Answers1

0

use this:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
    webView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
} else {
    webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}

manifest.xml add below:

in application level :

  <application android:hardwareAccelerated="true">

in Activity level :

<activity android:hardwareAccelerated="false" />
Santosh Bachkar
  • 460
  • 4
  • 14