Skip to content
Experiment with Android WebView
Java HTML Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows
.idea
app
gradle/wrapper
myutils
.gitignore
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
pom.xml split request handler + expand intent tests Feb 16, 2020
settings.gradle

README.md

Android WebView

Experiment with Android WebView based on various tutorials:

Development

Use Android Studio to import this Git repository

Adapt assets/web/ and res/values/strings.xml for predefined websites, allowed hosts...

Testing

Check the latest release for app-release.apk

Note: steps 10-12 are new for release v1.15updated for release v1.16

  1. Press on HTML5 Test Site link or select in dropdown list

Verify that the app goes to the site via its own WebView and not by opening the standard browser

  1. Press Back on your phone or tablet to return to the first page

  2. Type in another URL like https://www.google.com/ in the Other: box and press the Go button

Verify that the app does NOT go to that site and tells you the link does not match. This default behavior can be changed in Advanced Options to open the regular browser instead

  1. Click on the Update Settings link to allow another site

Verify that you get to the Update Settings page with all the input fields

  1. Add https://www.google.com/ in the Other: field, and add the following in the empty Match fields:

host equals www.google.com

  1. Press the Update Settings button to submit the changes

Verify that your changes are shown in the result page (json format)

  1. Press the My WebView link or Back until you get to the first page

Verify that your new website is in the Other: field, and the host match is there

  1. Press the Go button to go to the site you specified above

Verify that now the app goes to that site without telling the link does not match or trying to open the standard browser

  1. Close the app and open it again

Verify that your new settings are still there

  1. Click on the Local Websites link and specify a .zip file in Download Bundle from trusted site (v1.16+)

For testing, you could download a bootstrap template from https://bootstrapmade.com/ and put it on your site, e.g. https://owncloud.mikespub.net/eBusiness.zip

  1. Press the Download Bundle button to download the site bundle and extract it (v1.16+)

Verify that your changes are shown in the result page (json format)

  1. Press the Local Websites link or Back until you get to the Local Websites page (v1.16+)

Verify that your local website is in the Site List now, and click the link to test it.

If you don't use Local Websites much and you unchecked the option to manage Local Websites separately, you can also:

  1. Click on the Update Settings link and specify a .zip file in Update Assets from trusted site (v1.15+)

If the .zip file contains a homepage at eBusiness/index.html, also change the Other: field to https://appassets.androidplatform.net/sites/eBusiness/index.html (or http://localhost/sites/eBusiness/index.html) to go to the local site in your app after the update.

  1. Press the Update Settings button to submit the changes (v1.15+)

Verify that your changes are shown in the result page (json format)

  1. Press the My WebView link or Back until you get to the first page (v1.15+)

Verify that your local website is in the Other: field, and press Go to test it.

You can’t perform that action at this time.