Posts

Showing posts from August, 2020

Android CameraX Picture And Video Capture Complete Code Tutorial

Image
This tutorial explains how to use Android CameraX to develop a full working camera app, including picture / video capture and writing media files to system DCIM folder, with the help of the new CameraX widget CameraView. It's Android 10 compatible.  App running Gif: We all know how complicated and frustrating Android Camera2 was. The good news is we now have CameraX, though still in beta phase, but fully workable. With CameraX and CameraView, we can write way less code than Camera2. 1. Add D ependencies And C ompileOptions Let's open your module/app level build.gradle file and add dependencies and compileOptions : (File build.gradle) apply plugin : 'com.android.application' android { compileSdkVersion 29 buildToolsVersion "29.0.3" defaultConfig { applicationId "com.haoc.cameraxfullcodedemo" minSdkVersion 23 targetSdkVersion 29 versionCode 1 versionName "1.0" testInstrumentationR...

How To Web Scrape Dynamic Website And JSON Decode With Detailed Examples

Image
In this article, Flutter / Dart is the main language used to demonstrate how to web scrape a dynamic website and then JSON decode into Map or List. But the general idea also applies to Java and Python. When we talk about web scraping, we think of Beautiful Soup immediately. Unfortunately, most websites nowadays are dynamic. And Beautiful Soup only works for static websites. Today I'll explain how to scrape a dynamic website. I'll use TheWeatherNetwork.com as an example. The Weather Network is my favorite weather forecast website. 1. Determine whether the website is dynamic Take a look at the screen capture of The Weather Network website showing current weather of Vancouver, BC Canada. This demo will grab those 3 pieces of information in red circles. They're current condition description, current temperature and current feels-like temperature. Beautiful Soup can only analyze the page source content. Let's see if we can find current condition "A few clouds" in ...