Skip to content

F4pl0/FARLA

Folders and files

NameName
Last commit message
Last commit date
Sep 7, 2019
Sep 7, 2019
Sep 7, 2019
Sep 7, 2019
Sep 7, 2019
Sep 7, 2019
Sep 7, 2019
Sep 7, 2019
Sep 7, 2019
Sep 7, 2019
Sep 7, 2019
Sep 7, 2019

Repository files navigation

FARLA - F4pl0's Awesome Request Library for Android

Features

  • Lightweight

So it can fit in every project you want

  • Native

Supports Java and Kotlin

  • Performance

Only bottleneck is your connection and server location

  • Simple

Implements in seconds, period

Installation

Add Jitpack.io repository to your build.gradle file:

allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

Add FARLA to your dependencies

dependencies {
        implementation 'com.github.F4pl0:FARLA:0.4.0'
  }

Usage

GET Request

new FarlaGetRequest(this)
                .setURL("https://example.com/get")
                .setListener(new FarlaGetRequest.onGetRequestListener() {
                    @Override
                    public void onSuccess(String response) {
                        //Handle the response
                    }

                    @Override
                    public void onFailure(int error) {
                        //Handle the failure
                    }
                }).execute();

POST Request

new FarlaPostRequest(this)
                .setURL("https://example.com/post")
                .setListener(new FarlaPostRequest.onPostRequestListener() {
                    @Override
                    public void onSuccess(String response) {
                        //Handle the response
                    }

                    @Override
                    public void onFailure(int error) {
                        //Handle the failure
                    }
                })
                .addParam("key", "value")
                .execute();

PUT Request

new FarlaPutRequest(this)
                .setURL("https://example.com/put")
                .setListener(new FarlaPutRequest.onPutRequestListener() {
                    @Override
                    public void onSuccess(String response) {
                        //Handle the response
                    }

                    @Override
                    public void onFailure(int error) {
                        //Handle the failure
                    }
                })
                .addParam("key", "value")
                .execute();

DELETE Request

new FarlaDeleteRequest(this)
                .setURL("https://example.com/delete")
                .setListener(new FarlaDeleteRequest.onDeleteRequestListener() {
                    @Override
                    public void onSuccess(String response) {
                        //Handle the response
                    }

                    @Override
                    public void onFailure(int error) {
                        //Handle the failure
                    }
                }).execute();