All Projects → shiburagi → Atomic

shiburagi / Atomic

Licence: Apache-2.0 license
An android restful api/networking library using okhttp library as backbone.

Programming Languages

kotlin
9241 projects
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Atomic

Prdownloader
PRDownloader - A file downloader library for Android with pause and resume support
Stars: ✭ 2,947 (+22569.23%)
Mutual labels:  downloader, https
angular-material-datatransfer
A HTML5 datatransfer UI for handling upload and download of multiple simultaneous files.
Stars: ✭ 13 (+0%)
Mutual labels:  downloader, uploader
sync-deploy
🔄 shell toolkit for deploying script/command task on remote host, including up/download files, run script on remote
Stars: ✭ 20 (+53.85%)
Mutual labels:  downloader, uploader
S3uploader
A minimalistic UI to conveniently upload and download files from AWS S3
Stars: ✭ 111 (+753.85%)
Mutual labels:  downloader, uploader
Goph
🤘 The native golang ssh client to execute your commands over ssh connection. 🚀🚀
Stars: ✭ 734 (+5546.15%)
Mutual labels:  downloader, uploader
Aria
下载可以很简单
Stars: ✭ 4,777 (+36646.15%)
Mutual labels:  downloader, uploader
Zoom2Youtube
Transfer video recordings from the Zoom to YouTube
Stars: ✭ 63 (+384.62%)
Mutual labels:  downloader, uploader
Fast Android Networking
🚀 A Complete Fast Android Networking Library that also supports HTTP/2 🚀
Stars: ✭ 5,346 (+41023.08%)
Mutual labels:  downloader, https
Zdownloader
zdownloader is a download manager for ZippyShare, Google Drive and MegaUp services
Stars: ✭ 88 (+576.92%)
Mutual labels:  downloader, https
mega-link-downloader-bot
A telegram bot to download mega.nz links. (made with pyrogram).
Stars: ✭ 180 (+1284.62%)
Mutual labels:  downloader, uploader
ez-s
⚠️ [discontinued] Run a green-badge local HTTPS server with zero configuration; no certificate creation, no tunnels and no hassle.
Stars: ✭ 10 (-23.08%)
Mutual labels:  https
webhook-tunnel
A little HTTP proxy suitable to create tunnels for webhook endpoints protected behind a firewall or a VPN
Stars: ✭ 63 (+384.62%)
Mutual labels:  https
Torrent-To-Google-Drive-Downloader
Simple notebook to stream torrent files to Google Drive using Google Colab and python3.
Stars: ✭ 256 (+1869.23%)
Mutual labels:  downloader
hanime
📥 Command-line tool to download videos from hanime.tv
Stars: ✭ 32 (+146.15%)
Mutual labels:  downloader
yamete
Yamete - Hentai downloader in PHP CLI - Easy site downloader PHP system
Stars: ✭ 63 (+384.62%)
Mutual labels:  downloader
Sonarr-AnimeDownloader
It is a Docker Container that uses Sonarr to download anime from AnimeWorld site (ITALY).
Stars: ✭ 28 (+115.38%)
Mutual labels:  downloader
react-use-downloader
Creates a download handler function and gives progress information
Stars: ✭ 65 (+400%)
Mutual labels:  downloader
Movgrab
Simple downloader for videos from various websites
Stars: ✭ 20 (+53.85%)
Mutual labels:  downloader
fansly
Simply scrape / download all the media from an fansly account
Stars: ✭ 351 (+2600%)
Mutual labels:  downloader
artifact-resolver
Standalone jar executable client Maven 2 artifact resolver based on Eclipse Aether.
Stars: ✭ 13 (+0%)
Mutual labels:  downloader

Atomic

Download Android Arsenal

An android restful api/networking library using okhttp library as backbone.

Android 9.0+ support


Buy Me a Coffee at ko-fi.com paypal

Including In Your Project

If you are a Maven user you can easily include the library by specifying it as a dependency:

Maven

<dependency>
  <groupId>com.infideap.atomic</groupId>
  <artifactId>atomic</artifactId>
  <version>0.0.8</version>
  <type>pom</type>
</dependency>

Gradle

dependencies {
   implementation 'com.infideap.atomic:atomic:0.0.8'
}

if the gradle unable to sync, you may include this line in project level gradle,

repositories {
 maven{
   url "https://dl.bintray.com/infideap2/Atomic/"
 }
}

or, you can include it by download this project and import /atomic as module.

How to use

POST

Atom.with(LoginActivity.this)
    .load("https://reqres.in/api/login")
    .setJsonPojoBody(loginRequest)
    //.setBody(requestString) //Plain String
    .as(LoginResponse.class)
    .setCallback(new FutureCallback<LoginResponse>() {
        @Override
        public void onCompleted(Exception e, LoginResponse result) {
            if (e != null) {
                e.printStackTrace();
            } else if (result.token != null) {
                Snackbar.make(v, "Pass : " + result.token, Snackbar.LENGTH_LONG).show();
            } else if (result.error != null) {
                Snackbar.make(v, "Fail : " + result.error, Snackbar.LENGTH_LONG).show();
            }
        }
    });

GET

Atom.with(LoginActivity.this)
    .load("https://reqres.in/api/users/2")
    .as(UserResponse.class)
    .setCallback(new FutureCallback<LoginResponse>() {
        @Override
        public void onCompleted(Exception e, UserResponse result) {
            if (e != null) {
                e.printStackTrace();
            } else if (result.first_name != null) {
                Snackbar.make(v, "Pass : " + result.first_name, Snackbar.LENGTH_LONG).show();
            } 
        }
    });

Other, just add method after url on load()

Atom.with(LoginActivity.this)
    .load("https://reqres.in/api/users/2", Atom.DELETE_METHOD)
    .asString()
    .setCallback(new FutureCallback<String>() {
        @Override
        public void onCompleted(Exception e, String result) {
            if (e != null) {
                e.printStackTrace();
            } else if (result != null) {
                Snackbar.make(v, "Pass : " + result, Snackbar.LENGTH_LONG).show();
            } 
        }
    });

Upload File

Atom.with(LoginActivity.this)
    .load("https://reqres.in/api/user/2")
    .setJsonPojoBody(userRequest)
    .setMultipartFile("uploadFile", new File("video.mp4"))
    //Optional: Upload Progress
    .uploadProgress(new ProgressCallback() {
        @Override
        public void onProgress(long uploaded, long total) {
            
        }
    })
    .as(UserResponse.class)
    .setCallback(new FutureCallback<UserResponse>() {
        @Override
        public void onCompleted(Exception e, UserResponse result) {
            if (e != null) {
                e.printStackTrace();
            } 
        }
    });

Download File

Atom.with(LoginActivity.this)
    .load("https://developer.android.com/_static/66ebbcad58/images/android/touchicon-180.png")
    //Optional: Progress
    .progress(new ProgressCallback() {
        @Override
        public void onProgress(long downloaded, long total) {
            
        }
    })
    .write(new File("android.png"))
    .setCallback(new FutureCallback<File>() {
        @Override
        public void onCompleted(Exception e, File result) {
            
        }
    });

Advance

Plain String

Atom.with(LoginActivity.this)
    .load("https://reqres.in/api/users/2")
    .asString()
    .setCallback(new FutureCallback<String>() {
        @Override
        public void onCompleted(Exception e, String result) {
            if (e != null) {
                e.printStackTrace();
            } else if (result!= null) {
                Snackbar.make(v, "Pass : " + result, Snackbar.LENGTH_LONG).show();
            } 
        }
    });

Form Data

Atom.with(LoginActivity.this)
    .load("https://reqres.in/api/login")
    .setMultipart("Key1","Value1")
    .setMultipart("Key2","Value2")
    .as(LoginResponse.class)
    .setCallback(new FutureCallback<LoginResponse>() {
        @Override
        public void onCompleted(Exception e, LoginResponse result) {
            if (e != null) {
                e.printStackTrace();
            } else if (result.token != null) {
                Snackbar.make(v, "Pass : " + result.token, Snackbar.LENGTH_LONG).show();
            } else if (result.error != null) {
                Snackbar.make(v, "Fail : " + result.error, Snackbar.LENGTH_LONG).show();
            }
        }
    });

Direct call without callback (must call in Thread/Service/AsyncTask)

String body = Atom.with(LoginActivity.this)
    .load("https://reqres.in/api/users/2")
    .asString()
    .get();

Access OKHttp Response (must call in Thread/Service/AsyncTask)

Response body = Atom.with(LoginActivity.this)
    .load("https://reqres.in/api/users/2")
    .execute();

Access OKHttp Response

Atom.with(LoginActivity.this)
    .load("https://reqres.in/api/login")
    .setJsonPojoBody(loginRequest)
    .as(LoginResponse.class)
    .setCallback(new ResponseFutureCallback<LoginResponse>() {
        @Override
        public void onCompleted(Exception e, LoginResponse result, Response response) {
            if (e != null) {
                e.printStackTrace();
            } else if (result.token != null) {
                Snackbar.make(v, "Pass : " + result.token, Snackbar.LENGTH_LONG).show();
            } else if (result.error != null) {
                Snackbar.make(v, "Fail : " + result.error, Snackbar.LENGTH_LONG).show();
            }
        }
    });

Customize

OkHttpClient client =new OkHttpClient.Builder().addInterceptor(new Interceptor() {
    @Override
    public Response intercept(Chain chain) throws IOException {
        return null;
    }
}).build();
Atom.setClient(client);

Contact

For any enquiries, please send an email to [email protected].

License

Copyright 2017-2018 Shiburagi

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].