Demo of Downloading Songs/Images through Android Download Manager using RxJava2

Overview

Downloader Demo using RxJava

Overview

This project is for downloading items(songs, images etc) in Android using RxJava2. There are, however 2 conditions which I have set for downloading.

  • Only 2 items can be downloaded at a time. So even if the user clicks multiple items to download, only 2 of them will be actually downloaded at a time and the rest of the downloads will be en queued.
  • The download percent is shown to the user. But only if the difference between the current percentage and the previously shown percentage is greater than 5 percent.

                                               

Demo

                                               

                                               

There are few important RxJava classes that I have used to do this project:

  • Observable - Emits a stream of events
  • Flowable - Emits a stream of events. The Flowable is created using a BackpressureStrategy like BackpressureStrategy.BUFFER or BackpressureStrategy.DROP. So, if the number of items emitted by the Flowable is greater than the number of items consumed by the subscriber, based on the BackpressureStrategy, the extra items will either be buffered or dropped.
  • Observer - Used to observe/subscribe a stream of events. Whenever the observer is connected to the Observable, a Disposable object is received, which is further used to dispose the connection. This class has 4 methods.
  • Subscriber - Similar to Observer, this class is also used to observe/subscribe a stream of events and has 4 methods. But instead of Disposable object, a Subscription option is received at the time of connection, which is further used to dispose the connection or request new items from the stream.

I wrote a blog about how I used RxJava2 for achieving this. Here is the post.

                                               

NOTE : Since this is a demo project and not an actual project, I have kept the images and urls to be downloaded hardcoded in the client. There is no server call. Also, for every item I am saving the download status and download percent in the shared preference. In a real project, it should be ideally saved in a database.


Checkout my other projects

AppDataReader - A library for reading Shared Preferences and Database values within the application.

RxFbLiveVideoEmoticons - Demo of Fb Live Video Reactions using RxJava2.

WebViewDemo - A demo project for showing how to use WebViews in Android.

You might also like...
Android app for streaming and downloading Movies, TV-Series and Anime.
Android app for streaming and downloading Movies, TV-Series and Anime.

AquaStream ⚠️ Warning: By default this app doesn't provide any video sources, you have to install extensions in order to add functionality to the app.

Application for downloading and installing skins for minecraft.
Application for downloading and installing skins for minecraft.

Minecraft skins Application for downloading and installing skins for minecraft. Also user can choose favourites skins. Table of Contents Screenshots G

A template for Advent of Code challenge with input downloading and prepared test classes
A template for Advent of Code challenge with input downloading and prepared test classes

Advent of Code Kotlin Template A template which will help you concentrate on the puzzle solutions. It brings Downloading and caching of the puzzle inp

A small app for downloading adrianmato.art wallpapers

Artdrian A small app for downloading adrianmato.art wallpapers Technical details of the app Target SDK: 33 ./gradlew test #Execute Unit testing ./grad

An Android app that lets you download free children's books in different languages from non-profit publisher Book Dash
An Android app that lets you download free children's books in different languages from non-profit publisher Book Dash

Bookdash Android Check out the blog post here: http://riggaroo.co.za/book-dash-android-app/ Download the app: https://play.google.com/store/apps/detai

📦📦Video downloader for Android - Download videos from Youtube, Facebook, Twitter, Instagram, Dailymotion, Vimeo and more than 1000 other sites
📦📦Video downloader for Android - Download videos from Youtube, Facebook, Twitter, Instagram, Dailymotion, Vimeo and more than 1000 other sites

youtube-dl-android 📦 An Android client for youtube-dl: https://github.com/rg3/youtube-dl Major technologies Language: Kotlin Architecture: MVVM Andro

Android-fbdownload - N2Q FB-Download

N2Q FB-Download Add it in your root build.gradle (or settings.gradle) at the end

An Android app to stream and download your media stored in Google Drive in an Awesome way !!
An Android app to stream and download your media stored in Google Drive in an Awesome way !!

⚡ Thunder : An Android app to stream and download your media stored in Google Drive in an Awesome way !! (Just Movies for now) 🔘 Getting Started : Le

Wallpaper and ringtone Application which allows user to set and download Wallpaper or ringtone
Wallpaper and ringtone Application which allows user to set and download Wallpaper or ringtone

Wallpaper Wallpaper is a Wallpaper and ringtone Application which allows user to

Owner
Anshul Jain
Love writing blogs and reading new stuff.
Anshul Jain
Ivy Wallet is an Open Source money manager app for android that you can either build or download from Google Play.

Ivy Wallet is an Open Source money manager app for android that you can either build or download from Google Play.

null 727 Dec 26, 2022
A music picker library for React Native. Provides access to the system's UI for selecting songs from the phone's music library.

Expo Music Picker A music picker library for React Native. Provides access to the system's UI for selecting songs from the phone's music library. Supp

Bartłomiej Klocek 60 Dec 29, 2022
PDFER - App demo that uses WorkManager API to download and schedule PDFs in the background

PDFER App demo that uses WorkManager API to download and schedule PDFs in the background Download PDF You can either download custom pdf files by plac

Ahmed Samir 4 Nov 22, 2022
Demo app demonstrating how to create and manage notifications locally using a combination of Jetpacks Worker Manager and Broadcast Receiver.

Worker Notification Demo app demonstrating how to create and manage notifications locally using a combination of Jetpacks Worker Manager and Broadcast

Ayia 1 Sep 19, 2022
Attendance-Manager - Attendance Manager, a attendance recording app that helps stay at your 75% attendance

Android-Study-Jams Attendance tracker app Problem Statement: There has been a ne

Gdsc_JMI 1 Jan 9, 2022
Android-splash-screen-demo - Sample application to demo the various features provided in android-splash-screen

Android Splash screen API demo This is a sample application used to demonstrate the various features provided in android-splash-screen. More details c

Sridhar 1 Jan 3, 2022
OpenWeatherMap-API-Demo - Demo Android Application for OpenWeatherMap API

WeatherForecast Demo Android Application for OpenWeatherMap API Table of Content

Rashid Hussain 0 Jul 10, 2022
Android app for downloading novels

QuickNovel Adfree FOSS Android app for downloading novels. Discord: https://discord.gg/5Hus6fM Download: https://github.com/LagradOst/QuickNovel/relea

Osten 509 Jan 9, 2023
Android app for streaming and downloading Movies, TV-Series and Anime.

CloudStream-3 DOWNLOAD: https://github.com/LagradOst/CloudStream-3/releases Discord: https://discord.gg/5Hus6fM Features: AdFree, No ads whatsoever No

Osten 1.9k Aug 1, 2022
Downloading and saving cats for android

Task 5: Downloading and saving cats! Use this API: https://docs.thecatapi.com/ to implement the app with the following features: Ability to download a

null 0 Oct 5, 2021