Teachmeandroidhub
Teachmeandroidhub Retrofit android-Post Data Using Retrofit in Android: Let's start work with Retrofit in android retrofit is most latest library that work with Rest Api. it is fast and easiest way to posting and getting data from server . Basically retrofit works on okhttp and we use retrofit android for sending data to json on internet so in this topic I'll explain how to post data using Retrofit Step by step that how to work Retrofit in android . Step -1. Create a new Project name it as you want Step -2. Add Dependencies in app level gradle like below compile 'com.squareup.retrofit2:retrofit:2.1.0' compile 'com.google.code.gson:gson:2.6.2' compile 'com.squareup.retrofit2:converter-gson:2.1.0' Step -3 Design your UI with XML Like activity_main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
Comments