All Projects → bernaferrari → Changedetection

bernaferrari / Changedetection

Licence: apache-2.0
Automatically track websites changes on Android in background.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Changedetection

Sdkmonitor
App to display and monitor the targetSDK from installed apps.
Stars: ✭ 122 (-78.33%)
Mutual labels:  android-app, dagger2, viewmodel, room, material-design, android-application
Base Mvvm
App built to showcase basic Android View components like ViewPager, RecyclerView(homogeneous and heterogeneous items), NavigationDrawer, Animated Vector Drawables, Collapsing Toolbar Layout etc. housed in a MVVM architecture
Stars: ✭ 18 (-96.8%)
Mutual labels:  dagger2, viewmodel, room, architecture-components, livedata, room-persistence-library
Popularmovies
🎥 Movie discovery app showcasing Android best practices with Google's recommended architecture: MVVM + Repository + Offline support + Android Architecture Components + Paging library & Retrofit2.
Stars: ✭ 142 (-74.78%)
Mutual labels:  android-app, viewmodel, room, architecture-components, material-design
Githubprojectbrowser
This is a sample Android Project that is based on Clean Architecture
Stars: ✭ 64 (-88.63%)
Mutual labels:  dagger2, viewmodel, room, architecture-components, livedata
Simple-Notes-Kotlin-App
✍️ Simple Note Making App use mvvm architecture , dagger , coroutines and navigation component. Features includes 🗒️ create , edit and ❌ delete notes
Stars: ✭ 40 (-92.9%)
Mutual labels:  room, dagger2, viewmodel, livedata, architecture-components
Nytimes App
🗽 A Simple Demonstration of the New York Times App 📱 using Jsoup web crawler with MVVM Architecture 🔥
Stars: ✭ 246 (-56.31%)
Mutual labels:  viewmodel, material-design, android-application, livedata, room-persistence-library
Fountain
Android Kotlin paged endpoints made easy
Stars: ✭ 175 (-68.92%)
Mutual labels:  dagger2, room, architecture-components, livedata, room-persistence-library
Superhero-App
🦸🏻‍♂️🦹🏻‍♀️Superhero app built with Kotlin, ViewModel, LiveData, ViewBinding, Room, and Hilt
Stars: ✭ 27 (-95.2%)
Mutual labels:  room, dagger2, viewmodel, livedata, architecture-components
News Sample App
A sample news app which demonstrates clean architecture and best practices for developing android app
Stars: ✭ 334 (-40.67%)
Mutual labels:  dagger2, viewmodel, room, architecture-components, livedata
Mvvmframe
🏰 MVVMFrame for Android 是一个基于Google官方推出的Architecture Components dependencies(现在叫JetPack){ Lifecycle,LiveData,ViewModel,Room } 构建的快速开发框架。有了MVVMFrame的加持,从此构建一个MVVM模式的项目变得快捷简单。
Stars: ✭ 218 (-61.28%)
Mutual labels:  dagger2, viewmodel, room, architecture-components, livedata
Wanandroid
🏄 基于Architecture Components dependencies (Lifecycles,LiveData,ViewModel,Room)构建的WanAndroid开源项目。 你值得拥有的MVVM快速开发框架:https://github.com/jenly1314/MVVMFrame
Stars: ✭ 410 (-27.18%)
Mutual labels:  dagger2, viewmodel, room, architecture-components, livedata
Androidroom
Android example to show how to use Room to access SQLite database on device for reading and writing data. This example also shows how to use LiveData and ViewModel with Room to build reactive, well performing and easy to maintain applications.
Stars: ✭ 36 (-93.61%)
Mutual labels:  android-app, viewmodel, room, android-application, livedata
Simple-Note-App-with-Online-Storage
✍️ Simple Note Making App use Sqllite Room 🧰 for caching the notes and 📥 Firebase Database for online storage
Stars: ✭ 42 (-92.54%)
Mutual labels:  room, dagger2, viewmodel, livedata, room-persistence-library
Mvvmarms
Android MVVM Architecture Components based on MVPArms and Android Architecture Components.
Stars: ✭ 425 (-24.51%)
Mutual labels:  dagger2, viewmodel, room, livedata
Coolweather
Weather App that uses Android best practices. Android Jetpack, clean architecture. Written in Kotlin
Stars: ✭ 154 (-72.65%)
Mutual labels:  android-app, viewmodel, room, architecture-components
Restaurants
Restaurants sample app built with the new architecture components (LiveData, Room, ViewModel) and Dagger 2
Stars: ✭ 47 (-91.65%)
Mutual labels:  room, viewmodel, livedata, architecture-components
Android Architecture Components Kotlin
Sample used to practice Kotlin and Android Architecture Components.
Stars: ✭ 326 (-42.1%)
Mutual labels:  viewmodel, room, architecture-components, livedata
TeamManagerApp
A sample app structure using the MVVM architecture LiveData, RxJava, ViewModel, Room and the Navigation Arch Components.
Stars: ✭ 36 (-93.61%)
Mutual labels:  viewmodel, livedata, architecture-components, room-persistence-library
Pursuit-Core-Android
Pursuit Core Android
Stars: ✭ 45 (-92.01%)
Mutual labels:  room, dagger2, viewmodel, livedata
Moviefinderusingmvvm Android
🔥 MVVM + Clean Architecture + Best Practices | 🍿Movie Finder is a sample Android application 📱to search movies using OMDb API which is built to demonstrate use of Modern Android development tools - (Kotlin, Coroutines, Kodein, Architecture Components, MVVM, Retrofit, Gson, Material Components) 😊😊😉
Stars: ✭ 66 (-88.28%)
Mutual labels:  android-app, viewmodel, material-design, livedata

ChangeDetection

Change Detection

This app tracks changes on websites you otherwise would visit frequently to see if there is something new. Use cases:

  • Teacher says grades will be published "soon", but no one knows what "soon" means and you are tired of reloading.
  • You are working with a server and wants to know the result from a request, periodically.
  • You are waiting for updates on an Exam, like if something was postponed or updated.
  • You want to monitor the Dagger documentation to see when Thermosiphon's explanation improves.

This app also showcases all the Android Architecture Components working together: Room, ViewModels, LiveData, Paging, WorkManager and Navigation.

Get it on Google Play Get it on F-Droid

GIF

Screenshots

Main Screen Text Diff PDF Diff Settings
First Sec Third Fourth

Introduction

Features

This app contains the following screens:

  • A list of websites that are currently being tracked.
  • A text details view, that allows the user to compare the current website version with previous versions.
  • An image details view, that allows the user to compare images in a carousel.
  • A pdf details view, that allows the user to compare pdfs in a carousel, similar to the images.
  • A settings view, that allows user to toggle auto-sync on/off and configure what is required for a sync to occur.
  • An about screen, with contact information.

Presentation layer

This app is a Single-Activity app, with the following components:

  • A main activity that handles navigation.
  • A fragment to display the list of websites currently tracked.
  • A fragment to display the history of changes from the selected website, when changes are not an image or a pdf.
  • A fragment to display the history of changes from images in a carousel format.
  • A fragment to display the history of changes from pdfs in a carousel format.

The app uses a Model-View-ViewModel (MVVM) architecture for the presentation layer. Each of the fragments corresponds to a MVVM View. The View and ViewModel communicate using LiveData and general good principles.

Data layer

The database is created using Room and it has two entities: a Site and a Snap that generate corresponding SQLite tables at runtime. There is a one to many relationshiop between them. The id from Site is a foreign key on Snap. Snap only contains the snapshot metadata, all the data retrieved from the http request (body response) is stored in Android's own File storage.

To let other components know when the data has finished populating, the ViewModel exposes a LiveData object via callbacks using interfaces (inspired from this todo app). This could be, eventually, easily extended to work with server and sync. The app also makes use of Kotlin's Coroutines to deal with some callbacks.

Simple comparison process

The app works like this:

  1. Make http request and store the body response in a byteArray.
  2. Retrieve most recent stored file for that site, if any.
  3. Convert to string, clean up Jsoup and compare them. If same, don't do anything else. If different, add the new byteArray to storage and create a new entry on Snap table. When this happens in background, a notification is created to warn the user.
Inside the App Outside the App
inside outside

Diff Process for text files

After a change is detected and user taps to see it, a byte to byte comparision wouldn't be readable, so it makes sense to make a text comparison.

That's why this app makes extensive use from java-diff-utils. In fact, part of the library was converted to Kotlin and is now working perfectly on Java 6 (the original library makes use of Streams, which is only supported on Java 8). All the diff process is made using Myer's diff algorithm, and the result, for performance reasons, is put on a RecyclerView.

When this diff process happens, the app will use jsoup with a relaxed whitelist to remove all the useless tags from html to avoid pages that generate them at every request. Example: pages that make use of Google Analytics and pages that were made in WordPress. The app will also use jsoup to unescape "<" and ">" from html.

Diff Process for image and pdf files

It makes no sense to compare images and visual files using strings, so there is a carousel to compare them. PDF's are rendered to an imageView, while images are rendered with support for tiling, which is great for ultra-heavy pictures - in case user is tracking changes for a 20mb photo.

How each Architecture Component is used

  • Navigation: this is a single activity app. All fragment transactions (except one) are made using Navigation library.

  • WorkManager: responsible for automatically syncing when the app is in background. There are four constraints: battery not low, device on idle state (API 23+), device charging and wifi on. Wifi is currently not a constraint from WorkManager, so I implemented it myself to work together.

  • Paging: on details fragment. As time goes, it is possible for a website to receive hundreds of updates. To avoid OOM error once and for all, Paging was implemented. When visualizing PDF/Image changes (the carousel view), paging is implemented on the carousel, so that it doesn't loads all Files into memory at once.

  • LiveData/ViewModel: written above.

  • Room: written above.

Third Party Libraries Used

  • Android-Iconics deal with icons without suffering.
  • Architecture Components all of them, as stated above.
  • Groupie for making RecyclerViews as simple as possible.
  • java-diff-utils generate the difference between two strings.
  • Logger logs that are useful and disabled on release.
  • material-about-library create an about page without suffering.
  • Material Dialogs show dialogs in a simple and easy way.
  • Notify create notifications without effort.
  • ok-http fetch the webpages.
  • Stetho debug the database easily.
  • ThreeTenABP for dealing with time in a Java 8 way.
  • timeago makes it easy display relative dates (i.e. 1 day ago).
  • RxJava responsible for coordinating the reload button animation and updating the text on main screen cards periodically.
  • jsoup cleaning up html files.
  • Dagger 2 dependency injection for sharedPreferences with application Context, provides singleton database instances.
  • Alerter show beautiful notifications when some site was updated while the user is browsing the main fragment.

Reporting Issues

Issues and Pull Requests are welcome. You can report here.

License

Copyright 2018 Bernardo Ferrari.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].