public static RequestQueue NewRequestQueue(Context context, IHttpStack stack, int maxDiskCacheBytes) { //��֯�����Ŀ¼ var cacheDir = Directory.CreateDirectory(context.CacheDir.Path + "/" + DEFAULT_CACHE_DIR); String userAgent = "volley/0"; try { String packageName = context.PackageName; var info = context.PackageManager.GetPackageInfo(packageName, 0); userAgent = packageName + "/" + info.VersionCode; } catch (Android.Content.PM.PackageManager.NameNotFoundException) { } if (stack == null) { stack = new HttpClientStack(); } INetwork network = new BasicNetwork(stack); RequestQueue queue; if (maxDiskCacheBytes <= -1) { queue = new RequestQueue(new DiskBasedCache(cacheDir), network); } else { queue = new RequestQueue(new DiskBasedCache(cacheDir, maxDiskCacheBytes), network); } return queue; }
public static RequestQueue NewRequestQueue(Context context, IHttpStack stack, int maxDiskCacheBytes) { //组织缓存根目录 var cacheDir = Directory.CreateDirectory(context.CacheDir.Path + "/" + DEFAULT_CACHE_DIR); String userAgent = "volley/0"; try { String packageName = context.PackageName; var info = context.PackageManager.GetPackageInfo(packageName, 0); userAgent = packageName + "/" + info.VersionCode; } catch (Android.Content.PM.PackageManager.NameNotFoundException) { } if (stack == null) { stack = new HttpClientStack(); } INetwork network = new BasicNetwork(stack); RequestQueue queue; if (maxDiskCacheBytes <= -1) { queue = new RequestQueue(new DiskBasedCache(cacheDir), network); } else { queue = new RequestQueue(new DiskBasedCache(cacheDir, maxDiskCacheBytes), network); } return(queue); }
public BasicNetwork(IHttpStack httpStack) { this.mHttpStack = httpStack; }
public static RequestQueue NewRequestQueue(Context context, IHttpStack stack) { return NewRequestQueue(context, stack, -1); }
public static RequestQueue NewRequestQueue(Context context, IHttpStack stack) { return(NewRequestQueue(context, stack, -1)); }