- Supported devices - API 21 (Android 5.0, Lollipop) and above.
- The URLs have been scraped using JSOUP. It's a simple library that does that job.
- The UI contains two textViews for single results each, and one recyclerview for a large blob of list. The recyclerview has been chosen to avoid blocking the UI and only render data according to the current scroll position.
- The project uses fast-list to quickly inflate a functional recyclerview.
- The code design is powered by a view layer, interactor layer (viewModel) and a data layer.
- Using a sealed class called outcome to cleanly get a success or a failure response in the view layer.
- The business logic has been separated to a dedicated class
- For finding words separated by any whitespace with the number of repetitions, i've used kotlin's built-in functions to filter out data.
- The data will persist across screen orientation changes and will only request for an API call if the live data is empty or theres a request to force the network call.
- Please disconnect from any VPN while running this app. It may cause exception while scraping the URLs.
morristech / android-web-scraper Goto Github PK
View Code? Open in Web Editor NEWScraping a Wikipedia page to demonstrate the use of JSOUP, Suspended Kotlin Coroutines, ViewModel from AAC and persisting data across screen orientation changes and separation of concerns.
License: Apache License 2.0