Main. xml is as follows: [html] <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 "> <WebView android: id =" @ + id/webView "android: layout_width =" wrap_content "android: layout_height =" wrap_content "android: layout_centerHorizontal =" true "android: l Ayout_centerVertical = "true"/> </RelativeLayout> MainActivity: [java] package c. c; import android. OS. bundle; import android. webkit. webView; import android. webkit. webSettings. layoutAlgorithm; import android. app. activity;/*** Demo Description: * use WebView to load network PDF resources * Method 1: Use the browser of the device to open the pdf * Method 2: after Google service resolution is used, open pdf * In mWebView. Note: * it is best to connect to VPN */public class MainActivity extends Activity {private WebView mWeb during testing. View; @ Override protected void onCreate (Bundle savedInstanceState) {super. onCreate (savedInstanceState); setContentView (R. layout. main); init ();} private void init () {mWebView = (WebView) findViewById (R. id. webView); // method 1 loadPDF1 (); // method 2 // loadPDF2 ();} // Method 1: open pdf private void loadPDF1 () in the browser that comes with the device () {mWebView. getSettings (). setJavaScriptEnabled (true); mWebView. getSettings (). setsuppzoom zoom (true); mWe BView. getSettings (). setDomStorageEnabled (true); mWebView. getSettings (). setAllowFileAccess (true); mWebView. getSettings (). setPluginsEnabled (true); mWebView. getSettings (). setUseWideViewPort (true); mWebView. getSettings (). setBuiltInZoomControls (true); mWebView. requestFocus (); mWebView. getSettings (). setLoadWithOverviewMode (true); mWebView. getSettings (). setLayoutAlgorithm (LayoutAlgorithm. SINGLE_COLUMN ); String weburl = "http://www8.cao.go.jp/okinawa/8/2012/0409-1-1.pdf"; mWebView. loadUrl ("http://docs.google.com/gview? Embedded = true & url = "+ response url);} // Method 2: Open the pdf private void loadPDF2 () {mWebView in the mWebView after Google resolution. getSettings (). setJavaScriptEnabled (true); mWebView. getSettings (). setsuppzoom zoom (true); mWebView. getSettings (). setDomStorageEnabled (true); mWebView. getSettings (). setAllowFileAccess (true); mWebView. getSettings (). setPluginsEnabled (true); mWebView. getSettings (). setUseWideViewPort (true); mWebView. getSet Random (). setBuiltInZoomControls (true); mWebView. requestFocus (); www.2cto.com mWebView. getSettings (). setLoadWithOverviewMode (true); mWebView. getSettings (). setLayoutAlgorithm (LayoutAlgorithm. SINGLE_COLUMN); String inline url = "http://www8.cao.go.jp/okinawa/8/2012/0409-1-1.pdf"; String data = "<iframe src = 'HTTP: // docs.google.com/gview? Embedded = true & url = "+ response url +" '"+" width = '000000' height = '000000' style = 'border: none;'> </iframe> "; mWebView. loadData (data, "text/html", "UTF-8 ");}}