Skip to content

Latest commit

 

History

History
141 lines (104 loc) · 3.25 KB

README.md

File metadata and controls

141 lines (104 loc) · 3.25 KB

Easiest way of Networking in Android Studio

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

Why use Learnoset Networking 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


How to use Learnoset Networking Library

1. Add below line in your module level build.gradle file
implementation 'com.github.learnoset:networking:5.21.1'

  1. Add below line in your project level build.gradle file
maven {url 'https://jitpack.io' }

  1. Add Internet permissions in the Manifest file
<uses-permission android:name="android.permission.INTERNET" />

  1. Initialize
LearnosetNetRequest.init("url_here", this);

  1. 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
    }
});

  1. 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
    }
});
execute() method parameters
1. showDialog = true if you want to show process dialog, false otherwise
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

Use your Custom Dialog as Progress Dialog

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