Guest User

Untitled

a guest
Jul 11th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. }
  2. });
  3.  
  4. }
  5.  
  6. private void sendRequestAndPrintResponse() {
  7. RequestQueue nRequestQueue = Volley.newRequestQueue(this);
  8. String url = "http://serverapi.respect-shoes.kz/ServerAPI/hs/Konversia";
  9. StringRequest stringRequest = new StringRequest(Request.Method.GET, url, new Response.Listener<String>() {
  10. @Override
  11. public void onResponse(String response) {
  12. Log.i(TAG, response);
  13.  
  14. }
  15. }, new Response.ErrorListener() {
  16. @Override
  17. public void onErrorResponse(VolleyError error) {
  18. Log.i(TAG, "Error : " + error.toString());
  19. }
  20. });
  21. nRequestQueue.add(stringRequest);
  22. Authenticator.setDefault(new Authenticator() {
  23. protected PasswordAuthentication getPasswordAuthentication() {
  24. String username ="";
  25. String password ="";
  26. return new PasswordAuthentication(username, password.toCharArray());
  27. }
  28. });
  29.  
  30. }
Add Comment
Please, Sign In to add comment