android - Issues and contribution for Volley -


since there awesome presentation on volley tried include in project working on. found myself correcting bugs found in source code published.

does know if there gonna github project 1 contribute project or there way communicate bugs , feature requests developer?

regarding problems had volley:

1. seems redirection not work should: volley returns error code 302 instead of redirecting location given in response header.

2. getting cache directory not work on emulator running 4.2.2:

cachedir = new file(context.getcachedir(), default_cache_dir);   final string cachedir1 = "/android/data/cache/"; cachedir = new file(environment.getexternalstoragedirectory().getpath() + cachedir1); 

this workaround platform specific, though. wanted add completions sake.

besides think volley awesome piece of code , looking until did myself ;)

update 1

here link contribution page aosp. thought more standalone library. check out, although still appreciate more infos , tutorials on volley. source code suggested quick , dirty fix, did trick in demo project.

update 2

i found interesting blog post ognyan bankov mentioned response question, helpful.

seems lot has been answered in comments i'll try cover rest, or rather, i'll try cover specific questions.

1) volley not handle redirection on it's own. it's handled underlying httpstack. example, use okhttp (from square) http client volley. see https://plus.google.com/108284392618554783657/posts/ejjxhktq4yu https://gist.github.com/jakewharton/5616899 okhttp great, has excellent defaults handling spdy, redirects, , other http conveniences. use implement own defaults platform httpurlconnection (calling followredirects() on connection before handing volley example --- https://developer.android.com/reference/java/net/httpurlconnection.html#setfollowredirects(boolean))

2) i'm not sure i'd use getcachedir() volley cache. according docs (https://developer.android.com/reference/android/content/context.html#getcachedir()), cache directory should never exceed 1 mb. whereas, clients tend use 10 mb default http cache (1 mb small http cache!!). also, why using such deep cache directory? theres no reason "cachedir1" should multiple directories deep. make file name. getcachedir() return own folder anyways. i'd recommend doing when initializing volley (usually recommended place application class):

file volleycachefile = new file(getexternalcachedir(), "volleycache.tmp"); 

of course, lacks error handling (what if external storage unavailable?). also, don't forget need appropriate permission write external storage.

hope helps.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -