ismkhanh / prism-lib

Android Library used for network handling

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prism Library - For all your network related operation

Usage

In order to use this library in your project follow the following steps:

Import the prism-lib module in your project and then add the following in your build.gradle file

...
dependencies {
    compile project(':prism-lib')
}
...

Features

Currently this library supports APIs that return Bitmap and String only, but will be extended to other formats in the future.

Fetching Bitmap

There are two ways to fetch bitmap using Prism

Prism.getInstance()
     .loadBitmapFrom(url, requestTag)
     .into(imagView)
     .execute();

OR

Prism.getInstance()
     .loadBitmapFrom(url, requestTag, new BitmapResponseListener() {
            @Override
            public void onResponse(Bitmap bitmap) {
            }

            @Override
            public void onError(String errorMsg) {
            }
        }).execute();

Fetching String

Prism.getInstance()
     .loadStringFrom(url, requestTag, new StringResponseListener() {
            @Override
            public void onResponse(String response) {
            }

            @Override
            public void onError(String errorMsg) {
            }
        }).execute();

Example

You can look at the source code of CacheLoading project which uses Prism Lib for its network operations https://github.com/ik024/prism-lib/tree/master/app

cache_loading

About

Android Library used for network handling


Languages

Language:Java 100.0%