fikisipi / smartcache Goto Github PK
View Code? Open in Web Editor NEWA library for preloaded Retrofit responses.
License: Apache License 2.0
A library for preloaded Retrofit responses.
License: Apache License 2.0
method working fine when we are not using pro-guard ,after pro-guard enable in app show following error
java.lang.NullPointerException: Attempt to invoke virtual method 'okhttp3.Request$Builder okhttp3.Request.newBuilder()' on a null object reference
It seems you're using retrofit2 beta. Please upgrade to com.squareup.retrofit2:retrofit:2.2.0, otherwise it will not work with stable retrofit version.
Thanks
Is there any way to force a particular URL to be fetched from the web again and update the cache with the result, or to purge a URL from the cache?
My app includes pull down to refresh - when this is used I'd like to invalidate the cache, fetch data from the server, and update the cache with the new data.
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'com.squareup.okhttp.Request$Builder com.squareup.okhttp.Request.newBuilder()' on a null object reference
at dimitrovskif.smartcache.SmartCallFactory$SmartCallImpl.buildRequest(SmartCallFactory.java:200)
at dimitrovskif.smartcache.SmartCallFactory$SmartCallImpl.enqueue(SmartCallFactory.java:166)
I referred to this sample project of yours link
but how am I able to check if the value is loaded from the cache before the network response is rendered..
how to know if the response is the cache value or a network response???
没有中文的说明文档吗?
Not sure if this can be used together with RxJava2CallAdapterFactory, since then I can't use SmartCall in my interface. I have to use Observable, which means the SmartCacheFactory will not work.
I'm trying to make SmartCall
this is my Code
`Retrofit.Builder builder =
new Retrofit.Builder()
.baseUrl(G.Url + "/")
.addConverterFactory(GsonConverterFactory.create(new Gson()));
Retrofit retrofit =
builder.client(
ConnectionBuilder.getBuilder(activity).build()
).build();
ConnectionInterFace connectionInterFace = retrofit.create(ConnectionInterFace.class);
connectionInterFace.getListbody(Url, jsonObject.toString()).enqueue(this);
`
And i get this Error
IllegalArgumentException: Unable to create call adapter for dimitrovskif.smartcache.SmartCall<okhttp3.ResponseBody> for method ConnectionInterFace.getListbody
Can anybody tell me what is my code problem ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.