We will use Django and REST Framework to build an authentication API whose data will be consumed in the Kotlin application. For instance, we use an API if we have a back-end application that we wish to send and receive data from another back-end or front-end application. The code snippet for the API is in this repository, while the code for the mobile application is here.Īn Application Programming Interface (API) is how an application can communicate with another application.If you are not interested in building the API, you can skip to the mobile part here.When working with dagger hilt for dependency injection, ensure that you annotate every activity, fragment and ViewModel correctly otherwise, the application will not run.However, from my point of view, here are some of the vital things to note. This tutorial is relatively long, but I made it to cover what I thought was best. ![]() Working with the Django Framework and the REST Framework.Basic understanding of Android programming.To follow along with this article, the reader should have the following: In this article, we will build an authentication API using the Django rest framework and consume the API in an Android application following the MVVM pattern. The pattern is adapted for its ease in unit testing, modularity and code organization for comfort in debugging. Model-View-ViewModel (MVVM) is a design pattern that separates the program logic from the user interface operations. ![]() As a result, developers currently adopt it with the added advantage of providing the browsable API. It provides developers with great flexibility and abstraction that achieves great functionalities in just a few lines of code. Django rest framework is a powerful tool for developing web APIs.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |