diff --git a/app/src/main/java/com/example/myapp_1/DB/RetrofitClient.java b/app/src/main/java/com/example/myapp_1/DB/RetrofitClient.java new file mode 100644 index 0000000..d938502 --- /dev/null +++ b/app/src/main/java/com/example/myapp_1/DB/RetrofitClient.java @@ -0,0 +1,31 @@ +package com.example.myapp_1.DB; + +import retrofit2.Retrofit; +import retrofit2.converter.gson.GsonConverterFactory; + +public class RetrofitClient { + + private static Retrofit retrofit; + +//Define the base URL// + + private static final String BASE_URL = "https://localhost:8080"; + +//Create the Retrofit instance// + + public static Retrofit getRetrofitInstance() { + if (retrofit == null) { + retrofit = new retrofit2.Retrofit.Builder() + .baseUrl(BASE_URL) + +//Add the converter// + + .addConverterFactory(GsonConverterFactory.create()) + +//Build the Retrofit instance// + + .build(); + } + return retrofit; + } +} \ No newline at end of file