6
Trên Android, tôi nên tạo tham số File
cho hàm tạo com.squareup.okhttp.Cache
như thế nào? Nó có vẻ như Context
mang đến cho bạn nhiều lựa chọn:Tạo thư mục cho bộ nhớ cache OkHttp trên Android?
new File(context.getCacheDir(), "HttpResponseCache")
new File(context.getExternalCacheDir(), "HttpResponseCache")
context.getDir("HttpResponseCache", Context.MODE_PRIVATE)
Chỉ cần tự hỏi thực hành tốt nhất là gì. Cảm ơn!