Post Title

Tagged : Kotlin

by Start Bootstrap

Posted on 1550707200000

Api call using Volley is very much easier. Yes, code is drastically reduced here

Just add the dependency

implementation 'com.android.volley:volley:1.1.1' // migrating to implementation is important

And here we do the GET Method

val queue = Volley.newRequestQueue(this);
val stringRequest = StringRequest(Request.Method.GET, "http://sulthanallaudeen.com/api/v1/ping",
Response.Listener<String> { response ->
Toast.makeText(this@LoginActivity, response, Toast.LENGTH_SHORT).show();
},
Response.ErrorListener {
Toast.makeText(this@LoginActivity, "Error in API Request", Toast.LENGTH_SHORT).show();
})
queue.add(stringRequest);

And this makes entire process easy !! 


Blog Search
Tags
  • Sysaxiom
  • Github
  • Windows
  • php
  • General Tips
  • GoogleMaps
  • Google App Script
  • Heroku
  • Laravel Middleware
  • xampp
  • Terminal
  • TechCrunch
  • Ubuntu
  • MySQL
Side Widget
can put anything you want inside of these side widgets. They are easy to use, and feature the new Bootstrap 4 card containers!