Courtesy pexels.com

Developing Android Client app with Django rest Framework

Hassan Abid
2 min readAug 1, 2017

--

New and approved Android app with Kotlin and Coroutines is available at https://github.com/hassanabidpk/searchrestaurant/tree/master/v2/android

Last year, I wrote a blog post about developing an iOS app with Django backend. Many people requested an android version of it. So I decided to write this blog post. Although, I have already implemented the basic android version, however I couldn’t write the blog post until now.

Same with iOS version, I will use examples from searchrestaurant app.

The API end points are as below:

You can read more about Django rest framework code in previous blog post. Source code is available here.

From here on, I will explain Java Code to retrieve the restaurant list and show in the app. I used retrofit, gson and glide libraries for this project.

We make our API interface class as follows [source]

In the similar way we make our response object as follows [Source]

Next up is to use the API and fetch data from network. Refer to RestaurantListActivity.java We use Retrofit for all network calls. Once we receive data from the network we popular recycle view.

Source code for the app is on Github [link]

There are certain improvements that needs to be done.

  1. Use Realm for offline data storage
  2. Improve the UI

I have written a tutorial for developing an android app with Retrofit and Realm. You can see the guide here

You can read previous blog post about iOS here

--

--