Hanumanjetlibrary.
Prerequisites
Add this in your root build.gradle file (not your module build.gradle file):
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
Dependency
Add this to your module's build.gradle file (make sure the version matches the JitPack badge above):
dependencies {
...
implementation 'com.github.Pawan245:Hanumanjetlibrary:6.1.0'
}
ApicallAny (Volley)
Place this ApicallAny anywhere in your App Make Http Network Call
#MainActivity.java
#withoutParams
String url="http://rt.com/api/my.php";
ApicallAny.ApicallVolleywithoutParams(MainActivity.this,url, new ApicallAny.VolleyCallback() {
@Override
public void onSuccess(String result) {
// do stuff here
}
@Override
public void onError(String result) {
// do stuff here
}
});
#withParams
Map params = new HashMap<>();
params.put("param1","val");
params.put("param2","valx");
String url="http://rt.com/api/my.php";
ApicallAny.ApicallVolleywithParams(MainActivity.this, url,params, new ApicallAny.VolleyCallback() {
@Override
public void onSuccess(String result) {
// do stuff here
}
@Override
public void onError(String result) {
// do stuff here
}
});