5 Android WebView Secrets You (Probably) Didn’t Know

5 Android WebView Secrets You (Probably) Didn’t Know

WebViews are an indispensable part of apps nowadays. They let you quickly add a handy UI screen on the fly by leveraging the skills of your web development team.

WebViews are an indispensable part of apps nowadays. They let you quickly add a handy UI screen on the fly by leveraging the skills of your web development team.

Recently, I was working on a smart browser app and figured out that WebViews can do a lot more than just displaying web pages.

In the following sections, I’ll list a few lesser-known tips and tricks to help Android developers power up their WebViews and have greater control over JavaScript code right from their native Java/Kotlin code bases.

Let’s jump right in.

1. Intercepting URLs

By implementing the method shouldOverrideUrlLoading during WebViewClient’s initialisation, we can intercept the intermediate URL by using pattern matching during navigations.

This way, you can control whether the URL should be loaded or open a certain activity/service using intents.

The following code snippet shows the actual method that you need to implement:

Code snippet

kotlin java javascript programming android

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Top Android Projects with Source Code

Android projects with source code - Work on real-time android projects. We’ll start project ideas from beginners level and later move to advance projects.

Java vs Kotlin for Android Development — 16 Pros and Cons

The technical difference is significant, but if you plan on doing Android development, learn both. Most of the popular libraries are backward compatible with Kotlin, Java code can be used in Kotlin and vice versa, but to solve a problem or simply understand all the nuances of the documentation, you should know Java. Having mastered both programming languages, you will become a sought-after specialist and secure a good future for yourself in developing applications for Android.

Java vs. JavaScript: Know The Difference

Java vs. JavaScript: Know the Difference, Java vs. JavaScript: What's the Difference? Java vs. JavaScript: Major Similarities and Differences. pros and cons of JavaScript and Java.

How to Install OpenJDK 11 on CentOS 8

What is OpenJDK? OpenJDk or Open Java Development Kit is a free, open-source framework of the Java Platform, Standard Edition (or Java SE).

Kotlin vs Java | Kotlin or Java For Android Development | Kotlin And Java Difference

Kotlin and Java have showcased the cut-throat competition in the lastest Android Development. There are a lot of ambiguities amongst developers to choose one, from both. This video will help you to understand the strengths and weaknesses of both with a head to head comparison.