Git Product home page Git Product logo

android-kotlin-webview's Introduction

Android Kotlin WebView

API

Description

An Android WebView simply converted from Java to Kotlin using the basic Android Studio tool.

Table of Contents

Installation

  1. Clone the project;
  2. unzip the folder;
  3. run Android Studio;
  4. open a new project;
  5. and pick the package.

Usage

Change the URL indirectly from strings.xml from:

<string name="website_domain">quaestio.org</string>

<string name="website_url">https://quaestio.org</string>

to:

<string name="website_domain">your.url</string>

<string name="website_url">http://your.url</string>

Or change the loadURLdirectly in MainActivity.kt from:

21 mWebView.loadUrl(getString(R.string.website_url))

30 if (Uri.parse(url).host == getString(R.string.website_domain)) {

to:

21 mWebView.loadUrl("http://your.url")

30 if (Uri.parse(url).host == "your.url") {

And don't forget to edit the following lines in the AndroidManifest.xml file:

<data

android:host="quaestio.org"

android:scheme="https" />

Contributing

This sample is open to contributions; please, read Contributing guidelines before opening new issues or submitting pull requests to this repository.

Credits

A live demo can be seen from Quaestio's web app which loads similar Android Kotlin WebView pieces of code.

A special thanks to Vamsi Tallapudi's Android Java WebView sample and CodeRefer's tutorials for the introductory lessons they provided in the past.

Screenshots

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use files of this sample except in compliance with its License.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "as is" basis, without warranties or conditions of any kind, either express or implied.

See the License for the specific language governing permissions and limitations under the License.

android-kotlin-webview's People

Contributors

jorgeamvf avatar naxa777 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.