diff options
author | xC3FFF0E <78732474+xC3FFF0E@users.noreply.github.com> | 2021-02-08 15:18:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-08 15:18:42 +0100 |
commit | 6f57869e5b45322b3397ab7714faf443473110f0 (patch) | |
tree | 9cbc1b388968c082602524c79040bba12006c077 /java/RequestNetwork.java | |
parent | Create a (diff) | |
download | xManager-6f57869e5b45322b3397ab7714faf443473110f0.tar xManager-6f57869e5b45322b3397ab7714faf443473110f0.tar.gz xManager-6f57869e5b45322b3397ab7714faf443473110f0.tar.bz2 xManager-6f57869e5b45322b3397ab7714faf443473110f0.tar.lz xManager-6f57869e5b45322b3397ab7714faf443473110f0.tar.xz xManager-6f57869e5b45322b3397ab7714faf443473110f0.tar.zst xManager-6f57869e5b45322b3397ab7714faf443473110f0.zip |
Diffstat (limited to 'java/RequestNetwork.java')
-rw-r--r-- | java/RequestNetwork.java | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/java/RequestNetwork.java b/java/RequestNetwork.java new file mode 100644 index 0000000..fb148c5 --- /dev/null +++ b/java/RequestNetwork.java @@ -0,0 +1,52 @@ +package com.xc3fff0e.xmanager;
+ +import android.app.Activity; + +import java.util.HashMap; + +public class RequestNetwork { +private HashMap<String, Object> params = new HashMap<>(); +private HashMap<String, Object> headers = new HashMap<>(); + +private Activity activity; + +private int requestType = 0; + +public RequestNetwork(Activity activity) { +this.activity = activity; +} + +public void setHeaders(HashMap<String, Object> headers) { +this.headers = headers; +} + +public void setParams(HashMap<String, Object> params, int requestType) { +this.params = params; +this.requestType = requestType; +} + +public HashMap<String, Object> getParams() { +return params; +} + +public HashMap<String, Object> getHeaders() { +return headers; +} + +public Activity getActivity() { +return activity; +} + +public int getRequestType() { +return requestType; +} + +public void startRequestNetwork(String method, String url, String tag, RequestListener requestListener) { +RequestNetworkController.getInstance().execute(this, method, url, tag, requestListener); +} + +public interface RequestListener { +public void onResponse(String tag, String response); +public void onErrorResponse(String tag, String message); +} +} |