abusous2000 / LibraryApp

Android App that demonstrates using Data Binding, Live Data, RecyclerView, Dagger2, MQTT, Retrofit with google's Room DB

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LibraryApp

This is a small (but very involved) Android App that is based on Library App developed by Ozgur Tas. Although it is a simple App, it demonstrates many technologies in one app such as: MVVM pattern, RecyclerView, Dagger 2, Data Binding, Kotlin Coroutines, Room DB, and LiveData. As demonstrated, my version does what Mr. Tas implemented, however, I've done the following improvements:

  • removed the repository layer and replaced it with a Business Object layer. In the near future, I will upgrade it to function more like JBoss Hibernate (a popular ORM framework)

  • the DAO layer has been made to be more generic

  • simplified Dagger 2 integration, and removed several unneeded classes

  • Initial DB is no longer hard coded, and it's now retrieved at startup via Restful webservices using Retrofit 2

  • The app subscribes to MQTT Broker and listens to incoming messages to execute CRUD operations, like adding and deleting books & categories. here's a sample payloads that you can send from the command line using mosquitto publish tool:

    • mosquitto_pub -h broker.hivemq.com -t "abusous2000/myTopic" -m '{"actionEvent":"insertBook","data":"{ \"bookName\": \"Sam Fan#5\", \"bookUnitPrice\":44.30, \"bookCategoryID\":1, \"resourceId\":4}"}'
    • mosquitto_pub -h broker.hivemq.com -t "abusous2000/myTopic" -m '{"actionEvent":"insertCategory","data":"{\"categoryName\":\"My Best Collection4\",\"categoryDesc\":\"The Best Collection\"}"}'
  • Integrated a drawer and popup menues

  • Now Catgeories coud be created, inserted and deleted from the UI

Main Image Menu Image Main Image

Let me know what you think guys Peace,

Abu al-Sous

About

Android App that demonstrates using Data Binding, Live Data, RecyclerView, Dagger2, MQTT, Retrofit with google's Room DB

License:Other


Languages

Language:Kotlin 100.0%