mcxiaoke / android-volley Goto Github PK
View Code? Open in Web Editor NEWDEPRECATED
DEPRECATED
Unfortunately there seems to be no way to add tags via pull request, but it would be nice if there were tags on the newer releases of the project. I went through and found the commits in question if you want to just run this and push the tags up to the repo.
git tag -a "1.0.6" -m "versionCode:7" 8982c00; git tag -a "1.0.5" -m "versionCode:6"; git tag -a "1.0.4" -m "versionCode:5" cafdeb8; git tag -a "1.0.3" -m "versionCode:4" dfe0f37;
We can't send parameters with the DELETE method.
See : http://stackoverflow.com/questions/19050706/android-volley-delete-method-why-will-send-empty-parameters
The client the exception thrown as follows:
java.lang.OutOfMemoryError
at com.android.volley.toolbox.DiskBasedCache.streamToBytes(DiskBasedCache.java:322)
at com.android.volley.toolbox.DiskBasedCache.readString(DiskBasedCache.java:540)
at com.android.volley.toolbox.DiskBasedCache.readStringStringMap(DiskBasedCache.java:562)
at com.android.volley.toolbox.DiskBasedCache$CacheHeader.readHeader(DiskBasedCache.java:403)
at com.android.volley.toolbox.DiskBasedCache.initialize(DiskBasedCache.java:156)
at com.android.volley.CacheDispatcher.run(CacheDispatcher.java:84)
Request some JSON format of data only.
Please help to analyze what's the problem?
They announced Eddystone the other day, and in the sample app, in the gradle configuration file: https://github.com/google/beacon-platform/blob/master/samples/android/BeaconServiceDemoApp/app/build.gradle
Keep up the good work!
How do i get Inputstream as reponse
The JSON spec (RFC 46227) says:
"JSON text SHALL be encoded in Unicode. The default encoding is UTF-8.".
If the server doesn't specify a charset in the response headers, Volley defaults to ISO_8859_1 (HttpHeaderParser.parseCharset()). Perhaps, in the case of JSON at least, it should default to UTF8 instead?
Here is mine: https://github.com/panxuewen/android-volley-manager
Library used:
compile 'com.mcxiaoke.volley:library:1.0.15'
Version used:
-----log------
D/Finsky (19660): [1] PackageVerificationReceiver.onReceive: Verification requested, id = 303
D/Finsky (19660): [1] PackageVerificationService.cancelVerificationIntent: Cancel active verification id=303
D/Finsky (19660): [1] 3.onErrorResponse: Verification id=303 error response com.android.volley.TimeoutError
D/Volley (19660): [1] Request.finish: 10091 ms: [ ] https://safebrowsing.google.com/safebrowsing/clientreport/download 0xc9395b26 NORMAL 42
I'm getting this error sometimes which causes my application to crash:
java.lang.NegativeArraySizeException: -450
at com.android.volley.toolbox.DiskBasedCache.streamToBytes(DiskBasedCache.java:322)
at com.android.volley.toolbox.DiskBasedCache.get(DiskBasedCache.java:118)
at com.android.volley.CacheDispatcher.run(CacheDispatcher.java:100)
Hello, Is there a simple easy and reliable implement to send Image or a File to my server via POST ?
All the resources online, say,that volley does not include MultiPartJSONRequest:
But all the sample I tried from stackoverflow, does not work.
I just want to take a photo from the camera and post it to my server.
As an old version of volley.jar. Other college made it and we pass params by following method:
@OverRide
public byte[] getBody() {
if (params != null && params.size() > 0) {
return encodeParameters(params, getParamsEncoding());
}
return null;
}
But we need to update volley, and find that this method was changed to private.
I also found that to override the method of getParams(), which did not work for me. the Method getBody of JsonObjectRequest is as following:
public byte[] getBody() {
try {
return mRequestBody == null ? null : mRequestBody.getBytes(PROTOCOL_CHARSET);
} catch (UnsupportedEncodingException uee) {
VolleyLog.wtf("Unsupported Encoding while trying to get the bytes of %s using %s",
mRequestBody, PROTOCOL_CHARSET);
return null;
}
}
so I cannot pass the params now.
The current implementation has a major problem. Caching is turned on by default for POST/PUT... requests.
We have this use case
You can GET from /layout
You can also send data to layout using POST.
The GET response is beeing cached for 15 minutes, so any POST data is not beeing sent at all and the cached GET response is beeing served. In our opiniion this is a major design flaw, if not a bug.
mShouldCache should default to false for all requests except GET request. Or even in general
Hello,
I know you are setting this repo as mirror with the official volley project from Google, but how do you decide it's OK (or stable enough) to pump to versioning to 1.0.0 after each sync?
And how do you know it's now time to update the artifact to maven central too? We would like to use volley library in our project too using maven, but we would like to know if this is a "safe" artifact to trust.
Thanks,
Sam.
According to Android Studio/IntelliJ using +
in:
compile 'com.mcxiaoke.volley:library:1.0.+'
// or
compile 'com.mcxiaoke.volley:library:1.0.+@aar'
leads to unpredictable builds. So I propose changing it to:
compile 'com.mcxiaoke.volley:library:1.0.16'
The @aar
is really not needed.
this is out of date
When I need to make a POST request, I set retry policy = 0, but when the HTTP request hits the timeout, Volley sends another request (and if the timeout is hit again, it will send another one).
Looks like someone else is seeing the same issue here: http://stackoverflow.com/questions/29034735/volley-makes-duplicate-post-call-at-timeout-mark
I'm experiencing it with 1.0.8, 1.0.10, 1.0.15. I didn't try other releases.
This is a major issue because POSTs are by definition not idempotent and I can't find a workaround using Volley with POSTs.
at com.android.volley.toolbox.Volley.newRequestQueue(Volley.java:43)
at com.android.volley.toolbox.Volley.newRequestQueue(Volley.java:78)
Exists a way to add 'device-id' header to every request made with Volley?
ps - sorry for my bad english
Server is slow. Volley is sending request two times i.e Its retrying to send request again.
I had solved the problem by overriding retry policy.
jsonObjReq.setShouldCache(false);
jsonObjReq.setRetryPolicy(new DefaultRetryPolicy(
(int) TimeUnit.SECONDS.toMillis(20),
DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
Please resolve this issue.
In the case of redirects when requesting images, when you want to fetch the same image again, however the size of your NetworkImageView is different than in the first request, the image is not found. The server request is not fired either, because mWaitingRequests
contains the original URL and hence the new request is ignored by Volley (the request queued forever).
Suggested fix is in RequestQueue.finish(Request<T> request)
make the following change:
//String cacheKey = request.getCacheKey();
String originalKey = request.getOriginUrl();
String cacheKey = request.getCacheKey();
Queue<Request<?>> waitingRequests;
if (!originalKey.equals(cacheKey)) {
waitingRequests = mWaitingRequests.remove(originalKey);
}
In order to test, you can create an app with a NetworkImageView
that requests an image in (lets say) 50dpx50dp (NetworkImageViews
size) and then on click of a button, an other NetworkImageView
requests the same image in 100dpx100dp.
You can use the URL below to test which redirects to the actual image.
http://graph.facebook.com/592371158/picture
when server return HTTP status code 404 then application crashes.
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.e(TAG, "Registration Error: " + error.getMessage());
Toast.makeText(getApplicationContext(),
error.getMessage(), Toast.LENGTH_LONG).show();
hideDialog();
}
})
in this method and return null Toast
I just got this crash stack trace from our app in production:
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.android.volley.Response.isSuccess()' on a null object reference
at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:98)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
Perhaps we should protect mResponse and mRequest with a null check first?
I'm using volley to load images in my cursor adapter. The images successfully load, however, when I scroll away, and scroll back up the image disappears1
Here is the relevant code:
In the array initializer:
mImageLoader = MyApplication.getInstance().getImageLoader();
And in my bindView method:
storyImage.setImageUrl(imageURL, mImageLoader);
The mImageLoader initialization references to MyApplication.class, which can be found here2
there is/will be http/2 support?
The ImageLoader tells the ImageRequest to use Bitmap.Config.RGB_565 to decode images (see ImageLoader.java:226). This causes a loss of the alpha channel.
It can be easily fixed by using Bitmap.Config. ARGB_8888.
I'm trying to get a big JSON from a backend using Volley. I'm using a JsonObjectRequest and a singleton Volley request queue to do it. This my source:
JsonObjectRequest request = new JsonObjectRequest(Request.Method.GET,
URL, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
apiResponse.response(response, null);
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
apiResponse.response(null, error);
}
});
mRequestQueue.add(request);
But always I get this Exception:
java.lang.OutOfMemoryError
at java.util.HashMap.makeTable(HashMap.java:569)
at java.util.HashMap.doubleCapacity(HashMap.java:589)
at java.util.HashMap.put(HashMap.java:419)
at org.json.JSONObject.put(JSONObject.java:263)
at org.json.JSONTokener.readObject(JSONTokener.java:385)
at org.json.JSONTokener.nextValue(JSONTokener.java:100)
at org.json.JSONTokener.readArray(JSONTokener.java:430)
at org.json.JSONTokener.nextValue(JSONTokener.java:103)
at org.json.JSONTokener.readObject(JSONTokener.java:385)
at org.json.JSONTokener.nextValue(JSONTokener.java:100)
at org.json.JSONObject.<init>(JSONObject.java:155)
at org.json.JSONObject.<init>(JSONObject.java:172)
at com.android.volley.toolbox.JsonObjectRequest.parseNetworkResponse(JsonObjectRequest.java:103)
at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:123)
Do you have any idea why it's crashing? Could it be related to the big size of my JSON response?
Add please overridable setImageBitmap method with isImmediate to be able detect it in subclass...
I've made a feature request on the main google groups but I would like to post it here too to see if it's a possibility. Link to the post: https://groups.google.com/d/topic/volley-users/S3pCu7kKMTo/discussion.
Basically, I would like to be able to get an id back as a parameter on the success/failure callback functions.
Hello
I need jar file of this project for us on my app on , at this moment I use eclipse and cant move project to android studio. any link for download jar file?
thanks
I used this library as module like this.
dependencies {
compile project(':modules:volley')
}
But when I execute $ ./gradlew connectedCheck
an error occurred.
WARNING: Dependency commons-logging:commons-logging:1.1.1 is ignored for debugUnitTest as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.3 is ignored for debugUnitTest as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency commons-logging:commons-logging:1.1.1 is ignored for releaseUnitTest as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.3 is ignored for releaseUnitTest as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:modules:volley:compileLint
:modules:volley:copyReleaseLint UP-TO-DATE
:modules:volley:mergeReleaseProguardFiles UP-TO-DATE
:modules:volley:preBuild UP-TO-DATE
:modules:volley:preReleaseBuild UP-TO-DATE
:modules:volley:checkReleaseManifest
:modules:volley:prepareReleaseDependencies
:modules:volley:compileReleaseAidl UP-TO-DATE
:modules:volley:compileReleaseRenderscript UP-TO-DATE
:modules:volley:generateReleaseBuildConfig UP-TO-DATE
:modules:volley:generateReleaseAssets UP-TO-DATE
:modules:volley:mergeReleaseAssets UP-TO-DATE
:modules:volley:generateReleaseResValues UP-TO-DATE
:modules:volley:generateReleaseResources UP-TO-DATE
:modules:volley:packageReleaseResources UP-TO-DATE
:modules:volley:processReleaseManifest UP-TO-DATE
:modules:volley:processReleaseResources UP-TO-DATE
:modules:volley:generateReleaseSources UP-TO-DATE
:modules:volley:compileReleaseJava UP-TO-DATE
:modules:volley:processReleaseJavaRes UP-TO-DATE
:modules:volley:packageReleaseJar UP-TO-DATE
:modules:volley:compileReleaseNdk UP-TO-DATE
:modules:volley:packageReleaseJniLibs UP-TO-DATE
:modules:volley:packageReleaseLocalJar UP-TO-DATE
:modules:volley:packageReleaseRenderscript UP-TO-DATE
:modules:volley:bundleRelease UP-TO-DATE
:app:prepareComAfollestadMaterialDialogs0755Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72220Library UP-TO-DATE
:app:prepareComAndroidSupportCardviewV72220Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72220Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42220Library UP-TO-DATE
:app:prepareComEchoHolographlibrary10Library UP-TO-DATE
:app:prepareComFortysevendegSwipelistviewSwipelistview10SNAPSHOTLibrary UP-TO-DATE
:app:prepareComGetbaseFloatingactionbutton190Library UP-TO-DATE
:app:prepareComGithubGanfraMaterialSpinner110Library UP-TO-DATE
:app:prepareComGithubNavasmdcMaterialDesign15Library UP-TO-DATE
:app:prepareComMcxiaokeVolleyVolley1016Library UP-TO-DATE
:app:prepareComRengwuxianMaterialedittextLibrary213Library UP-TO-DATE
:app:prepareComWdullaerMaterialdatetimepicker131Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:compileDebugJava UP-TO-DATE
:app:preDexDebug UP-TO-DATE
:app:dexDebug UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:validateDebugSigning
:app:packageDebug UP-TO-DATE
:app:zipalignDebug UP-TO-DATE
:app:assembleDebug UP-TO-DATE
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:compileDebugAndroidTestNdk UP-TO-DATE
:app:prepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl UP-TO-DATE
:app:processDebugAndroidTestManifest UP-TO-DATE
:app:compileDebugAndroidTestRenderscript UP-TO-DATE
:app:generateDebugAndroidTestBuildConfig UP-TO-DATE
:app:generateDebugAndroidTestAssets UP-TO-DATE
:app:mergeDebugAndroidTestAssets UP-TO-DATE
:app:generateDebugAndroidTestResValues UP-TO-DATE
:app:generateDebugAndroidTestResources UP-TO-DATE
:app:mergeDebugAndroidTestResources UP-TO-DATE
:app:processDebugAndroidTestResources UP-TO-DATE
:app:generateDebugAndroidTestSources UP-TO-DATE
:app:compileDebugAndroidTestJava UP-TO-DATE
:app:preDexDebugAndroidTest UP-TO-DATE
:app:dexDebugAndroidTest UP-TO-DATE
:app:processDebugAndroidTestJavaRes UP-TO-DATE
:app:packageDebugAndroidTest UP-TO-DATE
:app:assembleDebugAndroidTest UP-TO-DATE
:app:connectedAndroidTest
:app:connectedCheck
:modules:volley:copyDebugLint UP-TO-DATE
:modules:volley:mergeDebugProguardFiles UP-TO-DATE
:modules:volley:preDebugBuild UP-TO-DATE
:modules:volley:checkDebugManifest
:modules:volley:prepareDebugDependencies
:modules:volley:compileDebugAidl UP-TO-DATE
:modules:volley:compileDebugRenderscript UP-TO-DATE
:modules:volley:generateDebugBuildConfig UP-TO-DATE
:modules:volley:generateDebugAssets UP-TO-DATE
:modules:volley:mergeDebugAssets UP-TO-DATE
:modules:volley:generateDebugResValues UP-TO-DATE
:modules:volley:generateDebugResources UP-TO-DATE
:modules:volley:packageDebugResources UP-TO-DATE
:modules:volley:processDebugManifest UP-TO-DATE
:modules:volley:processDebugResources UP-TO-DATE
:modules:volley:generateDebugSources UP-TO-DATE
:modules:volley:compileDebugJava UP-TO-DATE
:modules:volley:processDebugJavaRes UP-TO-DATE
:modules:volley:packageDebugJar UP-TO-DATE
:modules:volley:compileDebugNdk UP-TO-DATE
:modules:volley:packageDebugJniLibs UP-TO-DATE
:modules:volley:packageDebugLocalJar UP-TO-DATE
:modules:volley:packageDebugRenderscript UP-TO-DATE
:modules:volley:bundleDebug UP-TO-DATE
:modules:volley:assembleDebug UP-TO-DATE
:modules:volley:preDebugAndroidTestBuild UP-TO-DATE
:modules:volley:compileDebugAndroidTestNdk UP-TO-DATE
:modules:volley:prepareComAndroidSupportTestEspressoEspressoCore20Library UP-TO-DATE
:modules:volley:prepareComAndroidSupportTestEspressoEspressoIdlingResource20Library UP-TO-DATE
:modules:volley:prepareComAndroidSupportTestTestingSupportLib01Library UP-TO-DATE
:modules:volley:prepareDebugAndroidTestDependencies
:modules:volley:compileDebugAndroidTestAidl UP-TO-DATE
:modules:volley:processDebugAndroidTestManifest UP-TO-DATE
:modules:volley:compileDebugAndroidTestRenderscript UP-TO-DATE
:modules:volley:generateDebugAndroidTestBuildConfig UP-TO-DATE
:modules:volley:generateDebugAndroidTestAssets UP-TO-DATE
:modules:volley:mergeDebugAndroidTestAssets UP-TO-DATE
:modules:volley:generateDebugAndroidTestResValues UP-TO-DATE
:modules:volley:generateDebugAndroidTestResources UP-TO-DATE
:modules:volley:mergeDebugAndroidTestResources UP-TO-DATE
:modules:volley:processDebugAndroidTestResources UP-TO-DATE
:modules:volley:generateDebugAndroidTestSources UP-TO-DATE
:modules:volley:compileDebugAndroidTestJava UP-TO-DATE
:modules:volley:preDexDebugAndroidTest UP-TO-DATE
:modules:volley:dexDebugAndroidTest UP-TO-DATE
:modules:volley:processDebugAndroidTestJavaRes UP-TO-DATE
:modules:volley:validateDebugSigning
:modules:volley:packageDebugAndroidTest
Error: duplicate files during packaging of APK /Users/yasudayousuke/Documents/job/finc/FiNC-Android/modules/volley/build/outputs/apk/volley-debug-androidTest-unaligned.apk
Path in archive: LICENSE.txt
Origin 1: /Users/yasudayousuke/.gradle/caches/modules-2/files-2.1/junit/junit-dep/4.10/64417b3bafdecd366afa514bd5beeae6c1f85ece/junit-dep-4.10.jar
Origin 2: /Users/yasudayousuke/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.1/860340562250678d1a344907ac75754e259cdb14/hamcrest-core-1.1.jar
You can ignore those files in your build.gradle:
android {
packagingOptions {
exclude 'LICENSE.txt'
}
}
:modules:volley:packageDebugAndroidTest FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':modules:volley:packageDebugAndroidTest'.
> Duplicate files copied in APK LICENSE.txt
File 1: /Users/yasudayousuke/.gradle/caches/modules-2/files-2.1/junit/junit-dep/4.10/64417b3bafdecd366afa514bd5beeae6c1f85ece/junit-dep-4.10.jar
File 2: /Users/yasudayousuke/.gradle/caches/modules-2/files-2.1/junit/junit-dep/4.10/64417b3bafdecd366afa514bd5beeae6c1f85ece/junit-dep-4.10.jar
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 18.399 secs
this repository is cloned as projectRoot/modules/volley
.
JsonArrayRequest is missing the contstructor to specify request type, url, payload, and listener.
JsonObjectRequest has both constructers, and JsonRequest (the parent) has the proper constructer.
Let me join thank you.
Good day to you!
Is there any way to cache images for a custom period of time, but not for the time application is in memory. Cause every time I swipe out the app from the memory, all image requests shoud be done again. I'v tried to customize library and enforce cache time in Entry class. I'v loged the CacheDispatcher, and when the app starts after deletion from memory, dispatcher checks for the images to be cached by the key, and every time the listview upload a view with NetworkImage to the screen, dispatcher checks for the same url of image and returns false. But every image in my list is unic
Thanks
This is for the Volley team, not your fork, but when looking at the overhead for submitting a patch to Google my eyes just kinda of glazed over so I thought I would put this somewhere it might be useful.
If you're trying to do this, which many people are:
imageLoader.get(data.getImageUrl(), new ImageLoader.ImageListener(){
@Override
public void onResponse(ImageLoader.ImageContainer response, boolean isImmediate) {
Log.e("TAG",response.toString());
if(response.getBitmap() != null){
Bitmap b = response.getBitmap();
p.imageView.setImageBitmap(response.getBitmap());
}
}
@Override
public void onErrorResponse(VolleyError error) {
}
});
and imageView is a NetworkImageView, the bitmap will trigger an onLayout change and consequently the image will be nulled out on the view. NetworkImageView's should stop trying to get data or changing their content is someone manually is using them as an ImageView.
For those of you who have come across this, you can always just set the url to be something bad for the NetworkImageView (like "NONETWORK") and it will gracefully error out and you can use it manually, but it seems like if you're going to extend from ImageView you shouldn't break the parent class's use cases.
Hi,
I try to make a POST request with params and custom headers, but it not worked.
When I try to make a GET request with my custom headers and URL params, it works.
I use a JsonObjectRequest
and I try to add my POST params in a JSONObject
or in the override method getParams
but none of them work.
Can you help me?
Thanks in advance.
Volley class com.android.volley.VolleyError extends java.lang.Exception. Exception class is Serializable and so VolleyError is. But VolleyError contains a NetworkResponse instance which is not Serializable.
Serializing a VolleyError instance fails with a NotSerializableException.
An AuthFailureError is thrown on status codes 301 and 302 which are redirects. This is not part of the original Volley framework. It would be good to use a separate exception.
I have observed that cancelAll(Object tag) is using "==" to compare tags. This only works if you use the same static object as a tag for both cancel and requests. We use fragments simple names as tags and have one base fragment that ensures requests are cancelled if the fragment is changed. With == not all requests are cancelled since the base class uses instance reference to the class name and not static access.
I would suggest changing it to
return (request.getTag() !=null && request.getTag().equals(tag));
Can we mavenize this and get it on central asap?
in ExecutorDelivery.postResponse(), It calls request.markDelivered();
, but in ExecutorDelivery.postError, It doesn't. why ?
It is not possible to to pass null into the constructor (when using another Method than GET) of the JsonObjectRequest since the new constructors have been added, because multiple constructors apply. Can another constructor for an empty request body be added?
-- never mind ... since it does not make sence to use something else than GET without a requestBody
I achieved L1 and L2 cache in volley(I have tried ImageLoader and NetworkImage)
I get a image url from server like "http://54.xxx.xxx.xxx:10000/xxx/images/xxx.jpg"
I can't get the image cache after I kill the progress
But a url like "http://www.example.com/xxx/xxx/xxx.jpg" works
why?
Process: com.playsport.ps, PID: 25717
java.lang.OutOfMemoryError: pthread_create (stack size 16384 bytes) failed: Try again(Heap Size=19488KB, Allocated=16991KB)
at java.lang.VMThread.create(Native Method)
at java.lang.Thread.start(Thread.java:1063)
at com.android.volley.RequestQueue.start(RequestQueue.java:141)
at com.android.volley.toolbox.Volley.newRequestQueue(Volley.java:66)
at com.android.volley.toolbox.Volley.newRequestQueue(Volley.java:78)
at com.playsport.ps.ServerApi.(ServerApi.java:32)
at com.playsport.ps.DataHelper.(DataHelper.java:12)
at com.playsport.ps.MainActivity.getHeadTitle(MainActivity.java:3672)
at com.playsport.ps.MainActivity.access$000(MainActivity.java:88)
at com.playsport.ps.MainActivity$7.run(MainActivity.java:447)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5872)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:674)
at dalvik.system.NativeStart.main(Native Method)
Who has same problem can help me?
Here is my stacktrace can't reporduce it on my devices though :(
java.lang.NullPointerException
at android.graphics.Bitmap.createBitmap(Bitmap.java:622)
at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:487)
at com.android.volley.toolbox.ImageRequest.doParse(ImageRequest.java:169)
at com.android.volley.toolbox.ImageRequest.parseNetworkResponse(ImageRequest.java:126)
at com.android.volley.CacheDispatcher.run(CacheDispatcher.java:118)
Is there a workaround or this need to be fixed in library ?
Hello,
JsonArrayRequest does not accepts JSONObject as post object.
I found a solution to add this here in Volley Library.
http://stackoverflow.com/questions/18048806/volley-sending-a-post-request-using-jsonarrayrequest
But, I cannot edit gradle file in Android Studio.
Please add this to the code of possible.
Thank You
HttpClient supports a concept of a context that can be used to share mapped attributes about a series of calls:
http://hc.apache.org/httpcomponents-core-ga/httpcore/apidocs/org/apache/http/protocol/HttpContext.html?is-external=true
This is useful for sharing networking level information like
redirect locations and counts, often needed in other places like resolving relative URLs
for HTML rendering.
Volley current uses a single argument execute method in the HttpClient networking stack:
https://github.com/mcxiaoke/android-volley/blob/master/src/com/android/volley/toolbox/HttpClientStack.java#L83
http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/client/HttpClient.html#execute(org.apache.http.client.methods.HttpUriRequest)
The one with an extra HttpContext argument could be used, however, to allow the functionality:
http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/client/HttpClient.html#execute(org.apache.http.client.methods.HttpUriRequest,%20org.apache.http.protocol.HttpContext)
As an old version of volley.jar. we pass params by following method:
@OverRide
public byte[] getBody() {
if (params != null && params.size() > 0) {
return encodeParameters(params, getParamsEncoding());
}
return null;
}
But we need to update volley, and find that this method was changed to private.
I also found that to override the method of getParams(), which did not work for me. the Method getBody of JsonObjectRequest is as following:
public byte[] getBody() {
try {
return mRequestBody == null ? null : mRequestBody.getBytes(PROTOCOL_CHARSET);
} catch (UnsupportedEncodingException uee) {
VolleyLog.wtf("Unsupported Encoding while trying to get the bytes of %s using %s",
mRequestBody, PROTOCOL_CHARSET);
return null;
}
}
so I cannot pass the params now.
i have list in which some of image form network and some of from local how to set local image in NIV
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.