/android-webview

Experiment with Android WebView

Primary LanguageJava

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 updated 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/Moderna.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.

Testing without Manage Local Websites

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 Moderna/index.html, also change the Other: field to https://appassets.androidplatform.net/sites/Moderna/index.html (or http://localhost/sites/Moderna/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.

Try out Deep Links

See Deep Links

Privacy Policy

See Privacy Policy