我的 iOS 应用程序中有自定义缓存引擎。
AFURLCache* urlCache = [[[AFURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:@""] autorelease];
[NSURLCache setSharedURLCache:urlCache];
现在想到安卓版。
那里的方法是什么?有没有办法设置 HTTP 请求的内部自定义处理?
最佳答案
NSURLCache 的 Android 替代品是 HttpResponseCache。
http://developer.android.com/reference/android/net/http/HttpResponseCache.html
该类支持HttpURLConnection和HttpsURLConnection; DefaultHttpClient 或 AndroidHttpClient 没有平台提供的缓存。
关于android - Android 中的 NSURLCache 替代方案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12613390/