What Will I Learn?
- You will learn how to build a Web View using Android and Kotlin
- You will learn about some of the basic android life cycle components
- You will learn how to build an application that uses intents and contexts to switch around various activities
Requirements
- Android Studio 3.0 or Android Studio Canary
- A basic understanding of the Android ecosystem
- A fair understanding of Kotlin or the Java programming language
Difficulty
- Intermediate
Description
In this video tutorial, we build a basic Android Web View using Kotlin. This project is a very good introduction to the basics of building Android Applications in general and with Kotlin. We make two separate activities with two Constraint-Layout XML views. The first activity just serves as a splash screen which helps to hide the loading of the Web View in the background. The primary activity makes use of a Web View and an Image View. The Web View implements basic functionality; it allows JavaScript to run in the browser and uses the back button to allow the user to move backwards through the browser's history.
We also add some error handling that checks to see if the device is connected to the internet while it tries to load the steemit webpage. Our Image View uses a Steem logo to create an animation to help signify to the user that the Web View is still loading the content. We also add an Alert Dialog which pops up in the event of an error. This Alert Dialog lets the user quit the application, reload the URL, or go directly into the network settings to fix their connection problems.
The source code for this project can be found here
Video Tutorial
Related Content
- Desktop Applications in Kotlin
- Intro to Kotlin Series
- Intro to Kotlin (Basic Types, Type Inference, Casting and Strings)
- Intro to Kotlin (Basic Operations and Collections)
- Intro to Kotlin (Control Flow and Conditionals)
- Intro to Kotlin (Functions in Kotlin)
- Intro to Kotlin (Advanced Functions)
- Intro to Kotlin (Classes, Visibility Modifiers, Objects)
- Intro to Kotlin (Nullables, Data Classes, Enum Classes and Sealed Classes)
- Intro to Kotlin (Interfaces, Inheritance, Type Alias and Abstract Classes)
Posted on Utopian.io - Rewarding Open Source Contributors