FARLA

Additional

Language
Java
Version
0.4.1 (Sep 8, 2019)
Created
Sep 7, 2019
Updated
Sep 8, 2019
Owner
Filip Straka (F4pl0)
Contributor
Filip Straka (F4pl0)
1
Activity
Badge
Generate
Download
Source code

Advertising

FARLA - F4pl0's Awesome Request Library for Android

Features

  • Lightweight

So it can fit in every project you want, compressed to <50KB

  • 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.1'
  }

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();