Skip to content
This repository has been archived by the owner on Feb 28, 2019. It is now read-only.

liufsd/android-async-http-loopj-with-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

0b0353c · Mar 31, 2015

History

4 Commits
Mar 31, 2015
Feb 11, 2015
Feb 11, 2015
Feb 11, 2015
Feb 11, 2015
Mar 31, 2015
Feb 11, 2015
Mar 31, 2015
Feb 11, 2015
Feb 11, 2015
Feb 11, 2015
Feb 11, 2015
Feb 11, 2015
Feb 11, 2015

Repository files navigation

android-async-http-loopj-with-cache

#Easy to use ###1.create client

       asyncHttpClient = new CacheAsyncHttpClient();
        asyncHttpClient.setTimeout(30000);
        asyncHttpClient.setConnectTimeout(50000);
        asyncHttpClient.setEnableRedirects(true);

###2.getResponseCache

  private RequestHandle getResponseCache(Context context, String url, boolean findCacheBreak, CacheBaseGsonHttpResponseHandler responseHandler) {
        return asyncHttpClient.getCache(context, url, null, null, findCacheBreak, responseHandler);
    }

###3.do some request

  getResponseCache(this, targetUrl, false, new CacheBaseGsonHttpResponseHandler<Entity>(Entity.class) {
            @Override
            public void onCacheSuccess(Entity response) {

            }

            @Override
            public void onGsonSuccess(Entity result) {

            }

            @Override
            public void onGsonFail(int statusCode) {

            }
        });

Releases

No releases published

Packages

No packages published

Languages