Closed pfent closed 6 years ago
@pfent allowMainThreadQueries() :+1:
Migrate Managers to use entities and DAOs:
Misc:
AbstractManager.resetDb()
EnhancedSearchRecentSuggestionsProvider
@anselm92 @psukys I allready work on ChatMessageManager, ChatRoomsManager
@pfent @kordianbruck Regarding the strategy to replace main thread queries, i'd suggest using rxandroid (or rxjava in case of persistence api), I've used it many times before and love it :)
See: https://medium.com/google-developers/room-rxjava-acb0cd4f3757
Advantages:
I'll implement it for one dao, to show how to use it.
@anselm92 what are the benefits over using livedata?
Basically:
Are we going to need it? Idk, i thinks it's more a matter of taste
See: https://stackoverflow.com/questions/46312937/when-to-use-rxjava-in-android-and-when-to-use-livedata-from-android-architectura http://akarnokd.blogspot.de/2017/10/android-livedata-api-quick-look.html http://hannesdorfmann.com/android/arch-components-purist
I'd say go for it.
Rxjava would probably also be great for a lot of the Networking stuff, where we currently use AsyncTasks
Building a common rxjava usage pattern for database and network access will award you all the kudos :)
Alright, I've refactored the first manager (CafeteriaManager) into a viemodel approach with rxjava. (It already works, but it's still more a draft.)
Please have a look and tell me what you think about it:
https://github.com/TCA-Team/TumCampusApp/commit/c24e3996369947d7312ef38c73721ffdd691646b
I like the rxjava approach. I'mma converting NewsManager at the moment.
I haven't added rxjava (even tho PR is still big), will move into DAOizing Calendar manager as NewsManager is ready for review
@TCA-Team/android three left to go :tada:
@OliHalu I take the SurveyManager then
We currently don't have an ORM, but write all SQL queries / mappings by hand.
Google recently released the Android Architecture Components with the Room Persistency Library. We should probably use this, which should significantly reduce the complexity of our various "Managers"