diff --git a/README.md b/README.md new file mode 100644 index 0000000..2411003 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# API + +Lien de l'api nécessaire : https://gitea.lyc-lecastel.fr/francois.baille/apiDepannTout diff --git a/app/src/main/java/com/example/depanntout/Importation.kt b/app/src/main/java/com/example/depanntout/Importation.kt index dbf4f63..d714b24 100644 --- a/app/src/main/java/com/example/depanntout/Importation.kt +++ b/app/src/main/java/com/example/depanntout/Importation.kt @@ -13,7 +13,7 @@ import org.json.JSONArray class Importation { fun importInterventionsFromServer(context: Context, callback: (List) -> Unit) { - val url = "http://192.168.48.185:8000/interventions" + val url = "http://" + context.getString(R.string.ip_adress) + ":8000/interventions" val queue = Volley.newRequestQueue(context) val interventionsList = mutableListOf() @@ -48,7 +48,7 @@ class Importation { } fun importClientsFromServer(context: Context, callback: (List) -> Unit) { - val url = "http://192.168.48.185:8000/clients" + val url = "http://" + context.getString(R.string.ip_adress) + ":8000/clients" val queue = Volley.newRequestQueue(context) val clientsList = mutableListOf() diff --git a/app/src/main/java/com/example/depanntout/createClient.kt b/app/src/main/java/com/example/depanntout/createClient.kt index 2f7cc24..d42d83b 100644 --- a/app/src/main/java/com/example/depanntout/createClient.kt +++ b/app/src/main/java/com/example/depanntout/createClient.kt @@ -50,7 +50,7 @@ class createClient : AppCompatActivity() { finish() val queue = Volley.newRequestQueue(this) - val url = "http://192.168.48.185:8000/client" + val url = "http://" + getString(R.string.ip_adress) + ":8000/client" val jsonObjectRequest = object : JsonObjectRequest( Method.POST, url, null, { }, diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 6f32896..55f6b3a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,3 +1,4 @@ DepannTout + 192.168.48.185 \ No newline at end of file