From fe3b98abc17ddf623db599a9021b6027ec975b34 Mon Sep 17 00:00:00 2001 From: Amin Bahrami Date: Mon, 1 Apr 2019 13:11:56 +0430 Subject: [PATCH] Clear ABP from log --- .../abpwebservice/ABPWebService.java | 4 ++-- .../abpwebservicelib/ActivityMain.java | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ABPWebService/src/main/java/com/aminbahrami/abpwebservice/ABPWebService.java b/ABPWebService/src/main/java/com/aminbahrami/abpwebservice/ABPWebService.java index d089ee6..0afdd9c 100644 --- a/ABPWebService/src/main/java/com/aminbahrami/abpwebservice/ABPWebService.java +++ b/ABPWebService/src/main/java/com/aminbahrami/abpwebservice/ABPWebService.java @@ -62,7 +62,7 @@ public void sendRequest(String inputName,String data) public void sendRequest(final String inputName,final String data,final String fileInputName,final File file) { - Log.i("ABPWebService","Request: "+data); + Log.i("WebService","Request: "+data); Thread thread=new Thread(new Runnable() { @@ -170,7 +170,7 @@ public void run() strAll=new StringBuilder(strAll.toString().trim()); - Log.i("ABPWebService","Response: "+strAll); + Log.i("WebService","Response: "+strAll); if(iOnNetwork!=null) { diff --git a/app/src/main/java/com/aminbahrami/abpwebservicelib/ActivityMain.java b/app/src/main/java/com/aminbahrami/abpwebservicelib/ActivityMain.java index 9529152..741184d 100644 --- a/app/src/main/java/com/aminbahrami/abpwebservicelib/ActivityMain.java +++ b/app/src/main/java/com/aminbahrami/abpwebservicelib/ActivityMain.java @@ -5,8 +5,10 @@ import android.os.Environment; import android.util.Log; import android.view.View; +import android.widget.Toast; import com.aminbahrami.abpwebservice.ABPWebService; +import com.aminbahrami.abpwebservice.IOnNetwork; import org.json.JSONException; import org.json.JSONObject; @@ -53,6 +55,21 @@ private void sendRequest() e.printStackTrace(); } + abpWebService.setOnNetwork(new IOnNetwork() + { + @Override + public void onResponse(String response) + { + Log.i("LOG","Response: "+response); + } + + @Override + public void onError(int errorCode,String errorText) + { + + } + }); + abpWebService.sendRequest("data",object.toString(),"file",file); } }