Learnoset Networking is a powerful library for any type networking in Android Application.
You can make a internet request in just few lines of code. This library is a modified version of Volley library
- Fast, Secure and Easy to use.
- Support both GET & POST methods
- Easy to implement
- In-Built Progress Bars
- Easy way tp handle Networking errors.
- Download Images from Url
1. Add below line in your module level build.gradle file
implementation 'com.github.learnoset:networking:5.21.1'
- Add below line in your project level build.gradle file
maven {url 'https://jitpack.io' }
- Add Internet permissions in the Manifest file
<uses-permission android:name="android.permission.INTERNET" />
- Initialize
LearnosetNetRequest.init("url_here", this);
- Make POST Request
// creating object
LearnosetNetRequest request = new LearnosetNetRequest(this, RequestMethod.POST);
// adding post parameters
request.addParam("param_1_key", "param_1_value");
request.addParam("param_2_key", "param_2_value");
request.addParam("param_3_key", "param_3_value");
request.addParam("param_4_key", "param_4_value");
request.addParam("param_5_key", "param_5_value");
// execute request
request.execute(true, 10, new NetResponseListener() {
@Override
public void onRequestSuccess(String response, Context context, int resultCode) {
// handle response here
}
@Override
public void onRequestFailed(String errorMessage, Context context, int resultCode) {
// handle errors here
}
});
- Make GET Request
// creating object
LearnosetNetRequest request = new LearnosetNetRequest(this, RequestMethod.GET);
// adding post parameters
request.addParam("param_1_key", "param_1_value");
request.addParam("param_2_key", "param_2_value");
// execute request
request.execute(true, 11, new NetResponseListener() {
@Override
public void onRequestSuccess(String response, Context context, int resultCode) {
// handle response here
}
@Override
public void onRequestFailed(String errorMessage, Context context, int resultCode) {
// handle errors here
}
});
2. resultCode = If you want to use single NetResponseListener for more than 1 requests then in onRequestSuccess method resultCode will help you to identifies of which request you have recieved response
3. NetResponseListener instance to get response and errors after request success
request.setCustomDialog(YourCustomDialogObject);
You can Visit our Website to learn more about Android App Development
Learnoset Website
We provide source code for Login & Register pages, Custom Dialogs, Custom Navigation Bar, Custom Toolbar, Custom Bottom Bar with material UI design and complete project files