sogou / AWP-Demo

Accelerated WebView Project

Home Page:http://awp.mse.sogou.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Quick Start Guide to Using AWP(Accelerated WebView Project)

AWP is the extension of Android WebView put into a library for use on mobile. It offers an easy-to-use, high performance, standards-compliant, and secure way to use WebView. AWP has support for ALL Android version after Ice Cream Sandwich. This demo gives a brief introduction to using AWP.

Basics

First you will need to put awp_sdk.aar into your project's libs directory, and add below codes to your build.gradle.

    android {

        repositories {
            flatDir {
                dirs 'libs'
            }
        }
    }

    dependencies {
        compile(name: 'awp_sdk', ext: 'aar')
    }

Second you will need to call AwpEnvirnoment.init() to initialize AWP's envirnoment in Application.onCreate().

    class MyApplication extends Application {
        @Override
        public void onCreate() {
            super.onCreate();
            AwpEnvironment.init(this, true);
        }
    }

Now, you can use many fantasy features of AWP like these:

    // Enables debugging of web contents (HTML / CSS / JavaScript)
    AwpEnvironment.getInstance().setAwpDebuggingEnabled(true);
    AwpExtension extension = AwpEnvironment.getInstance().getAwpExtension(mWebView);
    if (extension != null) {
        // Enables SmartImages loading
        extension.getAwpSettings().setSmartImagesEnabled(true);
        // Enables NightMode
        extension.getAwpSettings().setNightModeEnabled(true);
    }
    // Enables AdBlock
    AwpSharedStatics statics = AwpEnvironment.getInstance().getSharedStatics();
    if (statics != null) {
        statics.setAdBlockEnabled(true);
    }

    and so on ...

Fantasy features

  • Support Proxy Override
  • Supports all Android version
  • Nothing need to change, only add single line codes
  • Friendly video playback
  • Ad Block
  • Password save
  • Night Mode

  • Smart Images loading

  • Fast ScrollThumb

  • Error Page

  • Selection Menu

AWP Home

Very welcome to try AWP Demo. If you have any problem or suggestion, please let me know AWP Home.

There are also useful examples for Developing apps with the Android WebView.

About

Accelerated WebView Project

http://awp.mse.sogou.com


Languages

Language:HTML 61.9%Language:Java 38.1%