Login with MVVM in Android.
grade- implementation "android.arch.lifecycle:extensions:1.1.1" implementation "android.arch.lifecycle:viewmodel:1.1.1" implementation 'com.squareup.retrofit2:retrofit:2.3.0' implementation 'com.squareup.retrofit2:converter-scalars:2.3.0' implementation 'com.squareup.retrofit2:converter-gson:2.2.0' import com.google.gson.Gson; import java.util.concurrent.TimeUnit; import okhttp3.OkHttpClient; import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; import retrofit2.converter.scalars.ScalarsConverterFactory; public class Api { public static final String BASE_URL = ""; private static Retrofit retrofit = null; Gson gson = new Gson(); public static Retrofit getClient() { if (retrofit==null) { OkHttpClient.Builder client = new OkHttpClient.Builder(); ...