Up until now we’ve created a Retrofit service to communicate with the weather API, we also created all of the pieces needed for a local database using the Room library. So, we basically have all of the data components of our app implemented, right? We can fetch data and then cache it locally, so all that’s left to do is to put it all in a repository to somehow centralize network and local data calls.
Well, while we’re really close to creating a repository, we still have one important step unfinished. We need to wrap the retrofit weather API service into a special class to create an abstraction and to give the code making network calls a better structure.
?Get the code from this tutorial?
what’s the name of the theme that you are using in the android studio?!
I’ve searched and installed many material themes for that, but none of them was like the one that you are using! 😀
It’s a plugin Material Theme UI https://plugins.jetbrains.com/plugin/8006-material-theme-ui
This plugin contains many themes and I use the one named Material Darker.
what is alternative of getActiveNetworkInfo method because it shows deprecated in java i stuck on this i tried to find solution but not getting any proper answer, Btw your tutorials are Awesome!
Here i’m using:
android Studio version -> 3.4.1
kotlin plugin version -> 1.3.40
compileSdkVersion -> 29
minSdkVersion -> 21
targetSdkVersion -> 29
Hi,
In this tutorial how would you be able to handle network call callbacks like for events when there is a success call, onerrors (httperror), any throwable failures.
What you did was handle the no network error in the DataSourceImpl, and only use Log.e
But developers will need to get a handle on that event and do UI changes, for ex. showing error messages.
For the success calls, I guess it will trigger the observer and pass the LiveData
But how do you handle the different error scenarios?
Thanks
Why isn’t this custom exception caught when it is inherited from Exception instead of IOException?
Thanks for sharing. I read many of your blog posts, cool, your blog is very good.