![]() ![]() ![]() Handled all the interaction with FireBase in the ViewModel and providing required data to be consumed by Views Step 1 : Registered my app over firebase console and below screen shoot for the same: This screen uses firebase “Realtime Database”. (4) Tax List: This screen displays list of Tax details entered by user based on email ID This screen uses firebase “Realtime Database” and “storage” features. Allows user to upload pdf docs as proof for bills. (3) Tax Info Entry screen: In this screen user will be provided UI to enter info about Tax bills and submit that data. (2) Registration screen : This screen allows user to register with email/password over firebase.įor the above 2 screens we use firebase “Authentication” feature. (1) Login Screen : Authenticates the logged user with email/password provided The sample that is used as part of demonstration contains below screens: The application uses below features of firebase: ![]() So that's it! You can find the full code and working project from my Github.This story demonstrates a sample android application for using FireBase Database with MVVM using Kotlin. Observer will get triggered after calling postValue() in getUpdatedText() function and then the MainFragment can update the UI text element with the updated data. Next we add a MutableLiveData which will trigger an update for our observer that we created in MainFragment. First we create a DataModel so we can have a text that's going to get updated after clicking a button. So like I said earlier, viewModel is taking care of the logic that's not directly related to UI objects. */ class MainFragment : Fragment () Įnter fullscreen mode Exit fullscreen mode * - listens to viewModel for updates on UI Package import android.os.Bundle import import import import import import import import .FragmentMainBinding import .MainViewModel /* ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |