1

So I made this WebView app with a webpage and another googlemap activity, but the webview is running really slow(the page loads slower than it should and the scrolling is very slow and laggy), and I've tried:

Change the page 
android:hardwareAccelerated  
LAYER_TYPE_SOFTWARE
LAYER_TYPE_HARDWARE 
setRenderPriority(deprecated, I know)
webSET.setDatabaseEnabled(true); 
webSET.setDomStorageEnabled(true);
webSET.setAppCacheEnabled(true);
webSET.setCacheMode(WebSettings.LOAD_NO_CACHE);

Nothing seems to be working. I can't get why it is so slow And also the text is weird. Google chrome runs the page really good. Some pictures: https://www.dropbox.com/sc/cgqs05pm1v4qrdr/AADFe17cWdjQnhjDOHaLjinIa

EDIT: I am trying to configure XWalk, but I am having problems MainActivity.java package com.gvglive.gvglive;

import android.provider.ContactsContract;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import org.chromium.content_public.browser.WebContents;
import org.xwalk.core.XWalkPreferences;
import org.xwalk.core.XWalkView;


public class MainActivity extends ActionBarActivity {
    private XWalkView mWB;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mWB=(XWalkView)findViewById(R.id.mWB);
        mWB.load("http://gvglive.com/", null);


    }
}

AndroidManifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.gvglive.gvglive" >
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

activity_main.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">
<org.xwalk.core.XWalkView
    android:id="@+id/mWB"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"/>
</RelativeLayout>

build.gradle(Module:app)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "com.gvglive.gvglive"
        minSdkVersion 14
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
repositories {
    maven {
        url 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2'
    }
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'org.xwalk:xwalk_core_library:12.41.296.5'
}

Any help would be appreciated.

lakimens
  • 35
  • 10
  • What minimum Android API Level do you need to support? – EpicPandaForce Mar 21 '15 at 15:35
  • It's set to 14, android 4.0 – lakimens Mar 21 '15 at 15:36
  • Nice. You can use the `Crosswalk Project` from 4.0, and try if that is quicker for you: https://crosswalk-project.org/documentation/embedding_crosswalk/crosswalk_aar.html and try that (you basically just have to add a Gradle dependency and use the `XWalkView` ( http://stackoverflow.com/a/28205054/2413303 ). – EpicPandaForce Mar 21 '15 at 15:39
  • I just broke the R(R.id/R.layout) and it's asking me to import org.chromium.. – lakimens Mar 21 '15 at 16:25
  • uh. I don't have my sample code with me for how to use it, but just following this guide as per https://diego.org/2015/01/07/embedding-crosswalk-in-android-studio/ should help... – EpicPandaForce Mar 21 '15 at 17:11
  • Actually, I messed it up really hard, so I'm gonna have to redo it all again now :D – lakimens Mar 21 '15 at 19:49
  • ....uh... I'm sorry o-o but I hope it'll work this time! XWalk is good. It is stable across all 4.0 to anything above. – EpicPandaForce Mar 21 '15 at 23:06
  • I'll just redo the application tomorrow, it's nothing big, hope it helps.Thanka! – lakimens Mar 22 '15 at 02:12
  • I am getting Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_31\bin\java.exe'' finished with non-zero exit value 2 – lakimens Mar 22 '15 at 19:42
  • Here;s my code `public class MainActivity extends ActionBarActivity { private XWalkView mWB; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mWB=(XWalkView)findViewById(R.id.mWB); mWB.load("http://gvglive.com/", null); } ``` Sorry, don't know how to format it in the comments.. – lakimens Mar 22 '15 at 19:43
  • Make sure you put the XWalkView into a layout, like a FrameLayout or a LinearLayout or something. – EpicPandaForce Mar 22 '15 at 20:07
  • It's in a relative layout, I just couldn't post it because I was limited with characters. – lakimens Mar 22 '15 at 20:10
  • Try asking another question about it, posting your layout, your activity, your build.gradle file and your androidmanifest.xml (XWalk needs a bunch of permissions to start up) – EpicPandaForce Mar 22 '15 at 23:41
  • I just edited the question with everything needed.Thanks – lakimens Mar 23 '15 at 20:41
  • Try adding the repositories to the top level gradle file – EpicPandaForce Mar 24 '15 at 06:52
  • I think you accidentally removed **jcenter()** from your repositories in your build.gradle and you should add it back above the maven thing – EpicPandaForce Mar 25 '15 at 20:25
  • The build.gradle(Module:app) didn't have repositories, I had to add it and I'll check the other one – lakimens Mar 26 '15 at 14:13
  • `buildscript { repositories { jcenter() maven { url 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2' } } dependencies { classpath 'com.android.tools.build:gradle:1.0.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() maven { url 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2' } } }` – EpicPandaForce Mar 26 '15 at 15:19
  • this was mine, it was in the top level build.gradle – EpicPandaForce Mar 26 '15 at 15:19
  • I think I have it, but it's below the maven. Can that be the problem. I am at school right now so I can't check – lakimens Mar 26 '15 at 15:31
  • 1
    It just worked. Thanks for your help! – lakimens Mar 26 '15 at 19:13

0 Answers0