Skip to content

duttabhishek0/Breeze

Repository files navigation

Breeze

A modern music-playing app, built using Modern-Architectural practices.

GitHub release Minimum SDK

How to build the app

  • clone the repo
  • open the app in android studio
  • run the application

What is used in this app

Structure

The project is divided into two parts :

  1. Player
  2. App

Player

As the name suggests, the Player part is responsible for handling all the events:

  1. Play/Pause the Music
  2. Handle user input from Notification Bar
  3. Manages Next/Previous

App

This is the part of the application, that manages the overall performance of the application. The structure of this applilcation:

- data
   -- model
      - Song
   -- repository
      - PlaylistRepositoryImp
   -- source
      - dao
        - SongDao
      - AppDatabase

The above structure forms the lowest level of the architecture for Breeze. This is the level, where a song is stored and all modification(Insertion of a song/ Deletion of a song/Retriveal of song) happens.

To store a song, a 'Song' Entity is created(aka Table), with the following schema:

data class Song(
    @PrimaryKey var id: Int,
    var songName: String?,
    var path: String,
    var artistName: String?,
    var albumArt: String?,
    var duration: String?,
    var type: Int = 0
) : ASong(id, songName, albumArt, artistName, path, type, duration), Parcelable

The following operations can be performed on the Song entity using SongDao :

@Insert(onConflict = OnConflictStrategy.REPLACE)
fun insert(song: Song): Long

@Query("SELECT * FROM Song")
fun loadAll(): MutableList<Song>

@Delete
fun delete(song: Song)

@Query("DELETE FROM Song")
fun deleteAll()

@Query("SELECT * FROM Song where id = :songId")
fun loadOneBySongId(songId: Long): Song?

@Query("SELECT * FROM Song where title = :songTitle")
fun loadOneBySongTitle(songTitle: String): Song?

@Update
fun update(song: Song)

In this project, Koin is used for dependecny injection.

License

  Copyright (c) 2021 ABHISHEK (https://github.com/duttabhishek0)

   Licensed 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.

About

Lightweight and Material designed Music Player

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages